Adding Schema Annotations - Teradata Vantage NewSQL Engine - 16.20

Teradata Vantage™ XML Data Type

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1140-162K

To add an annotation to an XML schema, you add an xs:annotation element with an xs:appInfo as its child element, and any application specific elements under it.

This is an example of a Context annotation that is used to explain the various elements that occur as part of the annotations:

<xs:annotation>
   <xs:appinfo>
      <context xmlFeatureVersion="1.0" xmlns="http://www.teradata.com/xml">
         <defaultDatabase>XMLTYPE_TEST</defaultDatabase>
         <defaultEncoding>ISO-8859-1</defaultEncoding>
         <rootElement ref="_customer_item_"/>
         <transaction>
            <operation type="insert">
               <table name="CUSTDTL">
                  <column name="ID" ref="_customerID_item_" path="Customer/@ID">
                     <sqltype name="char">
                        <constraint name="length">9</constraint>
                     </sqltype>
                  </column>
                  ...
                  ...
</xs:annotation>

The Context annotation is the most important annotation in the schema for defining how a document should be shredded. You add it as the first annotation under the xs:schema element in the root schema document that describes the XML documents to be shredded. The following sections describe some of the key components of the context annotation.