This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
This static typing test expects XUTY0004, but should expect XPTY0004. In this test, the type check error is in the fs:item-sequence-to-node-sequence function, rathe than in the type checking of the "insert nodes" expression. let $source := ( element status {'active'}, attribute type {'PT'} ) for $target in $input-context/works/employee[@nonexistent] return insert nodes $source into $target
There is a similar problem in stf-replace-node-04. let $target := $input-context/works[1]/employee[1], $replacement as node()* := <employee name='John Q Public'/> return replace node $target with $replacement which is effectively let $target := $input-context/works[1]/employee[1], $replacement as node()* := <employee name='John Q Public'/> return replace node $target with fs:item-sequence-to-node-sequence($replacement) There's also a more tricky situation than is tested in the test suite. declare variable $flag as xs:boolean external; let $target := if ($flag) then exactly-one($input-context/works[1]/employee[1]/@name) else exactly-one($input-context/works[1]/employee[1]), $replacement as node()* := if ($flag) then <employee name='John Q Public'/>/@name else <employee name='John Q Public'/> return replace node $target with $replacement The type checker can determine that there is a type checking error, but can't tell whether it is XUTY0010 or XUTY0011, because $target has static type (attribute | element). I'd argue XPTY0004 is an appropriate response during static type checking.
There is a similar problem in stf-replace-node-06.