How to get the Doctype Declaration in Xerces-C when using SAX2 ?

Posted by ArtB on Stack Overflow See other posts from Stack Overflow or by ArtB
Published on 2010-05-12T21:19:15Z Indexed on 2010/05/12 21:24 UTC
Read the original article Hit count: 224

Filed under:
|
|

I am using SAX2 from Xerces-C to read an XML document. However, I would like to check the Doctype declaration (if there is any) to make sure that the XML file is in the format I am expecting.

I have tried the unparsedEntityDecl and notationDecl methods from the DTDHandler, and EntityResolver seems to be more low-level than what I am looking for.

My motivation is for this is to be able to confirm that the input is of the format I am expecting so that I can differentiate between documents which produce no output and those that are entirely of the wrong format.

© Stack Overflow or respective owner

Related posts about c++

Related posts about Xml