This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Parameterized attribute
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] Parameterized attribute
- From: "Haque, Suraiya" <Suraiya dot Haque at fmr dot com>
- Date: Wed, 29 Aug 2001 13:09:41 -0400
- Reply-To: xsl-list at lists dot mulberrytech dot com
I'm trying to implement a named template with the an attribute name passed
in as a parameter as follows:
<xsl:template name="testTemplate">
<xsl:param name="position"><xsl:value-of select="position"/></xsl:param>
<xsl:param name="attributeName"><xsl:value-of
select="attributeName"/></xsl:param>
<xsl:variable name="test"><xsl:value-of
select="format-number((number(substring(following-sibling::Row[position()=$p
osition]/$attributeName, 2)))div 100, '00.00')"/>
</xsl:variable>
<xsl:value-of select="test"/>
</xsl:template>
<xsl:template match="/">
<xsl:call-template name="testTemplate">
<xsl:with-param name="position">1</xsl:with-param>
<xsl:with-param name="attributeName">@TOTTAX</xsl:with-param>
</xsl:call-template>
</xsl:template>
XML is:
<AppInfo>
<Row GROSSAMT="+00000002917" TOTTAX="+00000002917" />
<Row GROSSAMT="+00000002978" TOTTAX="+00000002978" />
<Row GROSSAMT="+00000003115" TOTTAX="+00000003115" />
</AppInfo>
In IE5, I get this error:
NodeTest expected here.
format-number((number(substring(following-sibling::Row[position()=$position]
/-->$<--attributeName, 2)))div 100, '00.00')
What am I doing wrong?
Thanks,
Suraiya
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list