This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13070 - [CVS] stf-insert-02
Summary: [CVS] stf-insert-02
Status: NEW
Alias: None
Product: XQuery Update Facility Test Suite
Classification: Unclassified
Component: XQuery Update Facility Test Suite (show other bugs)
Version: unspecified
Hardware: PC Windows 3.1
: P2 normal
Target Milestone: ---
Assignee: Benjamin Nguyen
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-27 15:55 UTC by Tim Mills
Modified: 2012-12-04 00:54 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2011-06-27 15:55:11 UTC
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
Comment 1 Tim Mills 2011-06-28 10:05:58 UTC
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.
Comment 2 Tim Mills 2011-07-15 16:35:14 UTC
There is a similar problem in stf-replace-node-06.