Tag Archives: namespaces

Glou WoC Week 3 – Handle my Stanza

This report is released weekly within the scope of the Glou Winter of Code.

The starter for last week was XmlElem obtaining a list of children and a link to its parent. That also means get_string of XmlElem now delivers the complete XML string inclusive the children’s content. After that it was all about XML namespaces. First XmlElem and XmlAttr have been a bit reshaped to properly support namespaces. XmlNsDecl was introduced; it represents namespace declarations in XML elements. By looking through those declarations one can find a so-called namespace scope which maps element and attribute prefixes to their actual namespaces. All XML stringify functions now use those namespace scopes to properly resolve prefixes for elements and attributes. The good thing here is that the whole namespace handling and prefix resolving is done transparently. So one more thing libxoup users won’t have to care about.

After that groundwork was done it was time to touch the XMPP / stanza handling code again. The XMPP handler tree had to yield for a simpler and more convinient approach. Now one globally can register a StanzaHandler, which then, on initialization, sets up triggers for every XML element (children of XMPP stanzas) it wants to handle. Those triggers will fire whenever such a specified element occures in the stream. In most cases the handling of a stanza will result in some event that’ll spit out some object (e.g. a MessageReceivedEvent which will deliver a Message object). In consequence StanzaHandlers are now also able to provide a serialize method which takes a Stanza object and then converts it into bits and bytes ready to be sent over the network.

Next to the above mentioned stuff a few minor things were also accomplished. Some more utility methods made it into the code and some bugs were fixed. Also, on top of the new XMPP / stanza handling, the implementation of XMPP resource binding has been started. All in all I would say we are looking back at a productive week :) .

This week the focus is on testing (mostly the code that was implemented during the last week), on polishing, fixing bugs, completing the examples and adding more documentation. Also the release of libxoup 0.1 is planned to happen this week. After that, if there is time left, the integration of libxoup into the existing parts of libglou will be prepared.

That’s it everyone. See you again, as always, next week on monday. Have a nice week.
- Sven