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

Problem by apply-template with parameter, if parameter value will be selected from 
variable with node set

           Summary: Problem by apply-template with parameter, if parameter
                    value will be selected from variable with node set
           Product: XalanJ2
           Version: 2.1.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Xalan
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I've discovered a next problem:

XML
<?xml version="1.0" encoding="UTF-8"?>
<properties>
        <component>
                <property name="bgcolor">#000000</property>
                <property name="width">180</property>
                <property name="height">15</property>
        </component>
</properties>

XSL
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
        <xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
        
        <xsl:template match="properties">
                <xsl:variable name="var" select="component"/>
                <xsl:apply-templates mode="exe" select="$var">
                        <xsl:with-param name="param1">
                                <xsl:value-of
select="$var/property[@name='bgcolor']"/>
                        </xsl:with-param>
                </xsl:apply-templates>
        </xsl:template>
        
        <xsl:template mode="exe" match="node()">
                <xsl:param name="param1"/>
                property:<xsl:value-of select="property[@name='bgcolor']"/>
        </xsl:template>
</xsl:stylesheet>

It that case the template "exe" will not be called.
To get it called I have not use $var/property.... in <xsl:with-param. So
if I write:
                <xsl:apply-templates mode="exe" select="$var">
                        <xsl:with-param name="param1">
                                <xsl:value-of
select="component/property[@name='bgcolor']"/>
                        </xsl:with-param>
                </xsl:apply-templates>
the template will be called.

I found it strange.

Reply via email to