Decomposing XML documents with annotated XML schemas into nicknames
With annotated XML schema decomposition, you can decompose documents that are based on annotations specified in an XML schema.
About this task
The annotated schema documents must be stored in and registered with the XML schema repository (XSR).
In cases where you need to access XML data as relational data, rather than in its hierarchical form, you can decompose, or shred, the XML data. You can decompose an XML document into a nickname that references a remote table.
Procedure
- Annotate the schema documents with XML schema decomposition.
- Create the nickname that you want to use for decomposition. The name of the nickname must match the values in the annotated schema.
- Register the schema using the REGISTER XMLSCHEMA command.
- Grant USAGE privileges on the XSR object to allow specific users to use a specific XML schema.
- Enable the schema for decomposition using the ALTER XSROBJECT statement.
- Use the DECOMPOSE XML DOCUMENT command to decompose the XML instance document.