DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27914>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27914

Fails Oasis test case attribset40

           Summary: Fails Oasis test case attribset40
           Product: XalanJ2
           Version: CurrentCVS
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Xalan-CmdLine
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


This is reproducible in Xalan-J 2.6.0. 
(Someone needs to add a version for that in Bugzilla) 
This is a very tricky test case. Start with this XML file:

<?xml version="1.0"?>
<docs>
 <b>bdd:attr</b>
</docs>

Then use this XSLT stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0"
           xmlns:bdd="http://bdd.test.com";>

 <!-- FileName: attribset40 -->
 <!-- Document: http://www.w3.org/TR/xslt -->
 <!-- DocVersion: 19991116 -->
 <!-- Section: 7.1.3 Creating Attributes -->
 <!-- Creator: David Marston -->
 <!-- Purpose: The attribute must be in the designated namespace, even if the
prefix has
   to be reset or ignored. -->

<xsl:template match="/">
 <out>
   <bdd:jam>
     <xsl:attribute name="{docs/b}"
namespace="http://xyz.com";>jaminben</xsl:attribute>
   </bdd:jam>
 </out>
</xsl:template>

</xsl:stylesheet>


The output should be something like:

[EMAIL PROTECTED] attribset]$ java -classpath
/opt/xml/xalan-j_2_6_0/bin/xalansamples.jar:/opt/xml/xalan-j_2_6_0/bin/xercesImpl.jar:/opt/xml/xalan-j_2_6_0/bin/xalan.jar
org.apache.xalan.xslt.Process -IN attribset40.xml -XSL attribset40.xsl
<?xml version="1.0" encoding="UTF-8"?>
<out xmlns:bdd="http://bdd.test.com";><bdd:jam xmlns:bdd="http://xyz.com";
bdd:attr="jaminben"/></out>

That is Xalan should *remap the attribute prefix to avoid the namespace conflict*. 
Yes, I know that's weird but it is what the spec and the test case say. 
Instead what we get is this, which is clearly wrong because it changes the jam
element's namespace:

<?xml version="1.0"?>
<out xmlns:bdd="http://bdd.test.com";><bdd:jam xmlns:bdd="http://xyz.com";
bdd:attr="jaminben"/></out>

Reply via email to