Re: [xml-dev] Parsing without resolving entities

From
Andrew Welch <>
To
Randy McGarvey <>
Date
2007-10-29T15:20:17Z
ID
<>
Thread
Re: [xml-dev] Parsing without resolving entities
On 29/10/2007, Randy McGarvey <> wrote:
> If I have data with character entities such as &sect; or &mdash; in the XML,
> what is the best way to keep those intact, as is, after a parse.  Are there
> any parsers that have an option not to resolve entities?  What is the best
> way you've found to deal with this issue?  Do you escape the ampersands
> (e.g. &amp;sect;) in a pre-process?  Do you address it in an entity handler
> to re-write the original entity text?  This seems like a real pain that must
> have a common solution.

It's a common question that often arises because the characters
involved cause problems downstream... in which case you're better off
trying to fix the root cause (likely to be an ecoding issue) that
rather than add pre and post processes.


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/