Boost logo

Boost :

From: Stefan Seefeld (seefeld_at_[hidden])
Date: 2005-11-08 21:49:19

Douglas Gregor wrote:

>>An XPath implementation should be completely separated from the XML
>>representation, since it's effectively just an algorithm that can be
>>applied to anything that has the correct data model and iterator
> This is probably the case. However, one can think of places where a
> tighter integration might give a more natural interface, e.g.,
> xml::element_ptr books = ...;
> xml::node_set cheap_books = books[attr("price") < 30];
> But, like the reader interface, a library that supports something DOM-
> like can be augmented with XPath support.

I'm not sure I agree. While the syntax you suggest above is quite cute,
and probably follows the 'xpath object model' as implied by the XPath spec,
the latter also specifies syntax, which your suggestion doesn't adher to.

So, while what you suggest may be useful in itself, it isn't really
compatible with xpath. (Think of applications such as xslt processors,
where xpath expressions are strings embedded into attributes.)

Note that my API already supports XPath. It may be a nice add-on to
overload various operators for the xpath type to allow your suggested
syntax, but I don't see this becoming really useful. It's just cute.


Boost list run by bdawes at, gregod at, cpdaniel at, john at