Re: Question about the libexpat character data handler automatic escape sequence decoding.

Nick MacDonald <[email protected]>
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
Well the obvious answer, which you may not like, would be to assume that
those escaped characters could never "occur naturally" so if you want, just
reconvert them back after receiving them in the
XML_SetCharacterDataHandler().

On 11/24/05, Marat BN <[email protected]> wrote:
>
> I have a question regarding the libexpat character
> data handler callback
> function that's set via libexpat API method
> XML_SetCharacterDataHandler(...)
>
> I noticed that by default libexpat decodes the XML
> escape sequences from
> text being parsed before passing them to the character
> data handler. -- If
> the XML string being parsed contains XML escape
> sequences, such as > <
> & &#xxxx; etc, then the XML_Char * string provided
> to the character data
> handler will have all these escape sequences decoded.
> libexpat must be
> automatically doing this decoding internally.
>
> In my application, I would like to receive the escape
> sequences intact.
> Does anyone know how to prevent the character data
> handler from
> automatically decoding the XML escape sequences?  Or
> is there another
> separate data handler callback function that leaves
> the escape sequences
> intact?
>
> On a related issue -- does libexpat have a separate
> API to encode/decode XML
> escape sequences?
>

--
Nick MacDonald
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.