Specifying a DTD for XML
Hi, All.
Our app accepts XML generated by a number of sources. XMLs do not contain a DTD reference in them, but we'd like to validate them nonetheless since sometimes bad XML results in data corruption.
The most straightforward (and seemingly most inefficient) way would be to simply create a new XML file which would contain the required DTD declaration and incoming XML and then just make the parser validate it.
My question would be this: does anyone know the way to somehow programmatically set the required DTD source to the SAX parser and then feed the incoming XML through it?
Thanks muchly.
-C
Our app accepts XML generated by a number of sources. XMLs do not contain a DTD reference in them, but we'd like to validate them nonetheless since sometimes bad XML results in data corruption.
The most straightforward (and seemingly most inefficient) way would be to simply create a new XML file which would contain the required DTD declaration and incoming XML and then just make the parser validate it.
My question would be this: does anyone know the way to somehow programmatically set the required DTD source to the SAX parser and then feed the incoming XML through it?
Thanks muchly.
-C
