xml-xalan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Hedenus (JIRA)" <xalan-...@xml.apache.org>
Subject [jira] Created: (XALANJ-2373) Variables within variables are not evaluated correctly
Date Fri, 16 Mar 2007 09:21:09 GMT
Variables within variables are not evaluated correctly

                 Key: XALANJ-2373
                 URL: https://issues.apache.org/jira/browse/XALANJ-2373
             Project: XalanJ2
          Issue Type: Bug
          Components: XSLTC
    Affects Versions: 2.7
         Environment: JDK 1.5, Xalan 2.7.0
            Reporter: Michael Hedenus
            Priority: Blocker

Under some conditions variables within variables are not resolved.
Here is a usecase. Run the following stylesheet with XSLTC and use the stylesheet itself as

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
exclude-result-prefixes="xalan java">
<xsl:output method="xml" indent="yes"/>

<xsl:variable name="vars">

<xsl:variable name="test">
<xsl:for-each select="xalan:nodeset($vars)/var">
<xsl:variable name="s1" select="substring-after(., 'var')"/>
<out org="{.}"><xsl:value-of select="$s1"/></out>

<xsl:template match="/">
<xsl:copy-of select="$test"/>

The output should be (as it is correctly produced by Xalan interpretive)

<?xml version="1.0" encoding="UTF-8"?>
<out org="var1">1</out>
<out org="var2">2</out>
<out org="var3">3</out>
<out org="var4">4</out>

But XSTLC produces:

<?xml version="1.0" encoding="UTF-8"?>
<out org="var1"/>
<out org="var2"/>
<out org="var3"/>
<out org="var4"/>

Somehow the content of $s1 is gone empty! Under unrepeatable circumstances this bug even leads
to a NullPointerException.
I consider this bug to be very evil.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org

View raw message