Annotated XML schema decomposition

Annotated XML schema decomposition, also referred to as "decomposition" or "shredding," is the process of storing content from an XML document in columns of relational tables. Annotated XML schema decomposition operates based on annotations specified in an XML schema. After an XML document is decomposed, the inserted data has the SQL data type of the column that it is inserted into.

An XML schema consists of one or more XML schema documents. In annotated XML schema decomposition, or schema-based decomposition, you control decomposition by annotating a document's XML schema with decomposition annotations. These annotations specify details such as:
  • the name of the target table and column the XML data is to be stored in
  • the default SQL schema for when a target table's SQL schema is not identified
  • any transformation of the content before it is stored
Refer to the summary of decomposition annotations for further examples of what can be specified through these annotations.

The annotated schema documents must be stored in and registered with the XML schema repository (XSR). The schema must then be enabled for decomposition.

After the successful registration of the annotated schema, decomposition can be performed by calling the decomposition stored procedure.

The data from the XML document is always validated during decomposition. If information in an XML document does not comply with its specification in an XML schema then the data is not inserted into the table.