- From: Michael Kay <mhk@mhk.me.uk>
- Date: Mon, 16 Feb 2004 21:59:39 -0000
- To: "'Stephen Buxton'" <Stephen.Buxton@oracle.com>, <public-qt-comments@w3.org>
> SECTION 3.5.3: node comparisons > > Regarding << and >>, I think that these should return true or > false only when the comparands are nodes of some common > supernode. If x and y are in completely unrelated documents, > how can you decide whether x << y or x >> y? I know that The > Data Model section 2.4 "Document order" says that there is an > implementation-dependent total ordering of all documents > which is stable during the execution of an expression evaluation. > An implementation-dependent order does not do the user any > good, and making it stable can not add value in the user's eyes > to a feature with no value anyway. This merely > burdens implementations with a useless requirement. > I think it would be preferable to say that << and >> are > partial orders, returning an empty sequence if two nodes have > no common supernode. I think that forcing implementations to check whether there is a common ancestor is an unnecessary burden. Implementations already have logic to check whether two nodes are in document order (it's essential for implementing path expressions); you are proposing introducing a new and more complex operator which implementations won't use for any other purpose. Currently the expression a<<b can (except for type checking) be rewritten statically as (a|b)[2] is b which isn't exactly a great burden. Michael Kay
Received on Monday, 16 February 2004 16:58:57 UTC