[Bug 3971] More XQTS static type errors

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





------- Comment #7 from tim@cbcl.co.uk  2007-01-11 17:14 -------
I believe nametest-9 to be correct.  Quoting from the formal semantics spec,

"A computed element constructor creates a new element with either the type
annotation xs:untyped (in strip construction mode), or with the type annotation
xs:anyType (in preserve construction mode)"

and therefore that the type assigned to $var does not permit you to deduce the
error "path does not contain empty-node-list".

: Name: nametest-9 :)
(: Description: Name test that attempts to select non-existent nodes from a
newly constructed.:)
(: Use fn:count to avoid empty file.  :)

(: insert-start :)
declare variable $input-context1 as document-node() := document { <doc/> };
(: insert-end :)

let $var := <a attr1 = "abc1"><b attr2 = "abc2">context2</b></a>
return
  fn:count(($var/empty-node-list)[1])

Received on Thursday, 11 January 2007 17:14:39 UTC