Unlike a Document Type Definition (DTD), XML Schema allows you to specify a data type for an element or attribute. Data types indicate the format of the data, provide for validation of the type by the XML parser, and enable processing specific to the data type in the XML Document Object Model (DOM).
Data type support includes primitive data types common to programming languages as well as the special attribute types included in the XML Language Specification (for example, ID, IDREF, and NMTOKEN). A complete list of the data types can be found in the XML Data Types Reference. For more information about data type support for attributes, see Attribute Data Types.
To use the data type support included with Internet Explorer 5, your XML Schema must include the datatypes namespace. The top-level <Schema> element declaration would look like this:
<Schema name="myschema" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes"> <!-- ... --> </Schema>
Within the <Schema> element, data types can be specified on an <ElementType> or <AttributeType> basis using one of two forms:
Both forms are demonstrated below shown in a declaration—the samples are equivalent.
<ElementType name="pages" dt:type="int"/> <ElementType name="pages"> <datatype dt:type= "int"/> </ElementType>