Description
When importing a stylesheet using xsl:import element, incorrect behavior is seen.
Input.xml
--------------------------
<?xml version="1.0"?>
<count>
<ONE/>
<TWO/>
<THREE/>
</count>
--------------------------
Apply_Imports.xsl
--------------------------
<?xml version="1.0"?>
<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:import href="apply_imports_adnl.xsl"/>
<xsl:template match="//">
<EM>
<xsl:apply-imports/>
</EM>
</xsl:template>
</xsl:stylesheet>
--------------------------
Apply_imports_adnl.xsl
--------------------------
<?xml version="1.0"?>
<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match="//">
<DIV style="color:blue">
<xsl:value-of select="name()"/>
</DIV>
</xsl:template>
</xsl:stylesheet>
--------------------------
+++++++++++++
When using Xalan Interpretive, the following output is seen. This is correct output.
<?xml version="1.0" encoding="UTF-8"?>
<EM><DIV style="color:blue">ONE</DIV></EM>
<EM><DIV style="color:blue">TWO</DIV></EM>
<EM><DIV style="color:blue">THREE</DIV></EM>
+++++++++++++
When using XSLTC, (Xalan 2.6.0), the following error occurs:
(Location of error unknown)XSLT Error (java.lang.VerifyError): (class: apply_imports, method: applyTemplates_2 signature: (Lorg/apache/xalan/xsltc/DOM;Lorg/apache/xml/dtm/DTMAxisIterator;Lorg/apache/xml/serializer/SerializationHandler;)V) Illegal local variable number
java.lang.RuntimeException: (class: apply_imports, method: applyTemplates_2 signature: (Lorg/apache/xalan/xsltc/DOM;Lorg/apache/xml/dtm/DTMAxisIterator;Lorg/apache/xml/serializer/SerializationHandler;)V) Illegal local variable number
at org.apache.xalan.xslt.Process.doExit(Process.java:1099)
at org.apache.xalan.xslt.Process.main(Process.java:1072)
Exception in thread "main"
+++++++++++++
When using XSLTC (Xalan CurrentCVS), the following output is seen. This is incorrect output.
<?xml version="1.0" encoding="UTF-8"?>
<EM><DIV style="color:blue">count</DIV></EM>
<EM><DIV style="color:blue">count</DIV></EM>
<EM><DIV style="color:blue">count</DIV></EM>
+++++++++++++
It appears that problem is partialy fixed in CurrentCVS version. A complete fix is needed. The output from XSLTC must be identical to the output seen in Xalan Interpretive.
Yash Talwar.