Re: [xml] libxml3



On Thu, Apr 18, 2002 at 09:08:58AM +0200, Peter Jacobi wrote:
That's what the SAX interface provide. With the following document
fragment ...

Yes, but the SAX interface gives much less functioniality than the
tree interface. I want to have the functionality of the tree interface,
but using an API that does no memory allocation on 
non mutating calls.

(Because, e.g.  the data may go to C++ STL to avoid double
copy and double memory allocation)

  Okay, then a Push (at the tree level not at the input, the wording
in this field is confusing) would probably be sufficient. Would an
API building and destroying the tree by default and using callbacks
would fit the bill ? In practice it could be a parsing option 
with a (set of) callback and the parser would just call it with the
built node in its context (the retained child subtree and all the ancestors
nodes), then depending on the value returned in the callback the subtree
would either keep the nodes and its subtree, or destroy it.
  I think this would be relatively flexible, not hard to implement
nor disruptive w.r.t. the existing code base and APIs, i.e. I could
probably sneak something like this even in libxml2, either as a global
setting or specifically associated to a given parser context.

  Opinions ?

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]