Hello,
I am facing a problem, which I can't find the answer to it.
I have a xml, which I am parsing using xerces.
The problem is with the DTD validation, I want to give the DTD file
path to the parser in my code (hardcoded or using environment
parameter) and not to write the path in the xml file.
is it possible?
Thank you,
Asaf
George Bina - 25 Jan 2006 10:34 GMT
Hello Asaf,
If your document does not contain a reference to a DTD then you can
provide one if you register an entity resolver implementing the SAX
2.0.2 EntityResolver2 interface
http://xerces.apache.org/xerces2-j/javadocs/api/org/xml/sax/ext/EntityResolver2.html
If your document contains a reference to a DTD then you should be able
to get a callback in the entity resolver resolveEntity method and from
there you can return an InputSource with your desired DTD.
Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com