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

http://issues.apache.org/bugzilla/show_bug.cgi?id=29657

Cannot compile a stylesheet that passes a Java object as a parameter to a template.

           Summary: Cannot compile a stylesheet that passes a Java object as
                    a parameter to a template.
           Product: XalanJ2
           Version: 2.6
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I am unable to compile a stylesheet that passes a Java object as a parameter to 
a template.  For example, when trying to pass a Java String, I get the 
following error:

    Cannot convert data-type 'java.lang.String' to 'reference'.

However, I am able to successfully process the template when I do not compile 
it.

e.g. this does not work:
   java org.apache.xalan.xsltc.cmdline.Compile example.xsl

But this works:
   org.apache.xalan.xslt.Process -XSL example.xsl

Here is an example XSL file which illustrates the problem:

example.xsl:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:java="http://xml.apache.org/xalan/java";
    version="1.0">
    
    <xsl:template match="/">
        <xsl:variable
            name="javaString"
            select="java:java.lang.String.new('java variable test')"/>
        <xsl:call-template name="aTemplate">
            <xsl:with-param name="javaString" select="$javaString"/>
        </xsl:call-template>
    </xsl:template>

    <xsl:template name="aTemplate">
        <xsl:param name="javaString"/>
        <xsl:value-of select="$javaString"/>
    </xsl:template>
</xsl:stylesheet>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to