You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2002/05/03 14:28:53 UTC

DO NOT REPLY [Bug 7776] - Value not being passed to extension function

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=7776>.
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=7776

Value not being passed to extension function





------- Additional Comments From Wolfram.Eisert@dresdner-bank.com  2002-05-03 12:28 -------
I encounter the same problem using current Xalan-CVS (2002-05-03),
which works in Xalan 2.3.1 (also encouter in Cocoon :-).

A java extension function is provided with correct values
only at the first call. For all following calls of the same method
the values are empty strings ("").

Here is an example:
XML:
<page>
<data att="att1"/>
<data att="att2"/>
<data att="att3"/>
<data att="att4"/>
</page>

XSL:
<?xml version="1.0"?>
<xsl:stylesheet	version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:XalanTest="XalanTest">

	<xsl:variable name="xalan-test"
		select="XalanTest:new()"
		xmlns:XalanTest="XalanTest"/>

	<xsl:template match="/page">
		<xsl:for-each select="data">
	for-each: <xsl:value-of select="XalanTest:getData($xalan-test, @att)"/>
		</xsl:for-each>
	</xsl:template>

</xsl:stylesheet>

XalanTest.java:
public class XalanTest
{
    int count = 0;
    public XalanTest() { }
    public String getData(String output)
    {
        count++;
        return output + " " + count;
    }
}

Output with current CVS:
for-each: att1 1
for-each:  2
for-each:  3
for-each:  4

Output with Xalan 2.3.1 (correct!):
for-each: att1 1
for-each: att2 2
for-each: att3 3
for-each: att4 4