garyp 01/08/25 22:14:37
Added: test/tests/bugzilla Bugzilla3265.out Bugzilla3265.xml
Bugzilla3265.xsl
Log:
Test for using an expression in the evaluate extension function that contains
a top-level variable. This was causing an NPE.
Revision Changes Path
1.1 xml-xalan/test/tests/bugzilla/Bugzilla3265.out
Index: Bugzilla3265.out
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<test>
<out value="1"/><out value="2"/><out value="3"/>
</test>
1.1 xml-xalan/test/tests/bugzilla/Bugzilla3265.xml
Index: Bugzilla3265.xml
===================================================================
<?xml version="1.0"?>
<root>
<enumeration>
<item value="1" />
<item value="2" />
<item value="3" />
</enumeration>
<reference ref="enumeration/item" />
</root>
1.1 xml-xalan/test/tests/bugzilla/Bugzilla3265.xsl
Index: Bugzilla3265.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xalan"
exclude-result-prefixes="xalan">
<!-- This stylesheet tests the evaluate extension function for the
case where the expression to be evaluated contains a top-level
variable -->
<xsl:variable name="this" select="root" />
<xsl:template match="root">
<test>
<xsl:apply-templates/>
</test>
</xsl:template>
<xsl:template match="reference">
<xsl:variable name="var-ref" select="concat('$this/', @ref)" />
<xsl:for-each select="xalan:evaluate($var-ref)">
<out value="[EMAIL PROTECTED]" />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]