[Bug 21893] [XP30] Casting to QName - error codes

https://www.w3.org/Bugs/Public/show_bug.cgi?id=21893

--- Comment #3 from Tim Mills <tim@cbcl.co.uk> ---
Note that in XQ10 casting from xs:untypedAtomic to xs:QName was not permitted.

In XQ30, it was permitted.

Following the text as written, and using the example below

declare function local:example($arg as xs:QName)
{
  ...
};

local:example( xs:untypedAtomic("missingPrefix:localName") )


1.  Each item in the atomic sequence that is of type xs:untypedAtomic is cast
to the expected generalized atomic type. 

Cast from xs:untypedAtomic("localName") to QName - fails with FONS0004 because
the prefix is not bound in the static context.

However, this should have been prevented (possibly statically) by an XPTY0017.

Therefore I propose reordering the text to be:

* For built-in functions where the expected type is specified as numeric,
arguments of type xs:untypedAtomic are cast to xs:double. 
* If the item is of type xs:untypedAtomic and the expected type is
namespace-sensitive, a type error [err:XPTY0117] is raised.  
* Otherwise, each item in the atomic sequence that is of type xs:untypedAtomic
is cast to the expected generalized atomic type

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 14 October 2014 16:31:34 UTC