Subject: Re: How to get the preceding-sibling of parameter context node[URGENT]
From: Joerg Pietschmann <joerg.pietschmann@xxxxxx>
Date: Thu, 14 Feb 2002 09:45:37 +0100
|
Mailer Mailer <maillistboxes@xxxxxxxxx> wrote:
...
> <xsl:template name="mytemplate">
> <xsl:param name="contextnode"/>
> <xsl:for-each select="$contextnode">
> <xsl:variable name="cnt"
> select="count(preceding-sibling::$contextnode[@name='data'])"/>
Try
select="count($contextnode/preceding-sibling::*[@name='data'])"/>
It may be necessary to add more restrictions, like
select="count($contextnode/preceding-sibling::*[name()=name($contextnode) and @name='data'])"/>
HTH
J.Pietschmann
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|