Annotations for decomposition can be specified as either element or attribute declarations in an XML schema document.
Annotations specified as simple attributes on element or attribute declarations apply only to that element or attribute on which it is specified.
<xs:element name="isbn" type="xs:string"
db2-xdb:rowSet="TEXTBOOKS" db2-xdb:column="ISBN"/>
The db2-xdb:rowSet and db2-xdb:column annotations apply only to this element named isbn.
Annotations specified as structured children elements of an element or attribute declaration must be specified in the schema document within the <xs:annotation><xs:appinfo></xs:appinfo></xs:annotation> hierarchy defined by XML Schema.
<xs:element name="isbn" type="xs:string">
<xs:annotation>
<xs:appinfo>
<db2-xdb:rowSetMapping>
<db2-xdb:rowSet>TEXTBOOKS</db2-xdb:rowSet>
<db2-xdb:column>ISBN</db2-xdb:column>
</db2-xdb:rowSetMapping>
</xs:appinfo>
</xs:annotation>
</xs:element>
Specifying the db2-xdb:rowSet and db2-xdb:column annotations as children elements is equivalent to specifying these annotations as attributes (which was shown previously). While more verbose than the method of specifying annotations as attributes, specifying annotations as children elements is required when you need to specify more than one <db2-xdb:rowSetMapping> for an element or attribute; that is, when you need to specify multiple mappings on the same element or attribute declaration.
When an annotation is specified as a child of the <xs:schema> element, it is a global annotation that applies to all of the XML schema documents that make up the XML schema.
<xs:schema>
<xs:annotation>
<xs:appinfo>
<db2-xdb:defaultSQLSchema>admin</db2-xdb:defaultSQLSchema>
</xs:appinfo>
</xs:annotation>
…
</xs:schema>
This declaration specifies that all unqualified tables across all schema documents that form this XML schema will have the SQL schema of "admin".
Refer to the documentation for a specific annotation to determine how a particular annotation can be specified.