You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Peter Michael Bertelsen <PM...@maconomy.dk> on 2001/07/04 10:40:38 UTC

Obtaining XML decl from SAX parser?

Hi,

I tried asking this same question (see below) some days ago, but have seen
no responses so far. My apologies if it is a FAQ or just way too obvious.
I've been traversing the Xerces-C API docs to find an answer, but to no
avail.

The point is that I'd like to get my hands on the XML decl (XML version
number and original encoding of the parsed document) when parsing with a SAX
parser. It seems to be possible to get at this information when parsing with
a DOM parser, but I haven't been able to find anything similar in the
Xerces-C SAX/SAX2 APIs. So how do I ask a SAX parser to report the XML decl?

Curiously enough, the following comment appears in the SAX2PrintHandlers
constructor of the SAX2Print sample
(samples/SAX2Print/SAXPrintHandlers.cpp):

    //  Go ahead and output an XML Decl with our known encoding. This
    //  is not the best answer, but its the best we can do until we
    //  have SAX2 support.

Has any functionality for obtaining the XML decl from the parser been
introduced with Xerces' SAX2 API?

Thanks in advance,
Peter Bertelsen
Maconomy A/S (http://www.maconomy.com)


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org