Validating vs non validating parsers with xml
To accomplish this, validating XML processors must read and process the entire DTD and all external parsed entities referenced in the document.Non-validating processors are required to check only the document entity, including the entire internal DTD subset, for well-formedness.Even if a document is well-formed, however, it may not be valid. An XML document is valid if it has an associated document type declaration and if the document complies with the constraints expressed in it.
The bottom line here is: either a document is well-formed XML, or it's toast; that is, it's not XML.
The DTD is repeated here in Listing 3-4 for convenience.
At first glance, it appears to be valid because it follows the structural rules of the DTD.
If the parser encounters a well-formedness problem, it should only report the problem to the calling application.
It explicitly must not attempt to correct what might be missing, overlapping, or misspelled.
Most modern parsers (2000 and beyond) can be run in either validating or nonvalidating mode.