GDom Progress

Good day.

I'm grateful for the ideas provided in the comments on my last post.  I didn't have enough time to thoroughly consider them all by today, so I'm just going to discuss where GDom is at now.


I've used the Vala tutorial to acquaint myself with some of its finer points.  I welcome recommendations for other best practises when writing code in Vala, though.

I've also played with the older libgeexml recently to observe an example of libxml2 getting wrapped and abstracted in Vala.  This entailed a lot of changes to get it to compile again (a lot in Vala has changed over a few years), which are currently available at a gitorious repo.  I'll check if there's still interest in the project before polishing a patch set and sending it to git.gnome.org.


After this past week, we can now load an XML file and traverse its node structure.  I went about creating a bunch of stub classes, and trying to implement the Document and Node DOM interfaces to start.  Again, since GDom is initially relying on libxml2 (concerns about its memory consumption have been noted) for its back-end functionality, a lot of the work involved simply transforming data into user-friendly GObjects. 

The code right now is available at the GDom gitorious repository.  The initial commits have been large lumps, and the code base still requires a lot of massaging and stub-filling.


I encountered some issues having GDom's Attributes implement the same Node interface as all the other nodes, like the DOM API wants.  Mostly because libxml2 treats its attributes as slightly distinct from its nodes.   I also had a headache in trying to keep the attributes synchronised for a node between the GDom and the libxml2 representations, since the DOM API wants us to provide something like a HashTable (a NamedNodeMap) to users, but I want to keep that and the backing libxml2 structure in sync.  I had originally hoped there would be easy signals to catch, but now I just have to be careful to sync them at the right time.  I also have to take some care to avoid creating multiple distinct GDom Nodes for the same libxml2 node.  I'd like a 1-1 relationship here.

The wonderful Alberto Ruiz has provided good guidance on all my questions so far, though, helping ensure GDom and I can continue to move forward :)

Next Week

Try to get Document and Node much more complete.  This involves implementing more of other classes, too.  The Document interface defines a bunch of methods for creating other elements, for example, so even if they don't function perfectly, I still want to have a dumb version for Document to handle. 

Also, quite importantly, I'm going to create tests for Document and Node to start.  Right now, I have a simple main () function that uses them to load an XML file and navigate it.  I would like to have a more complete test package available to guide GDom's progress, though.

Also, finish considering and addressing comments left on my last post.  I've read them all, and some of them warrant replies.  Thank you for the feed back already.  (I'll note that I'm busy this weekend, and won't get back to it until Monday, though.)

Also, I need to fill out more of http://live.gnome.org/XML.  It's still a little sparse.

Have a good week.


Hello GNOME. Meet GDOM.


Good day. GNOME has many beautiful APIs. For manipulating XML, many projects use the powerful libxml2. However, its API is not consistent with GNOME conventions. It uses different data types, and does not benefit from good integration with GLib, missing out on libraries like GIO.

GDOM is an effort to implement the DOM Level 1 Core API for GLib.

GObject API and GLib integration

All objects, such as Nodes, Documents, and Attributes, will be GObjects. They'll use GErrors for exception handling, handle GIO's GInputStreams, etc.

Functionality via libxml2

We are not implementing the API from scratch. In fact, almost all its functionality is coming from libxml2, which is already robust and has good performance.


GDOM will be implemented in Vala which should help minimise the work necessary to complete the API.

I really want to hear your thoughts on XML and GNOME. I am at a disadvantage of never having had to write anything too large or intensive that used XML, just parsing and building simple files for my own projects. If you're involved with a project that already uses libxml2 (or another XML API), let me know. I'd like to see how you use it and how GDOM might make life better for you.

GSoC and Me

This is a Google Summer of Code 2011 project, and my mentor is Alberto Ruiz. Me? I'm a Masters student at the University of Guelph. I fell in love with GNOME about 7 years ago, but never got around to writing much code until 2009. My Masters has kept me busy recently, but thanks to Google, I can justify focusing on GNOME for a while :)



Hello GNOME. I'll introduce myself soon :)

Dieses Blog durchsuchen


#Technology #GNOME gnome gxml fedora bugs linux vala google #General firefox gsoc security GUADEC android bug xml fedora 18 libxml2 programming web blogger encryption fedora 17 gdom javascript git libgdata memory mozilla open source serialisation upgrade API Spain design evolution fedora 16 fedora 20 fedora 22 fedup file systems friends future glib gnome shell internet luks music performance phone photos preupgrade tablet testing web development yum #Microblog Network Manager adb art automation bash brno catastrophe css data loss deja-dup disaster emacs emusic errors ext4 facebook fedora 19 gee gir gitorious gmail gobject google talk google+ html libxml mail microsoft mtp namespaces nautilus php picasaweb ptp resizing rpm school selinux sms speech dispatcher technology texting time management uoguelph usability video web design youtube #Tech Air Canada C Empathy Europe GError GNOME 3 GNOME Files Go Google Play Music Grimes IRC Mac OS X Mario Kart Memento Nintendo Nintendo Switch PEAP Selenium Splatoon UI VPN Xiki accessibility advertising ai albums anaconda anonymity apache apple ask asus eee top automake autonomous automobiles b43 backup battery berlin bit rot broadcom browsers browsing canada canadian english cars chrome clarity comments communication compiler complaints computer computers configuration console constructive criticism customisation dataloss dconf debug symbols debugging design patterns desktop summit development discoverability distribution diy dnf documentation drm duplicity e-mail efficiency email english environment estate experimenting ext3 fedora 11 festival file formats flac forgottotagit freedom friendship fuse galaxy nexus gay rights gdb german germany gimp gio gitlab gjs gnome software gnome-control-center google assistant google calendar google chrome google hangouts google reader gqe graphviz growth gtest gtg gtk gvfs gvfs metadata hard drive hard drives hardware help hp humour identity instagram installation instant messaging integration intel interactivity introspection jabber java java 13 jobs kernel keyboard language languages law learning lenovo letsencrypt libreoffice librpm life livecd liveusb login macbook maintainership mario memory leaks messaging mounting mouse mysql netflix new zealand nodelist numix obama ogg oggenc oh the humanity open open standards openoffice optimisation organisation package management packagekit paint shedding parallelism pdo perl pipelight pitivi privacy productivity progress progressive web apps pumpkin pwa python quality recursion redhat refactoring repairs report rhythmbox scheduling screenshots self-navigating car shell signal sleep smartphones software software engineering speed sql ssd synergy systemd tabs test tests themes thesis tracker travel triumf turtles tv tweak twist university update usb user experience valadoc volunteering vpnc waf warm wayland weather web apps website wifi wiki wireless wishes work xinput xmpp xorg xpath
Powered by Blogger.