|Editing XML Documents / Validating XML Documents|
A Well-Formed XML document is a document that conforms to the XML syntax rules. A Namespace Well-Formed XML document is a document that is XML Well-Formed and is also namespace-wellformed and namespace-valid.
The XML Syntax rules for Well-Formed XML are:
The namespace-wellformed rules are:
The namespace-valid rules are:
To check if a document is Namespace Well-Formed XML, select the Check Well-Formedness (Alt + Shift + V, W (Meta + Alt + V, W on OS X)) action from the XML menu or from the Validation toolbar drop-down menu. If any error is found the result is returned to the message panel. Each error is one record in the result list and is accompanied by an error message. Clicking the record will open the document containing the error and highlight its approximate location.
<root><tag></root>When Check Well-Formedness is performed the following error is raised:
The element type "tag" must be terminated by the matching end-tag "</tag>"
To resolve the error, click in the result list record which will locate and highlight the errors approximate position. Identify which start tag is missing an end tag and insert </tag>.
<x::y></x::y>When Check document form is performed the following error is raised:
Element or attribute do not match QName production: QName::=(NCName':')?NCName.
<x:y></x:y>When Check document form is performed the following error is raised:
The prefix "x" for element "x:y" is not bound.
Also the selected files in the current project can be checked for well-formedness with a single action by selecting the Check Well-Formedness action from the Validate submenu when invoking the contextual menu in the Navigator view.