W3C home > Mailing lists > Public > www-xpath-comments@w3.org > January to March 2002

Error in example of For Expression?

From: Peter Marks <petermarks@blueyonder.co.uk>
Date: Tue, 5 Feb 2002 14:06:49 -0500 (EST)
Message-ID: <020a01c1ae78$5ce95a70$0200a8c0@basil>
To: <www-xpath-comments@w3.org>
The XPath 2.0 WD http://www.w3.org/TR/2001/WD-xpath20-20011220 section 2.8
contains the example:

for $a in distinct-values(//author)
return ($a,
        for $b in //book[$b/author = $a]
        return $b/title)

The use of $b in //book[$b/author = $a] is an error acording to:

"A variable name may not be used before it is bound, nor may it be used in
the expression to which it is bound."

The example should use //book[author = $a]

Received on Tuesday, 5 February 2002 18:35:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:09:42 UTC