Example: Consolidated Schema Document - 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

The following is a sample consolidated schema document:

<?xml version="1.0" encoding="UTF-8"?>
<ConsolidatedSchema
   schemaURI="http://www.example.com/schemauri" >
   <ComponentSchema locationURI="http://example.com/schemauri"
      targetNamespace="http://www.example.com/tns">
      <xs:schema xmlns:xs="..." xmlns:xsi="..."
         xmlns:tns="http://www.example.com/tns">
      ....
      </xs:schema>
   </ComponentSchema>
   <ComponentSchema locationURI="http://www.example.com/includedschema1.xsd"
      targetNamespace="http://www.example.com/tns">
      <xs:schema xmlns:xs="..." xmlns:xsi="..."
         xmlns:tns="http://www.example.com/tns">
      ....
      </xs:schema>
   </ComponentSchema>
   <ComponentSchema locationURI="../otherschema/importedschema1.xsd"
      targetNamespace="http://www.example.com/tns2">
      <xs:schema xmlns:xs="..." xmlns:xsi="..."
         xmlns:tns2="http://www.example.com/tns2">
      ....
      </xs:schema>
   </ComponentSchema>
</ConsolidatedSchema>

The ConsolidatedSchema element represents the envelope which will contain the individual schema documents that make up the schema. It identifies the schema in question through a schemaURI attribute, making it a complete self-identifying package.

The ComponentSchema element, which is a child of the ConsolidatedSchema element, will wrap each individual schema document that makes up the schema grammar. This element contains a locationURI attribute that is used to pick out the schema document when it is required during the processing of the root schema. For example, if a schema with a given location URI is imported in the root schema or one of the other imported/included schemas, the resolver will pick the ComponentSchema element with the appropriate locationURI attribute and take its xs:schema child element.