can expat leave & as it is ?

A

ajm

hi,

a simple question perhaps...I am parsing an XML document
with expat (1.95.x) which has content like:

<element>text &amp; more text E</element>

from which expat outputs something along the lines of

<element>text & more text A</element>

i.e., it resolves the entities. there are various things
I am getting expat to do for but one of the things I would
like it not to do is resolve entities, i.e., I would
have liked it to have given me back

<element>text &amp; more text E</element>

unaltered. is there a simple concrete way that expat can
be persuaded to leave entities untouched ? (i tried
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_NEVER)
with XML_DTD set at compile time etc. but to no avail - perhaps
this is the wrong approach anyhow).

regards,
ajm.
 
B

Bjoern Hoehrmann

* ajm wrote in comp.text.xml:
i.e., it resolves the entities. there are various things
I am getting expat to do for but one of the things I would
like it not to do is resolve entities, i.e., I would
have liked it to have given me back

You could use XML_GetInputContext() and parse the content manually.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top