Last active
August 29, 2015 14:12
-
-
Save andrewminton/0cee18a46609a0ec80ef 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="/"> | |
<xsl:apply-templates select="data" mode="group"/> | |
</xsl:template> | |
<xsl:template match="data" mode="group"> | |
<xsl:for-each select="entry"> | |
<xsl:variable name="pos" select="position()"/> | |
<xsl:apply-templates select="." mode="item"/> | |
</xsl:for-each> | |
</xsl:template> | |
<xsl:template match="entry" mode="item"> | |
<div class="item"> | |
<h1><xsl:value-of select="p"/></h1> | |
<xsl:copy-of select="content"/> | |
</div> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment