dcsimg

How can I validate an XML file with a schema using the Xerces parser?

John Zukowski

Set the validation feature to true:

DOMParser parser = new DOMParser();
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.parse(...);