[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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, '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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|