Yannick Inizan, is maintaining a daily builds of master branch at: https://code.launchpad.net/\~inizan-yannick/+archive/ubuntu/gxml-daily
Daily builds of latest stable branch (0.18) can be found here : https://code.launchpad.net/\~inizan-yannick/+archive/ubuntu/gxml-stable
GXml is built for bionic (18.04 LTS), disco & eoan by default. (the recipes : https://code.launchpad.net/\~inizan-yannick/gxml/+git/gxml)
GNOME Download Central
You can Download release's sources from official GNOME site, as a tarball.
You can access most updated documentation, generated from
master, using the pages services.
This is a repository of Examples about how to use GXml
API General Considerations
libxml2 is a C based library, so no GObject interface is avairable for it. GXml wraps it using
XNode derived classes, providing an API to hide most details on its use.
For DOM4 API using
Node, all returned objects are created on the fly with internal references to libxml2's native nodes pointers in order to provide automatic memory management like unref an object, so is highly recommended to use
GNode DOM4 API instead to use libxml2 structs.
xmlDoc* is used by GXml's
XDocument objects so, any modification to that pointers should use libxml2's API. Fortunally, GXml's
Node API provides a DOM4 one for most common use cases.
DOM4 provides a reach API, full of features, most of them not implemented yet in current 0.18 release.
Node and its descendants, fixes some limitations inherited by
XNode from libxml2, like the ability to have more than one child
DomText in a
DomElement; there are more room for improvements in
Node than in
XNode in the future.
Serialization is the process to represent to/back GObject in XML. Can be many different ways to archive that.
In GXml you can simple derive a class from
Element to be able to set properties or add new nodes, but only if they are the
Node for fast de/serialization
Node currently use
xmlTextReader to parse an XML document whith an efficient performance and reduced footprint too.
xmlTextWritter with an improved parser, so write down XML documents fast.
For examples and detailed information go to Element page.
GObject to XML and back
Element, provides an easy way to use GObject's properties to XML Node's attributes, mapping a one to one XML element node to a GObject.
XML structure changes tolerant
XML changes tolerant
Element descendants can have any DOM node and attributes; it is not limited to GObject's properties defined at class declaration, so is very easy to add new nodes and attributes to source XML and
Element, just map the ones defined at class declaration, but allows you to use DOM4 API to access them.
No XML data lost
In the same way, when you write down an
Element, with pre-parsed childs, any modification to GObject's properties and/or DOM nodes will be preserved.
One feature added to
Node derived classes, are [Link Collections] (collections). Take a list of child nodes and classify them in collection, with different ways to access them, provides a powerful mechanism to manage your XML data.
From a simple array to hash tables using one, two and three keys to access them, provides fast and easy ways to take advantage of your data layout.
Properties as Objects
Serialize objects from
GObject properties are easy with
GXml.Property interface implementations.
GXml.Element derived classes you can use simple properties types like bool or double, to
GObject based values mapped to XML Element nodes or simple attributes.