[xml] external entity references using SAX interface



Hello,

I have a problem when trying to write an application 
using the SAX interface when processing a reference
to an external entity reference.
I'm using libxml2-2.4.27

I use :

    xmlSubstituteEntitiesDefault(1);


When processing the entitu reference, it seems the entity 
content is parsed twice :

parseReference calls xmlParseExternalEntityPrivate
that calls xmlParseContent that parses the entity
content and calls my callbacks

However, later on, one executes (line 5549) :

         input = xmlNewEntityInputStream(ctxt, ent);
         xmlPushInput(ctxt, input);

and, if i understand correctly, this triggers a second parsing 
of the entity content.

I didn't find a way from inside my callbacks to distinguish
the two cases.

Did i miss somthing ?

Thanks for any advice,

Vassili Dzuba




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]