Re: [xml] Interfacing with libxml2



On Sun, Oct 01, 2006 at 11:33:48AM +0200, Joachim Zobel wrote:
Am Freitag, den 29.09.2006, 09:13 -0400 schrieb Daniel Veillard: 
On Thu, Sep 28, 2006 at 10:07:30PM +0200, Joachim Zobel wrote:
  look at the entry points in SAX2.c 
  http://xmlsoft.org/html/libxml-SAX2.html
but I don't think anyone ever tried to plug libxml2 on top of expat
and it may require some debugging

This looks pretty good. If I understand this correctly, XML parsing in
libxml2 goes through the SAX2 interface and the the SAX2.c functions are
the callbacks that pass the SAX events to the higher level stuff. 

  Yes, when not using the older SAXv1 interfaces.

So this means I can move from expat to libxml2 (the SAX interface is
quite similiar) and put the higher level libxml2 functionality into
seperate filters, that can be glued together controlled by processing
instructions, possibly a special namespace and apache config.

  Some of the entry points are different from the old expat for example
support for namespaces, check 
   http://xmlsoft.org/html/libxml-SAX2.html#xmlSAX2StartElementNs
for example attributes are given using 4 string pointers. Also everything
is always converted to UTF-8 it's not in the document native encoding.

The goal is to build something that can (for example) run a streaming
XPath expression and treat all matches as tiny seperate documents that
are processed by an xslt stylesheet.

  You will still need to build some kind of tree to process with libxslt,
but that should be doable (but not trivial).

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
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]