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 emacs libgdata memory mozilla open source serialisation upgrade web development API Spain containers design evolution fedora 16 fedora 20 fedora 22 fedup file systems friends future glib gnome shell internet luks music performance phone photos php podman preupgrade tablet testing typescript yum #Microblog Network Manager adb apache art automation bash brno catastrophe css data loss debian debugging deja-dup disaster docker emusic errors ext4 facebook fedora 19 gee gir gitlab gitorious gmail gobject google talk google+ gtk html libxml mail microsoft mtp mysql namespaces nautilus nextcloud owncloud picasaweb pitivi ptp python raspberry pi resizing rpm school selinux signal sms speech dispatcher systemd technology texting time management uoguelph usability video web design youtube #Tech Air Canada C Electron Element 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 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 cropping customisation dataloss dconf debug symbols 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 firejail flac flatpak 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 gvfs gvfs metadata hard drive hard drives hardware help hp humour ide identity instagram installation instant messaging integration intel interactivity introspection jabber java java 13 jobs kernel keyboard language language servers languages law learning lenovo letsencrypt libreoffice librpm life livecd liveusb login lsp macbook maintainership mariadb mario matrix memory leaks messaging mounting mouse 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 privacy productivity progress progressive web apps pumpkin pwa pyright quality recursion redhat refactoring repairs report rhythmbox rust sandboxes scheduling screenshots self-navigating car shell 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 video editing volunteering vpnc waf warm wayland weather web apps website wifi wiki wireless wishes work xinput xmpp xorg xpath
Powered by Blogger.