2.3.1.4 ElementType

The ElementType element specifies the type (for example, tags, possible contents, and child elements) of the elements that appear in the valid document. The following XML schema defines the ElementType element:

 <xs:element  name='ElementType'>
     <xs:complexType >
       <xs:choice  minOccurs='0' maxOccurs='unbounded'>
         <xs:element  ref='xdr:AttributeType'/>
         <xs:element  ref='xdr:attribute'/>
         <xs:element  ref='xdr:element'/>
         <xs:element  ref='xdr:group'/>
         <xs:element  ref='xdr:datatype'/>
         <xs:element  ref='xdr:description'/>
         <xs:element  ref='xdr:extends'/>
         <xs:any  namespace='##other'
                  processContents='skip'/>
       </xs:choice>
       <xs:attribute  name='name'
                      type='xs:ID'/>
       <xs:attribute  name='content'>
         <xs:simpleType >
           <xs:restriction  base='xs:string'>
             <xs:enumeration  value='empty'/>
             <xs:enumeration  value='textOnly'/>
             <xs:enumeration  value='eltOnly'/>
             <xs:enumeration  value='mixed'/>
           </xs:restriction>
         </xs:simpleType>
       </xs:attribute>
       <xs:attribute  ref='xdr:model'/>
       <xs:attribute  ref='xdr:order'/>
       <xs:attributeGroup  ref='dt:typeAttributes'/>
       <xs:anyAttribute  namespace='##other'/>
     </xs:complexType>
   </xs:element>

AttributeType: Defines the attribute that is local to this element, that is, not applicable to other ElementType elements (see section 2.3.1.5).

attribute: A reference, with partial redefinition, to an AttributeType, (see section 2.3.1.7), which can be used to decorate this XML element.

element: A reference to other ElementType elements that can appear inside of this element (see section 2.3.1.6).

group: A structural construct to control the order and number of the elements listed inside of this group (see section 2.3.1.8).

datatype: The data type of the element value, if its content is text, or mixed, otherwise not applicable (see section 2.3.1.3). This element MUST NOT appear more than once inside of the defined element type. The data type can be defined with dt:typeAttributes.

description: A description for the ElementType element.

extends: A reference to other ElementType in this XDR schema or in a foreign namespace: a "base type". Extended element type inherits all the attributes of the base ElementType.

name: The tag of the element, as it appears in the valid document. This is also the name used by schema element references in the XDR schema. This attribute is mandatory and has to be unique in the scope of the XDR schema.

content: Prescribes which content this element can have. Values are specified in the content attribute (see section 2.3.2.4). The content attribute value is by default "mixed". The content attribute value affects the default value for the order attribute: "mixed" content has default order "many", while "eltOnly" content has default order "seq".

model: Indicates whether this element is "open", that is, whether it can contain elements and attributes having a namespace not defined by this schema, or "closed". The default value is "open", which allows child elements and attributes from foreign namespaces. Whether to interpret or to ignore those foreign child elements and attributes is left to the discretion of the data receiver.

order: Controls how the child elements appear. See section 2.3.2.1 for the definition. See section 2.3.1.8, for the examples of order usage.

dt:typeAttributes: A simple way of defining value data type for the element. It is applicable only if content is "textOnly" or "mixed", otherwise this attribute MUST NOT be used.

XDR Schema does not prescribe which element, among defined ElementTypes, can appear as the root tag in the valid document. In fact, any ElementType can be the valid root.