Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Count preceding-sibling back to a specific node

From: anonymous@-----------.---------.---
To: NULL
Date: 3/4/2004 2:46:00 PM
Oleg,

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.

Why? I assume it has something to do with needing a node set. Is there some way I could write the equivalent directly into the count()? I am asking because I am trying to insert this into an Auto-calculation in Stylesheet Designer.

mike


     
     ----- Oleg Tkachenko [MVP] wrote: -----
     
     mikeT wrote:
     
     > If I can identify a node by its id and I know that it is in the set of preceding-sibling of my context node can I count the number of preceding-sibling from the context node back to that node?
     
     May be something like
     
     count(
        preceding-sibling::*[
          not(
            following-sibling::*[count(.|$node-where-stop)=1]
          )
        ]
     )
     
     -- 
     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