How to write "After every 3"?
This is an open discussion with 4 replies, filed under General.
Search
Take a look at this thread: http://getsymphony.com/community/discussions/25877/
If your using a Loop to Output your data, this would work:
<xsl:for-each select="/data/item"> <!-- Item Output --> <xsl:if test="position() mod 3 = 0"> <!-- Some HTML here --> </xsl:if> </xsl:for-each>
(Only Tested it in Xselerator)
@michael-e: Thanks for the link!
@zippo, that worked well, as I was using a for-each, I opted for that. I must start using the apply-template technique instead mind!
If your using a Loop to Output your data, this would work:
It will also only work if you don’t have to wrap your groups of three inside another element.
Create an account or sign in to comment.
I have a for-each loop on one of my pages, but I’m needing to inject some HTML code after every 3 items in the loop, how could I go about this in XSL?
So I should end up with something like this: