Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Count preceding-sibling back to a specific node

From: "Oleg Tkachenko [MVP]" <oleg@--_!----!_------!---------.--->
To: NULL
Date: 3/5/2004 5:37:00 PM
mikeT wrote:

> Thanks! I got it to work. But I don't quite understand something about xslt.
> 
> If I write:
> 
> <xsl:param name="node-where-stop" select="an XPath expression that selects my node"/>
> 
> it works.
> 
> If instead I plug in the same XPath expression in place of $node-where-stop in the count() it doesn't work.

If your XPath expression depends on context, then obviously it won't 
work. Something like "id('bk101')" or "/A/B" doesn't depend on context, 
but A/B or id(@foo) does.
Anyway that's bad idea not to use variable here due to obvious perf 
reason - having expression instead of variable you may end up with 
evaluating the same expression over and over again.

-- 
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent