Using XPath Extension Functions for XSD Support

The topics in this section provide an example of how to use XPath extension functions for XSD support. The example consists of the following pieces.

  • books.xml
    The file that is loaded and validated against the books.xsd schema.
  • books.xsd
    The XSD schema that is used to validate the books.xml file.
  • Microsoft Visual Basic example code
    This Visual Basic example code:

    • Creates an XMLSchemaCache object.

    • Adds the schema to the XMLSchemaCache object.

    • Creates a DOMDocument object and sets the schemas property to reference the books.xsd schema. The example code also sets the SelectionLanguage and SelectionNamespaces properties on the DOMDocument object.

    • Uses the XSD type-local-name function to select a node based on its data type.

    • Uses the XSD type-is function to return a node list that contains nodes only of the data type string.

To get started

  1. Open Visual Basic 6.0, and in the New Project dialog box, double-click Standard EXE.

  2. On the Project menu, click References.

  3. In the Available References list, select Microsoft XML,v5.0, and then click OK.

  4. Add a Command button to Form1.

  5. Save the project to a folder on your hard drive.

This example uses the following topics.

See Also

Reference

XML Schema Examples
XML Schema Elements
XML Data Types Reference
Primitive XML Data Types
Derived XML Data Types

Concepts

Data Type Facets