[Bug 3305] Cardinality +/* on range variables

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3305





------- Comment #1 from davidc@nag.co.uk  2006-05-31 13:54 -------
I think the spec is fairly clear at present that the type applies to the
variable (ie to each individual item in a for clause) so saxon (and xq2xsl)
have (currently) the correct interpretation.

3.8.1 says:

...Each variable bound in a for or let clause may have an optional type
declaration, which is a type declared using the syntax in 2.5.3 SequenceType
Syntax. If the type of a value bound to the variable does not match the
declared type... 

The change to instead type the sequence would as you point out be more
expressive as it would give sensible meanings for the cardinality indicators,
but if that change were made I think the position of the as clause would need
to move

for $i in (1,2,3) as xs:integer*

so that "as" keeps its role of  separating the value and the type.

David

Received on Wednesday, 31 May 2006 13:54:11 UTC