This exact behavior is *very rarely* (if ever, really) needed in XSLT - but you may have a legitimate case, so lets hear what it is exactly you need to do - e.g., are you trying to group X number of nodes in separate <div> tags, or are you trying to output a sequence of numbers?
In XSLT you can't reassign a variable - variables in XSLT are like constants in other languages; Sometimes the solution requires rethinking by grouping elements and at other times it may require recursion - it all depends...
Counter or accumulator with XSLT For Each
Hi, I have been investigated and have not encontardo solution to the problem.
What I want is to make a counter in a for-each with <xsl:variable> not serve me!, How I can do.?
The equivalent of what I get is this:
Thank you!
Hi umbracocool,
This exact behavior is *very rarely* (if ever, really) needed in XSLT - but you may have a legitimate case, so lets hear what it is exactly you need to do - e.g., are you trying to group X number of nodes in separate <div> tags, or are you trying to output a sequence of numbers?
In XSLT you can't reassign a variable - variables in XSLT are like constants in other languages; Sometimes the solution requires rethinking by grouping elements and at other times it may require recursion - it all depends...
/Chriztian
Thank you for answering me! Look at this code, I have this structure, what I do is that when they have 3 nodes can be grouped 3 by 3 by tag
<div class="wrapper">
<div class="pages">
<a href="#">Item1</a>
<a href="#">Item2</a>
<a href="#">Item3</a>
</div>
<div class="pages">
<a href="#">Item4</a>
<a href="#">Item5</a>
<a href="#">Item6</a>
</div>
<div class="pages">
<a href="#">Item7</a>
<a href="#">Item8</a>
</div>
</div>
Thank you very much!
Hi again,
Alright - check out my answer on this one for a way to do that.
/Chriztian
Thank you very much Christian, has served me perfectly!
in the select, is "News" a document type or you can use any name you like?
also
You're welcome :-)
In case you're asking - News and NewsArticle are the document type's aliases, so you just change them to reflect what yours are called.
/Chriztian
Right! Right!, Thank You!
is working on a reply...