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 relates to test case setToUntyped-010.xq The essence of this query is: copy $var1 := document { <test oldattr="abc"><content/></test> } modify replace node $var1/test[1]/@oldattr with $input-context/BOOKLIST[1]/BOOKS[1]/ITEM[1]/@CAT return ( $var1/test[1]/@CAT instance of attribute(*, xs:untypedAtomic), $var1/test[1]/@CAT instance of attribute(*, xs:string) ) and the expected result is that @CAT is typed as xs:string. I think this is consistent with the rules for upd:replaceNode() as written in 3.1.8. However, it creates an inconsistent data model. The rules for the copy-modify expression (2.4.5 clause 1.c.i) ensure that the test attribute is xs:untyped, and XDM consistency requires that the attributes of an xs:untyped element are all xs:untypedAtomic. I believe that clause 1.b of 3.1.8 should change from "If the type-name property of parent($target) is xs:untyped, then upd:setToUntyped() is invoked on each element node in $replacement." to "If the type-name property of parent($target) is xs:untyped, then upd:setToUntyped() is invoked on each element and attribute node in $replacement." and the result of this test should then change so that @CAT is xs:untypedAtomic.
In its meeting #400 on 2009-05-12, the XML Query WG recognized that there already exists text in the XQuery Update Facility 1.0 third CR document (see http://www.w3.org/TR/2009/CR-xquery-update-10-20090609/) to resolve this bug (though slightly differently than proposed in the bug). Thus, I am marking this bug RESOLVED FIXED, noting that a test still must be added to the XQuery Update Facility Test Suite to test the solution to the bug. If this action resolves your issue, please mark the bug CLOSED.