Last active
August 29, 2015 14:12
-
-
Save andrewminton/8a962b641bc95ea15387 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<data> | |
<entry> | |
<p>Project 1</p> | |
<content>This is some content</content> | |
</entry> | |
<entry> | |
<p>Project 2</p> | |
<content>This is some content</content> | |
</entry> | |
<entry> | |
<p>Project 3</p> | |
<content>This is some content</content> | |
</entry> | |
<entry> | |
<p>Project 4</p> | |
<content>This is some content</content> | |
</entry> | |
<entry> | |
<p>Project 5</p> | |
<content>This is some content</content> | |
</entry> | |
<entry> | |
<p>Project 6</p> | |
<content>This is some content</content> | |
</entry> | |
<entry> | |
<p>Project 7</p> | |
<content>This is some content</content> | |
</entry> | |
<entry> | |
<p>Project 8</p> | |
<content>This is some content</content> | |
</entry> | |
</data> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
<xsl:output method="xml" indent="yes" /> | |
<xsl:template match="data"> | |
<xsl:for-each select="entry"> | |
<xsl:variable name="pos" select="position()"/> | |
<xsl:if test="position() mod 4 = 1"> | |
<div class="panel"> | |
<div class="wrapper"> | |
<xsl:for-each select="//entry[position() >= $pos and position() <= $pos + 4]"> | |
<p id="{$pos}"><xsl:value-of select="p"/></p> | |
</xsl:for-each> | |
</div> | |
</div> | |
</xsl:if> | |
</xsl:for-each> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment