DB2 Version 9.7 for Linux, UNIX, and Windows

Keywords for annotated XML schema decomposition

Annotated XML schema decomposition offers decomposition keywords for use in the db2-xdb:condition and db2-xdb:expression annotations.

$DECOMP_CONTENT
The value of the mapped XML element or attribute from the document, constructed according to the setting of the db2-xdb:contentHandling annotation. The value replaced for $DECOMP_CONTENT in the expression should always be considered a character type. Refer to the limits and restrictions documentation for the maximum string length of and maximum number of $DECOMP_CONTENT instances supported. If db2-xdb:expression specifies $DECOMP_CONTENT and db2-xdb:normalization is specified in the same mapping, then the $DECOMP_CONTENT value for db2-xdb:expression will be normalized before it is passed to the expression for evaluation, if applicable.

$DECOMP_CONTENT can be used to process the value of the mapped element or attribute, using customized expressions, rather than directly inserting that value.

$DECOMP_DOCUMENTID
The string value specified in the documentid input parameter of the xdbDecompXML stored procedure, which identifies the XML document being decomposed. When the document is decomposed, the input value provided to the xdbDecompXML stored procedure is used as the value substituted for $DECOMP_DOCUMENTID.

Applications can pass into xdbDecompXML, uniquely generated document IDs. These IDs can then be directly inserted into the database. The IDs can also be passed into expressions that generate unique identifiers for elements or attributes. $DECOMP_DOCUMENTID can be used, therefore, to insert unique identifiers that are not present in the XML document.

$DECOMP_ELEMENTID
A system-generated integer identifier that uniquely identifies within the XML document, the element or attribute this annotation describes. This value will remain unchanged between decomposition operations for the same XML document, as long as the document does not change in any of the following ways: element addition, element deletion, or a change in an element's position in document order. If the document is modified in these ways and decomposed again, elements might not have the same identifier as they did following the previous decomposition. $DECOMP_ELEMENTID specified on an attribute is defined to be the value of the $DECOMP_ELEMENTID for the element to which this attribute belongs.

The value generated by $DECOMP_ELEMENTID can also be used to indicate the order of elements in the original document. This can be useful in cases where the XML document needs to be re-composed from relational tables.