Microsoft XML Core Services (MSXML) version 2.0 or later enables XML-Data Reduced (XDR) schemas to be referenced directly from a namespace declaration. This allows the MSXML parser to validate the XML document against the rules or grammar defined in the schema.
It also allows the object model to expose data types and to allow navigation to the schema document through the definition property. For more information, see XDR Schemas and the DOM.
A namespace declaration can reference a schema by including the URL to the schema document prefaced by the "x-schema:"
string. For example, to reference an XDR schema for books from an XML file conforming to this schema, write the following.
<book xmlns="x-schema:http://www.microsoft.com/xml/schema/book.xml"> <title>Presenting XML</title> <author>Richard Light</author> <pages>334</pages> </book>
Here the default namespace refers to the sample book grammar used in Defining Elements and Attributes. The namespace Uniform Resource Identifier (URI) is prefixed with "x-schema:" to indicate to MSXML that there is a schema corresponding to this namespace. The remainder of the URI is the schema's location. The path or URI to the schema file must be valid, or a parse error will occur. A schema can also be created as part of the XML document.
namespaces Property | schemas Property | Using Inline XDR Schemas