| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE html |
| PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html> |
| <head> |
| <!-- /******************************************************************************* |
| * Copyright (c) 2000, 2005 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ --> |
| <link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" /> |
| <title>Validating an XML schema</title> |
| </head> |
| <body id="tvdtschm"><a name="tvdtschm"><!-- --></a> |
| |
| <h1 class="topictitle1">Validating XML schemas</h1> |
| <div><p>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.</p><div class="skipspace"><p>The following instructions were |
| written for the Resource perspective, but they will also work in many |
| other perspectives.</p> |
| <p>To validate |
| an XML schema, follow these steps:</p> |
| </div> |
| <ol><li class="skipspace"><span>Right-click your file in the Navigator view and click <span class="uicontrol"> |
| <b>Validate |
| XML Schema</b>.</span></span></li> |
| <li class="skipspace"><span>You will receive a message indicating whether the XML schema file is |
| valid.</span> If validation was not successful, refer to the Problems |
| view to see what problems were logged. <div class="note"><span class="notetitle"> |
| <b>Note</b>: </span>If you receive an error message |
| indicating that the Problems view is full, you can increase the number of |
| error messages allowed by selecting <b> <span class="menucascade"><span class="uicontrol">Properties > |
| Validation</span></span></b> from the project's pop-up menu and specifying |
| the maximum number of error messages allowed.</div> |
| </li> |
| </ol> |
| <div class="skipspace"><p>The XML schema support in the XML schema editor is |
| based on the W3C XML Schema Recommendation Specification of 2 May 2001. The |
| XML Schema specifications <a href="http://www.w3.org/TR/xmlschema-1/" target="_blank">XML Schema Part 1: Structures</a> and <a href="http://www.w3.org/TR/xmlschema-2/" target="_blank">XML Schema Part 2: Datatypes</a> |
| from the W3C Web site are used for validation.</p> |
| <p>Certain error messages contain |
| a reference to the schema constraints listed in Appendix C of the <a href="http://www.w3.org/TR/xmlschema-1/" target="_blank">XML Schema Part 1: Structures</a> 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: <tt class="sysout">ct-props-correct.2,</tt> 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". The <tt class="sysout">.2</tt> means the 2nd constraint, which |
| reads: "2. If the {base type definition} is a simple type definition, the |
| {derivation method} must be extension."</p> |
| <p>You can set up a project's properties |
| so that different types of project resources are automatically validated when |
| you save them. From a project's pop-up menu select <span class="uicontrol">Properties</span>, |
| then select <span class="uicontrol">Validation</span>. Any validators you can run |
| against your project will be listed in the Validation page.</p> |
| </div> |
| </div> |
| |
| <div><p><b class="reltaskshd">Related tasks</b><br /> |
| <a href="../topics/tcxmlsch.html" title="You can create an XML schema and then edit it using the XML schema editor.">Creating XML schemas</a><br /> |
| </p> |
| </div> |
| |
| <div><div class="relinfo"><strong>Related information</strong><br /> |
| <div><a href="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.html" title="General validation information">../../org.eclipse.jst.j2ee.doc.user/topics/tjval.html</a></div> |
| <div><a href="http://www.w3.org/TR/xmlschema-1" target="_blank" title="See the W3C Web site for more information on XML Schema specifications">XML |
| Schema Part 1: Structures</a></div> |
| <div><a href="http://www.w3.org/TR/xmlschema-2" target="_blank" title="See the W3C Web site for more information on XML Schema specifications">XML |
| Schema Part 2: Datatypes</a></div> |
| </div> |
| </div> |
| |
| </body> |
| </html> |