Re: [xml] Re: [gnomemm] ANNOUNCE: libxml++ is now sane.



Paul Davis wrote:
libxml++ was a mess in the past but it has been overhauled recently. The
new 0.16.0 release is now organised and usable. I invite you to try it and help us to improve it by submitting patches (to the sourceforge
patch manager).


if you're going to try to improve it, i would pass on one
recommendation. this API:

const Node * add_child (const std::string &name) Node * add_child (Node *node)
has caused dozens of stupid bugs in my code, because it doesn't make
it clear whether the added child is copied or not (its not).

A good way to make the intention clear would be to pass 'std::auto_ptr<Node>' instead of raw pointers, whenever you want it
to be adopted.

I, too, have an API enhancement suggestion: Please consider a method
'Node::lookup(const std::string &xpath)' that does an xpath lookup
(surprize !) and returns a NodeSet. I'v written my own C++ wrapper
around libxml2 and this method is incredibly useful in my work...

Stefan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]