[Expat-discuss] entity expansion

David MacCormack djm@maccormack.net
Wed Nov 14 02:13:02 2001


On Tue, 13 Nov 2001, Glenn Maynard wrote:

> On Sat, Nov 03, 2001 at 01:53:43AM -0500, Glenn Maynard wrote:
> > Well, this seems like an extremely simple thing, so I feel like I'm
> > missing something obvious.  But I can't find it (through far too much
> > code tracing), so here we go: how to disable expansion of entities?
> > There's a call to disable parameter entities, and stuff for external
> > entities; the XML document I'm parsing has an internal DTD, however, and
> > I don't want entities expanded.
> >
> > It seems like something every XML library would have, so I feel like I'm
> > just missing an obvious API call; I hate posting seemingly obvious
> > questions to lists, but I've spent far too much time on this. :)  (Not
> > as much time as I spent trying to get libxml to handle entites
> > reasonably with its SAX interface; their response was along the lines of
> > "entities with the SAX interface are hard, either use DOM or don't use
> > entities".  No, I don't think I'm doing to load the 20 meg JMdict with
> > DOM ...)
>
> I can only assume by the lack of response that Expat simply can't do
> this.  Extremely strange ...
>
>

I needed the same thing and made a patch that does it (a while back).
Goto http://sourceforge.net/projects/expat/, click on "Patches", and then
click on the 429501 patch.  Fred has other plans, so this didn't make it
into the standard distro.  However, it's available if you want to apply it
yourself.

Good luck.

Dave
-- 

----------------
David MacCormack
djm@maccormack.net

In the land of Redmond, where the Windows lie.
   One OS to rule them all, One OS to find them,
   One OS to bring them all and in the darkness bind them.
In the land of Redmond, where the Windows lie.