Hi Christiane,

Thanks for responding. Seems like I overlooked this point in
the SAX API docs; sorry.

Do you happen to know if something similar is possible with
a SAX2 parser? Or has this part deliberately been removed
from the SAX2 API in Xerces-C? Judging from the comment in
the SAX2Print sample that I quoted earlier, someone has been
considering this functionality in connection with SAX2...

TIA,
Peter


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 4. juli 2001 11:25
> To: [EMAIL PROTECTED]
> Subject: AW: Obtaining XML decl from SAX parser?
> 
> 
> Hi Peter,
> 
> have a look at the function
> XMLDecl( const  XMLCh* const    versionStr
>                         , const XMLCh* const    encodingStr
>                         , const XMLCh* const    standaloneStr
>                         , const XMLCh* const    actualEncodingStr
>                         )
> 
> You have to create your own SAXParser class, i.e.:
> [snip] 
> XMLDecl will be called from the parser and give information 
> about version, encoding, etc. to you.
> 
> 
> Regards, Christiane
> 
> -----Urspr�ngliche Nachricht-----
> Von: Peter Michael Bertelsen [mailto:[EMAIL PROTECTED]]
> Gesendet am: Mittwoch, 4. Juli 2001 10:41
> An: Xerces-C Mailing List (E-mail)
> Betreff: 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to