<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>6899</bug_id>
          
          <creation_ts>2009-05-11 17:57:52 +0000</creation_ts>
          <short_desc>[UPD] Transform: replaced attributes should be untyped</short_desc>
          <delta_ts>2009-07-03 22:50:42 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Update Facility</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>jim.melton</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>25104</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-05-11 17:57:52 +0000</bug_when>
    <thetext>This relates to test case setToUntyped-010.xq

The essence of this query is:

copy $var1 := document { &lt;test oldattr=&quot;abc&quot;&gt;&lt;content/&gt;&lt;/test&gt; }
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

&quot;If the type-name property of parent($target) is xs:untyped, then upd:setToUntyped() is invoked on each element node in $replacement.&quot;

to

&quot;If the type-name property of parent($target) is xs:untyped, then upd:setToUntyped() is invoked on each element and attribute node in $replacement.&quot;

and the result of this test should then change so that @CAT is xs:untypedAtomic.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25855</commentid>
    <comment_count>1</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2009-07-03 21:20:42 +0000</bug_when>
    <thetext>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. </thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>