The libxml2 XML DOM parser

This is a product of the Gnome XML project available as a shared library and implemented in KCML using dynamic objects. It allows an XML Document Object Model or DOM tree to be created in the memory of a KCML program with nodes corresponding to the tags, text, attributes, comments etc from the XML document. The DOM model is a W3C standardized object model used to programmatically manipulate XML.

The DOM parser is ideal for applications that need to load a document in memory and manipulate or access its components randomly.

The SAX2 parser interface is more suitable for applications that wish to stream large documents without building an in-memory DOM tree. This is faster and uses significantly less memory than the DOM approach but once a tag has been parsed it is lost unless the application preserves the information.

An XML DOM object is created with CREATE using the klibxml shared library e.g.

OBJECT x = CREATE "dynamic", "klibxml"

There are some examples of using the this library in this manual

Other libraries

klibxml has a very similar interface to the Xerces and Xalan libraries but has wider scope as it support both DOM parsing and XSLT in the same library together with XPath and XInclude support. As it uses UTF-8 encoding natively rather than the UTF-16 of Xerces, the memory footprint is reduced significantly.

Acknowledgement

This product includes software developed by Daniel Veillard and the Gnome XML Project (http://www.xmlsoft.org/).