[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Parameterized attribute

Subject: Parameterized attribute
From: "Haque, Suraiya" <Suraiya.Haque@xxxxxxx>
Date: Wed, 29 Aug 2001 13:09:41 -0400
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.