16.20 - Adding Schema Annotations - Teradata Vantage NewSQL Engine

Teradata Vantage™ XML Data Type

Teradata Database
Teradata Vantage NewSQL Engine
March 2019
Programming Reference

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:

      <context xmlFeatureVersion="1.0" xmlns="http://www.teradata.com/xml">
         <rootElement ref="_customer_item_"/>
            <operation type="insert">
               <table name="CUSTDTL">
                  <column name="ID" ref="_customerID_item_" path="Customer/@ID">
                     <sqltype name="char">
                        <constraint name="length">9</constraint>

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.