
Phil Endecott wrote:
Stefan Seefeld wrote:
Phil Endecott wrote:
For example, I might need to efficiently find all the <foo> nodes in a large tree. How would I do that with your library? You'd do an XPath query.
I'm pretty sure that libxml2 would visit every node in the tree to do that. With XSLT you can use the "key" mechanism to make this more efficient, but XPath alone doesn't get you that.
I don't understand what you are saying. What does XPath not get me ? I clearly can issue an xpath query, resulting in a nodeset filled with all 'foo' elements of the document.
I think that there are a lot of useful techniques that can't be done using a libxml2 backend, including the symbol-table idea that I have mentioned before and the whole business of pointer semantics i.e. deep vs. shallow copy, copy-on-write and so on. Right. But I don't see that as a limitation of my approach. Rather, I'd use a different way to achieve that anyway.
Can you elaborate?
My point is that I wouldn't attach user-data to nodes by derivation, but by some other, non-intrusive, means. Composition is often a much better device than inheritance.
May I suggest that you search the boost ML archives to find more details.
E.g. these
http://thread.gmane.org/gmane.comp.lib.boost.devel/85985 http://thread.gmane.org/gmane.comp.lib.boost.devel/86508 http://thread.gmane.org/gmane.comp.lib.boost.devel/86872
Yep. Regards, Stefan -- ...ich hab' noch einen Koffer in Berlin...