[Bug 4248] Static typing of K2-DocumentURIFunc-10

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





------- Comment #2 from frans.englich@telia.com  2007-01-20 12:24 -------
Doesn't the [1]-predicate ensure a more precise cardinality is inferred? Formal
Semantics, 4.3.2 Filter Expressions reads:

"When a predicate with a numeric literal or the last() expression is applied on
a primary expression, it is normalized using the fn:subsequence function. This
results in a more precise static type for those cases."

7.2.13 The fn:subsequence function, reads:
"The fn:subsequence function has special static typing rules when its second
argument is the numeric literal value 1 or the built-in variable $fs:last.
These rules provide better typing for path expressions such as Expr[1] and
Expr[fn:last()]."

Therefore, I currently guess that the mentioned tests doesn't have
cardinality-related errors.

However, I think K2-StartsWithFunc-1 to 6 and K2-EndsWithFunc-1 to 6 should
fail type check nevertheless because the declared type of the variable, doesn't
match its operand:

declare variable $vA as xs:string := ("B STRING", current-time(),
string(<e>content</e>))[1];

Received on Saturday, 20 January 2007 12:25:11 UTC