This topic has not yet been rated - Rate this topic

How to: Select the XML Schema(s) to Use for Validation 

The XML Editor provides a schema cache located in the %InstallDir%\Xml\Schemas directory. The schema cache includes well-known XML schemas that are used for IntelliSense and XML document validation.

NoteImportant

The XML Editor install directory variable was changed in Visual Studio 2005 Service Pack 1. If you do not have Visual Studio 2005 Service Pack 1, or later, installed, the XML Editor uses %VSInstallDir% for the install directory variable.

The Schemas document property is used to select which XML schema definition language (XSD) schema to use for validation. It allows you to select a schema from the schema cache, or to specify a schema that is not located in the cache.

The schemas you specify are saved in the Solution, along with all other XML document properties. As a result, you do not have to reenter these values the next time you open the solution.

NoteNote

The editor can validate using an inline schema, or a schema referenced by the xsd:schemaLocation attribute. For more information, see XML Document Validation.

To select an XML Schema

  1. Open a file in the XML editor.

  2. In the document properties window, click the button on the Schemas field.

    The XSD Schemas dialog box is displayed. The dialog box lists all schemas with an .xsd extension in the schema cache (including schemas referenced in the catalog.xml file), and also any schema that is in the current solution, open in Visual Studio, referenced in an xsd:schemaLocation attribute, or referenced in the Schemas property.

  3. Select the schemas to use for validation by doing one of the following:

    • Select any of the schemas listed in the XSD Schemas dialog.

    -or-

    • Click Add. This opens the Open XSD Schema dialog, which enables you to select another schema.

  4. Click OK.

    The list of selected schemas is copied back to the Schemas document property.

See Also

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.