Validating XML schemas

Validating an XML schema determines whether the current state of the XML schema file is semantically valid. Any errors will be displayed in the Problems view.

The following instructions were written for the Resource perspective, but they will also work in many other perspectives.

To validate an XML schema, complete the following steps:

  1. Right-click your file in the Navigator view and click Validate.
  2. If validation was not successful, you can refer to the Problems view to see what problems were logged.
    Note: If you receive an error message indicating that the Problems view is full, you can increase the number of error messages allowed by clicking Window > Preferences and selecting General > Markers. Select the Use marker limits check box and change the number in the Limit visible items per group field.

The XML schema support in the XML schema editor is based on the W3C XML Schema Recommendation Specification. The XML Schema specifications XML Schema Part 1: Structures and XML Schema Part 2: Datatypes from the W3C Web site are used for validation.

Certain error messages contain a reference to the schema constraints listed in Appendix C of the XML Schema Part 1: Structures document. Each constraint has a unique name that will be referenced in the error message. For example, if you receive an error message with this text: ct-props-correct and you searched in the Structure document for the text, you would find that it is for the section "Schema Component Constraint: Complex Type Definition Properties Correct".

You can set up a project's properties so that different types of project resources are automatically validated when you save them (this is set for all resources by default). From a project's pop-up menu select Properties, then select Validation. Any validators you can run against your project will be listed in the Validation page.

Related tasks
Creating XML schemas
Related information
Validating code in enterprise applications
XML Schema Part 1: Structures
XML Schema Part 2: Datatypes