Verifying a document against a specific DTD with JDOM

B

Brian J. Sayatovic

I have a situation where I'm received XML with no DOCTYPE over HTTP.
However, this XML is supposed to conform to a DTD which I have
locally, so I'd like to be able to verify the incoming MXL stream
against the DTD.

Right now, I'm using JDOM b9 with a custom JDOMFactory to construct
cusotm Element subclasses for certain elements. I have not found
anything in the API that leads me to believe that I can specify to the
SAXBuilder a specific DTD to use.

As near as I can tell, JDOM's SAXBuilder uses an underlying "SAX
Driver" to feed it SAX events and construct the resulting DOM. In my
case, I Xerces is the underlying SAX parser. And, again, as far as I
can tell, I also can't force it to verify a document against an
arbitrary DTD.

Any ideas?

Regards,
Brian.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top