Bryce Harrington wrote:
Jon Cruz has added an XML parser to the inkscape_gtkmm codebase, along with functions to use it for loading/saving units.
I think Jon's new code could make doing the Preferences XML load/save outlined below quite straightforward.
Just be aware that the one in now is a bit limited. I'll need to get comments in on stuff, but it's mainly only good for flat/shallow XML. The main thing is that the start of a new element clears out the single shared buffer, and the end of an element wraps it on up. There's also no simple way to track the current depth in a hierarchy. (a version that handles those is forthcoming).
So... all said, if the use is appropriate, all you'd need to do is subclass FlatSaxHandler, override _startElement if you'll need to setup anything at the start of any tags, and override _endElement to get the content at the close tag.