[Bug 4082] Static typing of annex-6

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

           Summary: Static typing of annex-6
           Product: XML Query Test Suite
           Version: 1.0.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XML Query Test Suite
        AssignedTo: andrew.eisenberg@us.ibm.com
        ReportedBy: nick@cbcl.co.uk
         QAContact: public-qt-comments@w3.org


Hopefully this should be one of our last static typing problems!

In annex-6

declare function eg:index-of-node($sequence as node()*, $srch as node()) as
xs:i
nteger*
{
  for $n at $i in $sequence where ($n is $srch) return $i
};

let $arg1 := (<element1>some data 1</element1>,<element2>some data
2</element2>)
let $arg2 := $arg1[2]
return
 eg:index-of-node($arg1,$arg2)


The second arguement of index-of-node has type node(), which it must do for $n
is $srch to type check.

But $arg2 has quantifier zero-or-one (section 7.2.13 of the FS) hence the
function call fails to static type check.

Received on Friday, 15 December 2006 13:41:08 UTC