Validating a Document
As a general rule, web browsers do not validate documents but only check them for well-formedness. If you’re writing your own programs to process XML, you can use the parser’s API to validate documents. If you’re writing documents by hand and you want to validate them, you can either use one of the online validators or run a local program to validate the document.
The online validators are probably the easiest way to validate your documents. There are two of note:
The Brown University Scholarly Technology Group’s XML Validation Form at http://www.stg.brown.edu/service/xmlvalid/
Richard Tobin’s XML well-formedness checker and validator at http://www.cogsci.ed.ac.uk/~richard/xml-check.html
First, you have to place the document and associated DTDs on a publicly accessible web server. Next, load one of the previous URLs in a browser, and type the URL of the document you’re checking into the online form. The validating server will retrieve your document and tell you what, if any, errors it found. Figure 3-1 shows the results of using the Brown validator on a simple invalid but well-formed document.

Most XML parser class libraries include a simple program you
can use to validate documents if you’re comfortable installing and
using command-line programs. With xmllint , use the --valid flag to ...