Created
May 24, 2012 13:35
-
-
Save iwyg/2781581 to your computer and use it in GitHub Desktop.
This file contains 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> | |
<pants> | |
<entry> | |
<content>Test 1</content> | |
</entry> | |
<entry> | |
<content>Test 2</content> | |
</entry> | |
<entry> | |
<content>Test 3</content> | |
</entry> | |
<entry> | |
<content>Test 4</content> | |
</entry> | |
<entry> | |
<content>Test 5</content> | |
</entry> | |
<entry> | |
<content>Test 6</content> | |
</entry> | |
<entry> | |
<content>Test 7</content> | |
</entry> | |
<entry> | |
<content>Test 8</content> | |
</entry> | |
<entry> | |
<content>Test 9</content> | |
</entry> | |
<entry> | |
<content>Test 10</content> | |
</entry> | |
<entry> | |
<content>Test 11</content> | |
</entry> | |
<entry> | |
<content>Test 12</content> | |
</entry> | |
<entry> | |
<content>Test 13</content> | |
</entry> | |
<entry> | |
<content>Test 14</content> | |
</entry> | |
</pants> | |
</data> |
This file contains 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:apply-templates select="pants/entry[position() = 1 or position() mod 6 = 1]" mode="row"/> | |
</xsl:template> | |
<xsl:template match="pants/entry" mode="col"> | |
<li><xsl:value-of select="."/></li> | |
</xsl:template> | |
<xsl:template match="pants/entry" mode="row"> | |
<aside><ul><xsl:apply-templates select=". | following-sibling::entry[position() < 6]" mode="col"/></ul></aside> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment