Re: XML Query Use Case SEQ

Hi Michael,

I am responding to the following message on behalf of the XML Query Working 
Group, which has reviewed my response.
http://lists.w3.org/Archives/Public/www-xml-query-comments/2001Mar/0008.html

>XML Query Use Cases
>W3C Working Draft 15 February 2001
>
>1.3 Use Case SEQ:
>
>(1)
>For each query, the Expected Result is embedded in a <result> element.
>However, none of the Solutions in XQuery construct this element.

True. We fixed that in the current Working Draft.

>(2)
>In query 4 (1.3.4.4), in the Solution in XQuery,
>     document("report1")
>should probably be
>     document("report1.xml")
>as in all the other queries.

True. The current Working Draft uses a different name for this file, but 
only for half the queries. I will fix that in my local source now so that 
the change shows up in the next Working Draft.

>(3)
>Again in query 4, in the Solution in XQuery, consider the expression:
>     EVERY $a IN ... SATISFIES $a AFTER ...
>XQuery Appendix B says that Quantifiers (SOME/EVERY x IN y SATISFIES z) are
>at precendence level 6, whereas AFTER (x AFTER y) is at level 7. Thus, the
>expression should be parsed as
>     ( EVERY $a IN ... SATISFIES $a ) AFTER ...
>which is not what you want. (It doesn't even pass type-checking.) Instead,
>you need to parenthesize the AFTER subexpression:
>     EVERY $a IN ... SATISFIES ( $a AFTER ... )

Ouch, right again. Here is the solution we used in the current Working Draft:

FOR $proc IN document("data/seq-data.xml")//section[section.title = 
"Procedure"]
WHERE SOME $i IN $proc//incision
              SATISFIES empty($proc//anesthesia BEFORE $i)
RETURN $proc

>(4)
>Still in query 4, to express "the first Incision",
>     $proc//incision[1]
>should probably be changed to
>     ($proc//incision)[1]
>as in other queries.  I think they happen to be equivalent for this
>particular DTD, but you wouldn't want to encourage sloppy thinking.

True - in the new version of the query, shown above, this does not occur.


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 Saturday, 16 June 2001 06:23:02 UTC