[Expat-discuss] Preserve character references in character data?

Peter Davis pd at peterdavis.info
Fri Mar 11 02:03:42 CET 2011


For a project I'm working on, I'm processing files which have been "pretty"
printed to use tabs, etc. to make the XML more readable.  However, most of
the tabs and linefeeds can be completely ignored.  Unfortunately, not all of
them can.

Specifically, I want to be able to act on tabs and linefeeds which are
stored in the XML as character references (	 and 
).  It appears
that Expat is automatically converting these to the corresponding
characters.

Is there any way to suppress that conversion?

>From the documentation I've seen, the XML_SetDefaultHandler function should
suppress the conversion, but it's not working that way for me.  I'm getting
a character data handler call with a single LF, with no indication that it
came from 
, and no calls to the default handler.

This seems like a common question, but I haven't been able to find anything
on it.

Thanks,
-pd


More information about the Expat-discuss mailing list