Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - XML Schemas

XDR Schema Reference

Microsoft® XML Core Services (MSXML) versions 2.0 and later include support for XML-Data Reduced (XDR) schemas.

XDR schema is based on the World Wide Web Consortium (W3C) XML-Data Note. XDR schema is implemented as a subset of the XML-Data submission that corresponds to the feature set proposed for the Document Content Description (DCD) for XML.

Microsoft is actively involved in defining the emerging W3C XML Schema standard, XML Schema definition language (XSD). MSXML and several other Microsoft products, such as Microsoft BizTalk™ Server, Microsoft Office 2000, and Microsoft SQL Server™ 2000, continue to support XDR schema.

Unlike the unique document type definition (DTD) syntax, XDR schema allows you to define the rules governing the relations between elements and attributes using a standard XML instance syntax, which can be parsed and managed using XML applications. XDR schema also adds support for namespaces, data types, and features like range constraints.

The definitions in an XDR schema are contained within the top-level Schema element. The Schema element definition must come from the namespace xmlns="urn:schemas-microsoft-com:xml-data". The namespace declaration is an XML processing instruction as defined in the W3C Namespace in XML. It is convenient to make the Schema namespace the default namespace to avoid having to prefix all definitions within a schema. This documentation uses the convention in which the Schema namespace is the default namespace and omits a prefix from all XDR schema element and attribute names.

The Schema element in an XDR schema document should also contain namespace declarations for any other schemas, such as the namespace that defines the built-in data types for XDR schema.

<Schema name="myschema" xmlns="urn:schemas-microsoft-com:xml-data"
                        xmlns:dt="urn:schemas-microsoft-com:datatypes">
 <!-- ... -->
</Schema>

The Schema element can contain any number of top-level declarations. The principal XDR schema elements include ElementType, which declares element types, and AttributeType, which declares attribute types. These elements must have an explicit name attribute that is unique within the schema. The XDR schema element and attribute elements can appear within the ElementType element to constrain the content and attributes that can appear in elements of the named type. The ElementType attribute order, and the group element, allow you to further establish finely-grained definitions. The minOccurs and maxOccurs attributes allow you to define the number of occurrences of an element or group.

The content for an element of a given element type can be defined as one of four categories: empty (no content), text only, subelements only, or a mixture of text and subelements. This choice is expressed in the ElementType attribute named content, which can take the values empty, textOnly, eltOnly, and mixed, respectively.

Element types and attribute types can constrain their values and contents to be instances of a particular data type, referenced from the datatype element namespace. To use the datatype namespace in a schema, it must be declared within the Schema element. The dt:type attribute can then be used to reference data types; in Microsoft Internet Explorer version 5.0 and later, element and attribute types can take rich data types. For more information about data types, see the XML Data Types Reference.

See Also

ElementType | AttributeType | element | attribute | datatype | XDR Schema Data Types Reference | XDR Schema Developer's Guide | XML Reference | Schema

Other Resources Other Resources

XML-Data Note | Document Content Description for XML | Namespaces in XML Recommendation