This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl:param error
- From: Joerg Pietschmann <joerg dot pietschmann at zkb dot ch>
- To: XSL List <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 15 Nov 2001 19:45:49 +0100
- Subject: Re: [xsl] xsl:param error
- Organization: ZKB
- Reply-to: xsl-list at lists dot mulberrytech dot com
Vaibhava <vaibhava@muchhal.com> wrote
> I am attempting to set a counter using the XSL:param method.
[...]
> <xsl:for-each select="bannerlist/banner">
> <xsl:param name="count" expr="count+1"></xsl:param>
Well, xsl:param may not be used there. You can't set counters
this way. You don't need to in your case. XSLT is not JavaScript.
Replace the faulty line by
<xsl:variable name="count" select="position()"/>
and drop the line with <xsl:param name="count">0</xsl:param>,
you should now see increasing values in the last column in
your generated table.
You can, of course, use position instead of $count directly (be
aware that there are traps if you do so). Get a good XSLT book
and study these topics more extensively.
BTW you are using disable-output-escaping in a dangerous way.
Delete all occurences immediately.
HTH J.Pietschmann
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list