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 6899 - [UPD] Transform: replaced attributes should be untyped
Summary: [UPD] Transform: replaced attributes should be untyped
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Update Facility (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-11 17:57 UTC by Michael Kay
Modified: 2009-07-03 22:50 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2009-05-11 17:57:52 UTC
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.
Comment 1 Jim Melton 2009-07-03 21:20:42 UTC
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.