dcsimg

How can I validate an XML file against a DTD in Java?

Michael Rohde

Most XML parsers support validation. In Apache Xerces, for example, the property for validation is set to true by default. Every XML file which contains a "doctype" reference to a DTD gets validated.