xsl-list
[Top] [All Lists]

Template Parameter Q

2003-02-28 14:00:10
Hello all,

I attempted to create an abstract template that I would pass a parameter (an
attribute name) to be used within the template.  I'm either trying to do
something not permitted, or have botched the syntax.  I hope someone can
point out my error(s).  I believe that the expression is being evaluated at
the time of the call, and being passed as an empty string (it's not present
in context at time of call.)  Is there a way to do what I'm attempting?

Thanks for any help,

Jeff

The call...
-------------------
<xsl:call-template name="make_list">
 <xsl:with-param name="att" select="@mfg_name"/>
</xsl:call-template>

Within the template...
-------------------
<xsl:template name="make_list">
        <xsl:param name="att"/>

        <SELECT id="mfg_list">
        <xsl:for-each select="//wheel[count(. | key('wheels-by-mfg',
@mfg_name)[1]) = 1]">
-->             <OPTION value="{$att}">
-->             <xsl:value-of select="$att"/>
                </OPTION>
        </xsl:for-each>
        </SELECT>
</xsl:template>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>