This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In addition to expecting an error, this query may also return true because it can be answered purely through static type analysis. Similarly for K-SeqExprInstanceOf-57. K-SeqExprInstanceOf-58 should expect false. (:*******************************************************:) (: Test: K-SeqExprInstanceOf-56 :) (: Written by: Frans Englich :) (: Date: 2007-11-22T11:31:21+01:00 :) (: Purpose: The fn:error() function in combination with 'instance of'. :) (:*******************************************************:) error() instance of xs:integer
A fix was attempted in CVS.
I think you may have got the expected results wrong for the first two here. It should be: K-SeqExprInstanceOf-56 -> true K-SeqExprInstanceOf-57 -> true
...and (my mistake): K-SeqExprInstanceOf-58 -> false
I'm not sure I'm following, so K-SeqExprInstanceOf-56: error() instance of xs:integer should return true? none is an instance of xs:integer?
Though strange, I think that none _is_ an instance of xs:integer. Can someone please confirm this? 'none' is definitely a subtype of xs:integer. 'none' is a subtype of all other types. So this query can be boiled down to the question "is something shich is a subtype of xs:integer always an instance of xs:itneger".
Is none a subtype of xs:integer? Yes. Is none an instance of xs:integer? It's a bad question, because none denotes a type, not a value. Instead, the proper question is something like: given an expression Expr instance of SequenceType if the static type of Expr is a subtype of (the type denoted by) SequenceType, is an implementation allowed to rewrite the expression as fn:true()? I believe you could prove that, in such a case, the only non-error outcome is the value true, and so (according to the XQuery rewriting rules) the rewrite is allowed. The particular test case is an example of the general case, so I believe returning true is conformant. (However, I'm not familiar with the extent to which the test suite caters to rewrites.)
Ok, I changed the baselines as per instructed in comments #2 and #3. A lot can be said about XQuery Formal Semantics.
> A lot can be said about XQuery Formal Semantics. Only nice things I hope :) I'll close this once I've checked the results. CurrentlyI can't connect to CVS - it just hangs.
K-SeqExprInstanceOf-56 and K-SeqExprInstanceOf-57 are now correct. I've given you the wrong expected result for: K-SeqExprInstanceOf-58 error() instance of empty-sequence() should be true. The reason is that 'empty' is the same as 'none?'. So this is like (something of type T) instance of T? which is true.
Should be fixed in CVS.
Thanks.