Re: [xml] external entity references using SAX interface



On Fri, Nov 22, 2002 at 12:23:59AM +0100, Vassili Dzuba wrote:
i know that the libxml documentation explicitely counsel to use
the dom interfce if one has to use entities, but i don't see any
philosophical reason why a sax interface should be so 
entity-unfriendly...

I will give you two:
  - libxml2 preserves entity references in attributes
    values, SAX doesn't allow it but I decided I wanted that feature.
  - libxml2 DOM shares a common subtree on multiple entities references
ask first for entity substitution to avoid them.
Plus a number of reasons which make SAX hard to use in pure C, Megginson
never bothered trying to solve those, SAX is not a C friendly API, it's
also too limited for an editing toolkit like libxml2.

Look at the various entry points in SAX.c related to entities, and
the value of ctxt->inSubset.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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