<?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>3417</bug_id>
          
          <creation_ts>2006-06-30 11:34:37 +0000</creation_ts>
          <short_desc>[XSLT] Base URI of a copied element</short_desc>
          <delta_ts>2006-08-16 18:28:52 +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>XSLT 2.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</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="Michael Kay">mike</assigned_to>
          
          
          <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>10333</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-06-30 11:34:37 +0000</bug_when>
    <thetext>For xsl:copy and xsl:copy-of, the rules say that the base URI property of the element is copied unchanged. 

If the element has an xml:base attribute, I don&apos;t feel this rule is right.

Firstly, for xsl:copy, the new element may have an xml:base attribute that wasn&apos;t present on the original element, and it seems wrong to ignore this.

Secondly, for both instructions, the element may have a relative xml:base attribute, and it makes sense to &quot;re-resolve&quot; this in the same way as we would do with a newly constructed element. Otherwise it could lead to the element having a base URI that is different from the one that would be obtained by computation. 

Related to this, I think we should clarify that when we make use of the value of xml:base in determining the base URI of a node, we process the attribute as described in the XML Base specification, in particular, we percent-encode special characters.

Specific changes:

(a) for xsl:copy and xsl:copy-of, instead of &quot;The base URI of the node is copied&quot;, we should say: &quot;The base URI of the node is copied, except in the case of an element node having an xml:base attribute, in which case the base URI is taken as the value of the xml:base attribute, resolved if it is relative against the base URI of the xsl:copy|xsl:copy-of instruction.&quot;

(b) At the end of 5.8, add the rule. &quot;In the case of xml:base this means that the value of the attribute, before being used in any calculation of a base URI, is percent-encoded as described in [XML Base].&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10345</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-07-01 20:13:48 +0000</bug_when>
    <thetext>Note that test case baseuri20_044_01 applies here. The stylesheet does:

&lt;xsl:variable name=&quot;elemcopy&quot; as=&quot;element()&quot;&gt;
	&lt;xsl:copy-of select=&quot;/doc/str1&quot; /&gt;
&lt;/xsl:variable&gt;

where the copied element has xml:base=&quot;/xml/&quot;. The expected results (which are correct according to the spec as currently written) expects the str1 element to have a base URI of http://www.xmlexample.ibm/xml/ - that is, the result of resolving xml:base against the base URI of its original parent node.

(Also note comment 2 in bug #3415 concerning percent-encoding of base URIs.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11012</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-08-03 17:32:27 +0000</bug_when>
    <thetext>As per comment 2 in bug #3415 concerning percent-encoding of base URIs., item (b) of the proposal is withdrawn.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11178</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-08-16 18:28:38 +0000</bug_when>
    <thetext>The following change was agreed on 2006-08-03, and has now been applied to the base document:

RESOLVED: accept as specified in item (a) of the description.

     (a) for xsl:copy and xsl:copy-of, instead of &quot;The base URI of the
     node is copied&quot;, we should say: &quot;The base URI of the node is
     copied, except in the case of an element node having an xml:base
     attribute, in which case the base URI is taken as the value of the
     xml:base attribute, resolved if it is relative against the base
     URI of the xsl:copy|xsl:copy-of instruction.&quot;

</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>