<?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>9812</bug_id>
          
          <creation_ts>2010-05-27 14:03:03 +0000</creation_ts>
          <short_desc>[XSLT] Excluded namespace nodes and namespace aliases</short_desc>
          <delta_ts>2010-07-15 09:56:26 +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>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc>http://www.w3.org/TR/xslt20/#dt-target-namespace-uri</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="Tim Mills">tim</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>35846</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2010-05-27 14:03:03 +0000</bug_when>
    <thetext>The XSLT 2.0 specification states:

&quot;[Definition: The namespace URI that is to be used in the result tree as a substitute for a literal namespace URI is called the target namespace URI.]&quot;

and later

&quot;A namespace node whose string value is a target namespace URI is copied to the result tree, whether or not the URI identifies an excluded namespace.&quot;

Suppose we have two stylesheets:

main.xsl

&lt;xsl:stylesheet
  version=&quot;2.0&quot; 
  xmlns=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  xmlns:x=&quot;http://www.example.org/alias&quot;
  xmlns:y=&quot;http://www.example.org/My/Transform/Language&quot;&gt;
	
  &lt;xsl:import href=&quot;import.xsl&quot; /&gt;

  &lt;xsl:namespace-alias stylesheet-prefix=&quot;x&quot; result-prefix=&quot;y&quot;/&gt;

  &lt;xsl:template match=&quot;/&quot;&gt;
    &lt;x:transform /&gt;
  &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;


import.xsl

&lt;xsl:stylesheet
  version=&quot;2.0&quot; 
  xmlns=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  xmlns:x=&quot;http://www.example.org/alias&quot;
  xmlns:y=&quot;http://www.example.org/My/Transform/Language&quot;&gt;
	
  &lt;xsl:namespace-alias stylesheet-prefix=&quot;x&quot; result-prefix=&quot;#default&quot;/&gt;

&lt;/xsl:stylesheet&gt;

Is &quot;http://www.w3.org/1999/XSL/Transform&quot; (ordinarily an excluded namespace) considered as a target namespace URI, even though the xsl:namespace-alias is overridden by a higher priority xsl:namespace-alias for the same literal namespace URI?

i.e. is the correct result:

&lt;y:transform 
  xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; 
  xmlns=&quot;http://www.w3.org/1999/XSL/Transform&quot; 
  xmlns:y=&quot;http://www.example.org/My/Transform/Language&quot;/&gt;

or

&lt;y:transform xmlns:y=&quot;http://www.example.org/My/Transform/Language&quot;/&gt;

?

I would presume that the latter is correct, because &quot;http://www.w3.org/1999/XSL/Transform&quot; is not going to be used in the result tree as a substitute for a literal namespace URI due to the higher precedence xsl:namespace-alias declaration.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35849</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-05-27 15:04:07 +0000</bug_when>
    <thetext>I guess that the statement &quot;If a literal namespace URI is declared to be an alias for multiple different target namespace URIs, then the declaration with the highest import precedence is used.&quot; could be expanded with &quot;..., and the other declarations have no effect.&quot; Would this remove any remaining doubts?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35850</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2010-05-27 15:10:13 +0000</bug_when>
    <thetext>Yes.  Just to be clear, do you agree that

&lt;y:transform xmlns:y=&quot;http://www.example.org/My/Transform/Language&quot;/&gt;

is the correct answer?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35852</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-05-27 15:48:52 +0000</bug_when>
    <thetext>I&apos;ve added this as test case nspc-n144.

The answer I get from Saxon is

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;y:transform xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; 
             xmlns=&quot;http://www.w3.org/1999/XSL/Transform&quot; 
             xmlns:y=&quot;http://www.example.org/My/Transform/Language&quot;/&gt;

which I believe is incorrect, for the reasons described.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35853</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2010-05-27 16:13:13 +0000</bug_when>
    <thetext>Thanks.

We believe we have found a number of errors in the test suite.  Where should we report them?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35854</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-05-27 16:18:21 +0000</bug_when>
    <thetext>Please report errors in the XSLT testsuite in the W3C &quot;member-private&quot; Bugzilla database, http://www.w3.org/Member/bugzilla/ - product &quot;XSLT 2.0 CR Test Collection&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36902</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-07-15 09:56:09 +0000</bug_when>
    <thetext>Closing as WORKSFORME - the spec is correct, the test case was wrong.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>