I need to parse a bunch of incoming XML documents but it does not contain DOCTYPE (they all have the different DTD). DTD is created by myself. How can I validate an XML file against a DTD that is stored locally as a file? I have following requirement:
- All DTDs (for different XML) Will be load into memory once,when incoming XML comes don’t looked into an locally stored area.
- validate incoming XML on the basis of load DTD file.
Thanks
You need to use a local entity resolver on your SAX parser, here is an example of how to implement it: