2001Apr/0003.html

Dear Chris,

This is a response to the following messages, which you posted to the XML 
Query Working Group's comments list:

http://lists.w3.org/Archives/Public/www-xml-query-comments/2001Apr/0003.html

The XML Query Working Group has approved the following response:

The operator you suggest seems very similar to the // operator in XQuery. 
For instance, your proposed syntax:

      document("links.xhtml")/[DESCEND]

Seems identical to the following XQuery:

      document("links.xhtml")//*

In your examples, you show only elements, but in your text you say you are 
searching for "nodes". I used the results from the examples rather than the 
text to discern your intent. Note that the // operator returns nodes in 
document order, so that elements are returned in the order of their start 
tags. This is the order you ask for.

You also ask for the ability to specify levels. If a small number of levels 
are involved, you can do this using unions:

        document("links.xhtml")/*
|     document("links.xhtml")/*/*
|     document("links.xhtml")/*/*/*

It is not clear to me that ranges of levels are particularly important. If 
you need them, you can get them by writing recursive functions. Now let's 
consider ranges that do not start with the root, as in this:

          document("links.xhtml")/[DESCEND 4 TO INF]

The solution is either to write a recursive function or to use the EXCEPT 
operator:

          document("links.xhtml")//*
                 EXCEPT document("links.xhtml")/*
                             | document("links.xhtml")/*/*
                             | document("links.xhtml")/*/*/*

Obviously, if this were something users frequently want to do, we might 
consider supporting it directly, but it is not clear to me that this is 
necessary. If you disagree, it may be helpful to illustrate the utility of 
this feature by writing us a use case. Please consider the format used for 
our other use cases, which you can find here:

            www.w3.org/tr/xmlquery-use-cases

We appreciate your feedback on the XML Query specifications. Please let us 
know if this response is satisfactory. If not, please respond to this 
message, explaining your concerns.

Jonathan Robie
On behalf of the XML Query Working Group

Received on Thursday, 14 June 2001 12:50:01 UTC