Created — forked from snigel1/master.xml

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View master.xml
1 2 3 4 5 6 7 8 9 10 11 12
<data>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
<entry>Text</entry>
</data>
View master.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
<xsl:output method="xml" indent="yes" />
 
<xsl:template match="/">
<h2>What i get:</h2>
<xsl:for-each select="data/entry">
<xsl:choose>
<xsl:if test="position() mod 4 = 0">
every 4th!
</xsl:if>
<xsl:otherwise>
normal
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<h2>What i need:</h2>
<div>Text</div>
<div>Text</div>
<div>Text</div>
<div class="last">Text</div>
<div>Text</div>
<div>Text</div>
<div>Text</div>
<div class="last">Text</div>
<div>Text</div>
<div>Text</div>
</xsl:template>
 
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.