How can I use an external DTD file to validate my XML file against?
The DTD will be located on some url e.g. http://localhost/example.dtd
and the DTD is not referenced in the XML file, so I need to do this in my Java servlet.
I am using JDOM for my current processing of XML files.
Any help or pointers is appreciated
If the DTD is not specified in the XML file, you can use a Transformer to add it in and then parse it as shown below: