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

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24793

Xalan 2.5.2 XSLTC: <xsl:copy-of> loses both ATTRIBUTES & NAMESPACES

           Summary: Xalan 2.5.2 XSLTC: <xsl:copy-of> loses both ATTRIBUTES &
                    NAMESPACES
           Product: XalanJ2
           Version: 2.0.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Xalan-Xsltc
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Description of the problem:
- First have a look at the xsl in the end of this message.
- Note that variables $fragment1 and $fragment2 should be equal to:

        <ns:tag ns:attribute="xxx">
                stuff
        </ns:tag>

- Xalan Interpreter works fine

- Bot Xalan Interpreter & XSLTC work fine for 

        <xsl:copy-of select="$fragment1"/> 

- But for instruction
        <xsl:copy-of select="$fragment2"/>
  XSLTC 2.5.2 gives (attributes, namespace are lost):
        <tag>
                stuff
        </tag>
  XLSTC 2.5.1 gives (namespace is lost):
        <tag xmlns:ns="ns" ns:attribute="xxx">
                stuff
        </tag>
  Note that default namespace is not defined in the output.

Versions:
        $java org.apache.xalan.xslt.Process -V
        Xalan Version Xalan Java 2.5.2

        $java org.apache.xerces.impl.Version
        Xerces-J 2.4.0

        $ver
        Microsoft Windows 2000 [Version 5.00.2195]

        $java -version
        java version "1.4.1_02"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
        Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)

Command line to reproduce:
        Normal behaviour:
                $java org.apache.xalan.xslt.Process -xsl bug.xsl -in 
[arbitrary].xml
                
        Faulty behaviour:
                $java org.apache.xalan.xslt.Process -xsl bug.xsl -in 
[arbitrary].xml -XSLTC

Attached files:
        bug.xsl
                XSL to reproduce the problem

        bug.xalan.xml
                Output of Xalan interpreter

        bug.xsltc.2.5.2.xml
                Output of XSLTC 2.5.2

        bug.xsltc.2.5.1.xml
                Output of XSLTC 2.5.1


----------------------  bug.xsl ----------------------------

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet 
        xmlns:ns="http://www.site.org/namespace"; 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
        version="1.0"
        >

<xsl:template match="/">

        <xsl:variable name="fragment1">                 
                        <ns:tag ns:attribute="xxx">
                                stuff
                        </ns:tag>
        </xsl:variable>

        <xsl:variable name="fragment2">
                <xsl:call-template name="get-data"/>
        </xsl:variable>
                
        <ns:start>      
        
          Fragment 1:
        ---
        <xsl:copy-of select="$fragment1"/>
        ---
        
        Fragment 2:
        ---
        <xsl:copy-of select="$fragment2"/>
        ---
                
        </ns:start>
                
</xsl:template>

<xsl:template name="get-data">

        <ns:tag ns:attribute="xxx">
                stuff
        </ns:tag>
                                
</xsl:template>
        
</xsl:stylesheet>

Reply via email to