Re: [xml] using xmlSetExternalEntityLoader to return internally generated XML documents

On Wed, Aug 01, 2007 at 03:24:27PM +1000, Nathan Day wrote:

   Looking  at  the  source,  it  seems  that  I have to serialise my xml
   document  so that libxml can parse it again, is that right, seems like
   a  bit of a waste of time, though I guess for some situations at least
   (xinclude) if xmlSetExternalEntityLoader      could      accept     an
   xmlDoc, the xmlDoc would  have  to  be  copied so maybe it is not that
   much more overhead.

  libxml2 parser is actually faster than copying a tree (lot of complex
reasons for that), so that may not be that bad. The problem of your
approach in general is that you try to mix what is 2 different level,
the entity one and the tree one, the entity loader is really designed
for data waiting to be parsed, otherwise use the tree APIs.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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