I have an XML file which I am reading into my program using Java's internal XML packages. At any given time, the XML may or may not be valid. IE, it may or may not have close all the tags it opened.
I would like to use either a dtd or a schema to let the parser validate the XML as it is read, and automatically close tags that are left dangling.
Is there a simple way to do this, or do I have to write a bunch of custom code for this?