2011-05-27

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.



Learning



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.



Prototyping



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.



Issues



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.


Keine Kommentare:

Kommentar veröffentlichen

Dieses Blog durchsuchen

Labels

#Technology #GNOME gnome gxml fedora bugs linux vala google #General firefox security gsoc GUADEC android bug xml fedora 18 javascript libxml2 programming web blogger encryption fedora 17 gdom git libgdata memory mozilla open source serialisation upgrade web development API Spain design emacs evolution fedora 16 fedora 20 fedora 22 fedup file systems friends future glib gnome shell internet luks music performance phone photos preupgrade tablet testing yum #Microblog Network Manager adb art automation bash brno catastrophe containers css data loss deja-dup disaster emusic errors ext4 facebook fedora 19 gee gir gitlab gitorious gmail gobject google talk google+ html libxml mail microsoft mtp namespaces nautilus php picasaweb podman ptp resizing rpm school selinux sms speech dispatcher systemd technology texting time management typescript 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 cron customisation dataloss dconf debian debug symbols debugging design patterns desktop summit development discoverability distribution diy dnf docker documentation drm duplicity e-mail efficiency email english environment estate experimenting ext3 fedora 11 festival file formats firejail flac forgottotagit freedom friendship fuse galaxy nexus galton gay rights gdb german germany gimp gio 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 node nodelist numix obama oci ogg oggenc oh the humanity open open standards openoffice optimisation org-mode 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 sandboxes scheduling screenshots self-navigating car shell signal sleep smartphones software software engineering speed sql ssd synergy tabs test tests themes thesis tracker travel triumf turtles tv tweak twist typing 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.