This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
apply templates with with-param on Xalan
- To: XSL-List at mulberrytech dot com
- Subject: apply templates with with-param on Xalan
- From: "petermarshall " <petermarshall at my-deja dot com>
- Date: Mon, 24 Jul 2000 08:21:08 -0700
- Organization: My Deja Email (http://www.my-deja.com:80)
- Reply-To: xsl-list at mulberrytech dot com
Hi all,
I have a situation where I want to appy templates and pass a parameter. Essentially, the template creates html for drop down lists and the parameter is the value of the NAME attribute of the particular list element.
Parameter passing is working fine for all call-template occurances, but with the apply-templates, the
param value in the template always takes the default value (ie the select value).
The required template is being executed because all the lists get generated, its just that the list name gets defaulted.
Does anyone have any experience in this area?
Here is the match statement. The responding template is shown below. This particular
list is a simple yes/no list.
<xsl:template match="completely-unlet" name="completely-unlet">
<xsl:variable name="completely-unlet" select="document('rbscommon/binary-list.xml')"/>
<xsl:apply-templates select="$completely-unlet">
<xsl:with-param name="pname" select="'completely-unlet'"/>
</xsl:apply-templates>
</xsl:template>
This template matches the above
<xsl:template match="list" name="list">
<xsl:param name="pname" select="'name-not-set'"/>
<select name="{$pname}" class="st_select3" SIZE="1" style="width: 100px">
<xsl:apply-templates select="element"/>
</select>
</xsl:template>
<xsl:template match="element">
<option value="{index}"/><xsl:value-of select="name"/>
</xsl:template>
This generates the correct drop down lists but
with a defaulted name attribute. It seems that
the param is working with call-template but not
with apply-templates.
I am using cocoon 1.7.4
Thanks Pete Marshall
--== Sent via Deja.com http://www.deja.com/ ==--
Before you buy.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list