[Expat-discuss] Parsing External Entities

Karl Waclawek karl at waclawek.net
Thu Jan 16 11:02:36 EST 2003


----- Original Message ----- 
From: "Michael B. Allen" <miallen at eskimo.com>
To: "Karl Waclawek" <karl at waclawek.net>
Cc: <expat-discuss at libexpat.org>
Sent: Thursday, January 16, 2003 10:38 AM
Subject: Re: [Expat-discuss] Parsing External Entities


> > > > No, you must free it. Need more detail.
> > > > Which version of Expat are you using?
> > > 
> > > 1.95.2-2 RPM from RH 7.3
> > 
> > Please try the current CVS release. We have really done a lot of fixing.
> > A few bugs and a lot of conformance and feature completion
> > like UTF-16 output and NS triplets are working now.
> 
> I do not need external entity parsing explicitly. I was just trying to
> get Expat to do whatever it can so that I can expose the functionality in
> my DOM ("DOMC"). I don't want users to be required to use a bleeding edge
> Expat. 

In this case bleeding edge means: better, not necessarily riskier.

> I will just punt on external entites for now. But it seems strange
> that these functions are available and do not work as advertised. Is
> this really the case that you simply cannot parse external entities with
> 1.95.2?

I joined the team after the 1.95.2 release, but there have been a lot of
improvements for external entity parsing. However, your example should work.

Here is what my testing on MS VC++ shows:

There is a problem with free(model) - I get an invalid heap pointer exception.
Possibly the Expat Dll and the app are using different memory managers/heaps.
Your subsequent problem with XML_ParserFree may have been caused indirectly by
free(model).

Try using XML_ParserCreate_MM or linking Expat statically.

When I use the (not yet released) XML_FreeContentModel, then I have no problem.
<for Fred - this is an argument pro the new API, isn't it?>

I can also use XML_ParserFree on the external entity parser without problems.
So, with XML_FreeContentModel, your example works fine for me.

Let me know if using XML_ParserCreate_MM supplying your own free,malloc, etc.helps.

Karl




More information about the Expat-discuss mailing list