I am working with Java and I want to check if an XML file is valid against a DTD. Assuming that we do have a DTD file "myDtdFile.dtd", I want to check if certain XML file "myXmlFile.xml" is valid against the same definitions proposed in the DTD file. (ie: there is no violation in the set of tags included in the xml file) is there any way to do it ? i tried this already :
how to check the validity of an XML file against a DTD file in java?
but it is not working