This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Parameterized attribute



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, &apos;00.00&apos;)"/>
</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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]