XML Query Use Case REF

XML Query Use Cases
W3C Working Draft 15 February 2001

Use Case REF

1.9.4.1 Q1

For this query alone, the Expected Result is not embedded in a <result>
element. Is that intentional?

1.9.4.* Q1, Q5, Q6, Q7, Q8

In the Solution in XQuery, occurrences of "name" should be changed to "@name".

1.9.4.* Q3, Q4, Q5

In the Solution in XQuery, occurrences of "job" should be changed to "@job".

1.9.4.3 Q3

The Solution in XQuery does not find that John is a parent of an athlete
(Helen), because there is no appropriate binding for $s. (He has no spouse.)
Instead, maybe:
    <result>
        FOR $a IN document("census.xml")//person[@job = "Athlete"],
            $p IN $a/..[name()="person"] | $a/../@spouse -> person
        RETURN shallow($p)
    </result>

1.9.4.8 Q8

Note that if Dave's spouse happened to be one of the top-level persons, the
Solution in XQuery would bind $sp to the <census> element.  So you should
maybe change
    $s/..
to
    $s/..[name()="person"]

-Michael Dyck

Received on Sunday, 11 March 2001 03:40:36 UTC