The required structure of the document is defined by the DTD. During editing of a document, parts of the document may become invalid because not all content requirements are met by the current structure of the document.
epcEdit tries to maintain the document in a valid state, but this is not always possible. Consider a situation where you insert a new element X. If this element has a content definition that requires either an element A or an element B to occur inside of X, the document will remain invalid until an A or an B element has been inserted in X.
If an element becomes invalid (mostly because it is incomplete as described above), epcEdit will display the text of the start and end tags of the invalid element in red color. Additionally, the small icon to the left of the element name in the document tree will show a red exclamation sign to express that the element needs attention.
There are two ways of checking the validity of your document: You can quick-check a specific element to find out what is wrong with the element, or you can perform a complete validation of the whole document.
Checking an element is a quick way of determining if an element appears to be correct or not. This check verifies that the element structure of the element in question is correct and that the element is complete; it does not perform a complete validation of the element content (e.g. detect invalid characters within text in the element).
To check an element, follow these steps:
Place the insertion cursor inside the element you want to check.
Select from the menu.
A message box will appear that tells you whether the element is OK or not. In the latter case, the insertion cursor will be moved to the location where the problem occurred and the message box will contain a description of the problem.
An in-depth check of the document can be performed by validating the document. This process will examine the document as if it were read from a file by a validating external XML/SGML parser and report any problems that were found.
In addition to just checking the element structure of the document, the validation process will discover problems that are beyond the scope of a single element. A complete validation will check the text of the document for the occurrence of any invalid characters, perform cross-element tests like checking for undefined IDs, and much more. If the document validation succeeds without reporting any errors, you can be sure that your document is wellformed and valid with respect to the underlying DTD. A document that can be validated by epcEdit is likely to be processed by other XML/SGML software without problems.
Follow these steps to validate your document:
Validating the document
Select -> from the main menu or click on the button in the toolbar.
If any errors are found in the document, a dialog will appear that describes the errors.

See Figure 15-4 for more details on the validation dialog.
Depending on your preferences settings, epcEdit will validate your document automatically when you save the document to a file. See Figure 15-19 and Save for additional details.