Login or sign up Lost password?
Login or sign up
If you use a DOM parser explicitly for validation, you will definitely instantiate a DOM tree.// parse an XML document into a DOM tree Document Builder parser = Document Builder Instance()Document Builder(); Document document = parser.parse(new File("instance.xml")); // create a Schema Factory capable of understanding WXS schemas Schema Factory factory = Schema Instance(XMLConstants. If I use an Error Handler (own class that implements Error Handler) instead, it recognizes all errors, but the try-catch-block of validator.validate does not throw any Exception.. The definition of the dtd and xsd has to be in the xml! If you are generating XML files programatically, you may want to look at the XMLBeans library.