Subject: Re: [xsl] How to get the preceding-sibling of parameter context node[URGENT] From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Date: Thu, 14 Feb 2002 08:18:51 +0000 |
Hi Deep, > //How to get the preceding-sibling of context node > here following does not work > > <xsl:variable name="cnt" > select="count(preceding-sibling::$contextnode[@name='data'])"/> You need a location path that starts from the $contextnode: $contextnode And then steps to its preceding sibling elements: $contextnode/preceding-sibling::* I think you're testing the name attribute of the preceding siblings when you're counting them, so you need: <xsl:variable name="cnt" select="count($contextnode/preceding-sibling::*[@name='data'])"/> Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] How to get the preceding-sibl, Mailer Mailer | Thread | Re: [xsl] How to get the preceding-, Gennady Loskutov |
[xsl] How to get the preceding-sibl, Mailer Mailer | Date | Re: [xsl] How to get the preceding-, Gennady Loskutov |
Month |