Run the Application (SAX Validator)

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - SAX2 Developer's Guide

Run the Application (SAX Validator)

The following instructions are based on the books.xml and books.xsd files. However, you can use other XML and XSD documents as the files for this application.

To run the application

  1. Save the project and then copy books.xml to the folder where you saved the project.
  2. From the Visual Basic toolbar, click Start.
  3. In the XML file to validate text box, verify that the path for the books.xml file is valid and correct.
  4. In the Use this XSD schema file to validate it text box, verify that the path for the books.xsd file is valid and correct.
  5. On the form, click Validate.

If the validation is successful, the Results text box displays the following results.

File is valid.

To verify that validation is working, try opening books.xml and changing the names of elements to names that are not allowed by the books.xsd schema.

For example, if you change the following line in books.xml from this:

  <price>44.95</price>

to this:

  <cost>44.95</cost>

you will get a validation error when you next run the SAX Validator application. The following is an example of a validation error.

Error: (-2147467259) Element content is invalid according to the DTD/Schema.
Expecting: price.
at line 7, column 14

See Also

Sample XML File (books.xml) | Sample XSD Schema File (SAX Validator) | Validate Documents Using SAX | Overview of the SAX Validator Application | Application Form (SAX Validator) | MyValidator Class (SAX Validator) | How the SAX Validator Application Works