This document describes the XML library provideed in the Gnome framework. XML is a standard to build tag based structured documents. The internal document repesentation is as close as possible to the DOM interfaces.
XML is a standard for markup based structured documents, here is an example:
<?xml version="1.0"?> <EXAMPLE prop1="gnome is great" prop2="&linux; too"> <head> <title>Welcome to Gnome</title> </head> <chapter> <title>The Linux adventure</title> <p>bla bla bla ...</p> <image href="linus.gif"/> <p>...</p> </chapter> </EXAMPLE>
The parser returns a tree built during the document analysis. The value returned is an xmlDocPtr (i.e. a pointer to an xmlDoc structure). This structure contains informations like the file name, the document type, and a root pointer which is the root of the document (or more exactly the first child under the root which is the document). The tree is made of xmlNodes, chained in double linked lists of siblings and with childs<->parent relationship. An xmlNode can also carry properties (a chain of xmlAttr structures). An attribute may have a value which is a list of TEXT or ENTITY_REF nodes.
Here is an example (erroneous w.r.t. the XML spec since there should be only one ELEMENT under the root):
DOM stands for the Document Object Model this is an API for accessing XML or HTML structured documents. Native support for DOM in Gnome is on the way (module gnome-dom), and it will be based on gnome-xml. DOM defiles a set of IDL (or Java) interfaces allowing to traverse and manipulate a document. The DOM library will allow accessing and modifying "live" documents presents on other programs like this:
This should help greatly doing things like modifying a gnumeric spreadsheet embedded in a GWP document for example.