http://swpat.ffii.org/
Action against software patents
http://www.gnome.org/
Gnome2 Logo
http://www.w3.org/Status
W3C Logo
http://www.redhat.com/
Red Hat Logo
http://xmlsoft.org/
Made with Libxml2 Logo
The XML C parser and toolkit of Gnome
The SAX interface
Developer Menu
index.html
Main Menu
html/index.html
Reference Manual
examples/index.html
Code Examples
guidelines.html
XML Guidelines
tutorial/index.html
Tutorial
xmlreader.html
The Reader Interface
ChangeLog.html
ChangeLog
XSLT.html
XSLT
python.html
Python and bindings
architecture.html
libxml2 architecture
tree.html
The tree output
interface.html
The SAX interface
xmlmem.html
Memory Management
xmlio.html
I/O Interfaces
library.html
The parser interfaces
entities.html
Entities or no entities
namespaces.html
Namespaces
upgrade.html
Upgrading 1.x code
threads.html
Thread safety
DOM.html
DOM Principles
example.html
A real example
xml.html
flat page
,
site.xsl
stylesheet
API Indexes
APIchunk0.html
Alphabetic
APIconstructors.html
Constructors
APIfunctions.html
Functions/Types
APIfiles.html
Modules
APIsymbols.html
Symbols
Related links
http://mail.gnome.org/archives/xml/
Mail archive
http://xmlsoft.org/XSLT/
XSLT libxslt
http://phd.cs.unibo.it/gdome2/
DOM gdome2
http://www.aleksey.com/xmlsec/
XML-DSig xmlsec
ftp://xmlsoft.org/
FTP
http://www.zlatkovic.com/projects/libxml/
Windows binaries
http://www.blastwave.org/packages.php/libxml2
Solaris binaries
http://www.explain.com.au/oss/libxml2xslt.html
MacOsX binaries
http://libxmlplusplus.sourceforge.net/
C++ bindings
http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4
PHP bindings
http://sourceforge.net/projects/libxml2-pas/
Pascal bindings
http://rubyforge.org/projects/xml-tools/
Ruby bindings
http://tclxml.sourceforge.net/
Tcl bindings
http://bugzilla.gnome.org/buglist.cgi?product=libxml2
Bug Tracker
Sometimes the DOM tree output is just too large to fit reasonably into
memory. In that case (and if you don't expect to save back the XML document
loaded using libxml), it's better to use the SAX interface of libxml. SAX is
a
callback-based interface
to the parser. Before parsing,
the application layer registers a customized set of callbacks which are
called by the library as it progresses through the XML input.
To get more detailed step-by-step guidance on using the SAX interface of
libxml, see the
http://www.daa.com.au/~james/gnome/xml-sax/xml-sax.html
nice
documentation
.written by
mailto:james@daa.com.au
James
Henstridge
.
You can debug the SAX behaviour by using the
testSAX
program located in the gnome-xml module (it's usually not shipped in the
binary packages of libxml, but you can find it in the tar source
distribution). Here is the sequence of callbacks that would be reported by
testSAX when parsing the example XML document shown earlier:
SAX.setDocumentLocator()
SAX.startDocument()
SAX.getEntity(amp)
SAX.startElement(EXAMPLE, prop1='gnome is great', prop2='&amp; linux too')
SAX.characters(   , 3)
SAX.startElement(head)
SAX.characters(    , 4)
SAX.startElement(title)
SAX.characters(Welcome to Gnome, 16)
SAX.endElement(title)
SAX.characters(   , 3)
SAX.endElement(head)
SAX.characters(   , 3)
SAX.startElement(chapter)
SAX.characters(    , 4)
SAX.startElement(title)
SAX.characters(The Linux adventure, 19)
SAX.endElement(title)
SAX.characters(    , 4)
SAX.startElement(p)
SAX.characters(bla bla bla ..., 15)
SAX.endElement(p)
SAX.characters(    , 4)
SAX.startElement(image, href='linus.gif')
SAX.endElement(image)
SAX.characters(    , 4)
SAX.startElement(p)
SAX.characters(..., 3)
SAX.endElement(p)
SAX.characters(   , 3)
SAX.endElement(chapter)
SAX.characters( , 1)
SAX.endElement(EXAMPLE)
SAX.endDocument()
Most of the other interfaces of libxml2 are based on the DOM tree-building
facility, so nearly everything up to the end of this document presupposes the
use of the standard DOM tree build. Note that the DOM tree itself is built by
a set of registered default callbacks, without internal specific
interface.
bugs.html
Daniel Veillard
