Limits and restrictions for annotated XML schema decomposition

Certain limits and restrictions apply to annotated XML schema decomposition.

Limits

Table 1. Limits for annotated XML schema decomposition
Condition Limit value
Maximum size of document to be decomposed 2 GB
Maximum number of tables referred to in a single annotated XML schema 100
Maximum number of $DECOMP_CONTENT or $DECOMP_ELEMENTID instances in an db2-xdb:expression annotation 10
Maximum number of steps in db2-xdb:locationPath 100
Maximum number of namespaces explicitly listed in the "namespace" attribute of <xs:any> or <xs:anyAttribute> (if the list contains the special values ##targetNamespace or ##local, then these also count towards the limit) 25
Maximum string length of the value of db2-xdb:name (table name), db2-xdb:column, db2-xdb:defaultSQLSchema, or db2-xdb:SQLSchema Same as the limit for the corresponding Db2® object
Maximum string length of the value of db2-xdb:rowSet Same as the limit for db2-xdb:name
Maximum string length for value of $DECOMP_CONTENT 4096 bytes

Restrictions

  • Annotated XML schema decomposition does not support the following:
    • decomposition of element of attribute wildcards: elements or attributes in the XML document that correspond to the <xs:any> or <xs:anyAttribute> declaration in the XML schema are not decomposed.

      If, however, these elements or attributes are children of elements that are decomposed with db2-xdb:contentHandling set to "serializeSubtree" or "stringValue", then the contents of the wildcard elements or attributes will be decomposed as part of the serialized subtree or string value. These wildcard element or attributes must satisfy the namespace constraints specified in the corresponding <xs:any> or <xs:anyAttribute> declaration, however, in order to be part of the serialization.

    • substitution groups: an error is generated if a member of a substitution group appears in the XML document where the group head appears in the XML schema, for cases when the substitution group members are used not only as the root element of the document.
      As a workaround, the element declarations of the substitution group's head and members can instead be changed to a named model group of type xs:choice. For example, these substitution group declarations
      <xs:element name="head" type="BaseType" />
      <xs:element name="member1" type="derived1FromBaseType" substitutionGroup="head"/>
      <xs:element name="member2" type="derived2FromBaseType" substitutionGroup="head"/>
      <xs:element name="member3" type="derived3FromBaseType" substitutionGroup="head"/>
      can be changed to an equivalent named model group:
      <xs:group name="mysubstitutiongrp">
        <xs:choice>
          <xs:element name="head" type="BaseType"/>
          <xs:element name="member1" type="derived1FromBaseType"/>
          <xs:element name="member2" type="derived2FromBaseType"/>
           <xs:element name="member3" type="derived3FromBaseType"/>
        </xs:choice>
      </xs:group>

      Occurrences of the <head> element can then be replaced with the newly defined named model group in the XML document.

    • runtime substitution using xsi:type: an element is decomposed according to the mappings in the schema type associated with the element name in the schema. Specifying a different type for an element in the document through the use of xsi:type results in an error being returned during decomposition.

      Ensure that the type of an element specified with xsi:type in the XML document matches the type specified for that element in the context. If the content of the element or its descendants does not need to be decomposed individually, then the type of the element can be changed to xs:anyType in the XML schema. With this change, the XML documents do not need to be modified.

    • recursive elements: XML schemas containing recursion can be registered in the XML schema repository (XSR) and enabled for decomposition. However, the recursive sections of an associated XML instance document cannot be decomposed as scalar values into a target table. By using appropriate schema annotations, the recursive sections can be stored and later retrieved as serialized markup.
    • updates to or deletion of existing rows in target tables: decomposition only supports the insertion of new rows. (You can still update or delete rows outside of the XML decomposition process.)
    • attributes of simple type derived from NOTATION: decomposition inserts only the notation name.
    • attributes of type ENTITY: decomposition inserts only the entity name.
    • multiple mappings to the same rowSet and column with db2-xdb:expression and db2-xdb:condition: where multiple items can be legally mapped to the same rowSet and column, according to mapping rules, the mappings must not contain the db2-xdb:expression or db2-xdb:condition annotations.
  • In a partitioned database environment, annotated XML schema decomposition is supported only on the database partition that contains the database catalog tables (the IBMCATGROUP database partition).