While working iwth XML documents, you need to validate the documents. YOu may use setValidating() method on a SAX or DOM factory. But Java 5.0 (JAXP 1.3) introduces JAXP validation framework which can also be used for validating XML documents.
(more…)