I want to get a battery that is accumulated current value plus one. I do not know because as complicated xslt in achieving this. Some alternative? Help please!
I'm not sure what you really trying to do, but the snippet you've posted can be done with a single line using the count() function:
<xsl:value-of select="count($nodes) + 1" />
You almost never need to "just" count in XSLT, because you'll most likely be doing it based on the data available, for which you have a lot of tools available. Problem is, that it's a different way of thinking if you're very used to traditional "procedural" programming...
Counter or accumulator with XSLT For Each
Hello friends I want to do is something like this:
<xsl:variable name="counter" select="1"/>
<xsl:for-each select="$nodes">
<xsl:variable name="counter" select="$counter+1" />
</xsl:for-each>
<xsl:value-of select="$counter" />
I want to get a battery that is accumulated current value plus one. I do not know because as complicated xslt in achieving this. Some alternative? Help please!
Hi umbracocool,
I'm not sure what you really trying to do, but the snippet you've posted can be done with a single line using the count() function:
You almost never need to "just" count in XSLT, because you'll most likely be doing it based on the data available, for which you have a lot of tools available. Problem is, that it's a different way of thinking if you're very used to traditional "procedural" programming...
Let me know if your use case is more specific.
/Chriztian
Hola Chriztian!
I want to get to have a counter of all the news, sports field that has the same soccer. Is this possible?
Hola,
I guess maybe something like this:
/Chriztian
Chriztian thank you very much, in the end I solved using Razor hehe first time I use it and I already did that fast eh! ejej Thank friend!
is working on a reply...