2.3.1.2 Schema

The Schema element is the root XML element, or document element, of an XDR schema. It can contain definitions of elements (see section 2.3.1.4) and attributes (see section 2.3.1.5) that are permitted to appear in a valid document. The following XML schema defines the Schema element:

  
   <xs:element  name='Schema'>
     <xs:complexType >
       <xs:choice  minOccurs='0' maxOccurs='unbounded'>
         <xs:element  ref='xdr:AttributeType'/>
         <xs:element  ref='xdr:ElementType'/>
         <xs:element  ref='xdr:description'/>
         <xs:any  namespace='##other' processContents='skip'/>
       </xs:choice>
       <xs:attribute  name='name' type='xs:string'/>
       <xs:attribute  name='id' type='xs:ID'/>
       <xs:anyAttribute  namespace='##other'
                         processContents='skip'/>
     </xs:complexType>
   </xs:element>

AttributeType: One or more attribute elements (see section 2.3.1.5) that can be used to decorate various elements in a valid document. In ADO XML Persistence schema global AttributeType schema elements are not supported. That is, AttributeType cannot be child of Schema element.

ElementType: One or more definitions of elements that can appear in valid document. In ADO XML Persistence schema, ElementType MUST appear once and only once inside a Schema element.

According to XDR schema definitions, element tags and element classes are tightly coupled. That is, the tag defines the class. This is unlike XSD, where one can define complex type, and then prescribe that type to one or more elements, perhaps with different tags.

description: A description for the Schema element.

name: The name of the schema.

id: The identifier of the schema. If it is prefixed with the number sign (#), it can be used as a namespace if the XML document contains both the schema and data sections.