Hi, I am new to Oracle and Oracle XML DB, and I am trying out all the features to see whether XML DB is applicable to my situation at all.
Currently, I am trying to link the relationships between the XML documents.
I have one document that goes something like this:
<XList>
<X>
<X_id>x1</X_id>
<Y_id>y1</Y_id>
<X_data>x_data1</X_data>
</X>
<X>
<X_id>x2</X_id>
<Y_id>y2</Y_id>
<X_data>x_data2</X_data>
</X>
</XList>
And another document like this:
<YList>
<Y>
<Y_id>y1</Y_id>
<Y_data>y_data1</Y_data>
</Y>
<Y>
<Y_id>y2</Y_id>
<Y_data>y_data2</Y_data>
</Y>
</YList>
Is there a way to output a X element out in XML that also fetches the related Y element too, something like (when selecting x_id = x1):
<X>
<X_id>x1</X_id>
<Y_id>y1</Y_id>
<Y>
<Y_id>y1</Y_id>
<Y_data>y_data1</Y_data>
</Y>
<X_data>x_data1</X_data>
</X>
I have registered the schema and inserted both documents into the same table with a XMLType column, using createSchemaBasedXML during insert. The reason for one generic table is that this needs to be as flexible as possible. Both the XML schema and XML docs/tags are user generated, so there are infinite combinations of related elements users can specify, and no predefine tags. Is there a way I can build a tool that allows users to say /Xlist/X/Y_id points to /Ylist/Y/Y_id so gather the related fragment? I am implement this under PHP (think I may have to change to Java - code just doesn't seem to work with the PHP oci library)
Also, how do you know if your schema is working and the inserted XML is structured and not stored as one big CLOB.
Thanks.