I'm not sure what the following expression ought to return:

declare namespace local="http://localhost/";;
declare function local:minus($x){ -($x treat as xs:untypedAtomic?) };
local:minus(local:minus(1))

At first I naively *thought* it would return 1

Saxon 9.4.0.3 returns the empty sequence

MarkLogic 5 produces an error:


     [1.0-ml] XDMP-TREAT: (err:XPDY0050) (for $x in $x return $x) treat
     as xs:untypedAtomic? -- Invalid treat: 1 treat as xs:untypedAtomic

I read the XQuery 1.0 spec on treat, and it appears to me that the error is correct, since the type of 1, xs:integer, is not derived from xs:untypedAtomic, but can anyone confirm that please?

-Mike Sokolov

_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk

Reply via email to