This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: How to get the preceding-sibling of parameter context node[URGENT]
- From: Joerg Pietschmann <joerg dot pietschmann at zkb dot ch>
- To: XSL List <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 14 Feb 2002 09:45:37 +0100
- Subject: Re: [xsl] How to get the preceding-sibling of parameter context node[URGENT]
- Organization: ZKB
- Reply-to: xsl-list at lists dot mulberrytech dot com
Mailer Mailer <maillistboxes@yahoo.com> 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