Created
June 16, 2012 06:40
-
-
Save nilshoerrmann/2940230 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> | |
<entry id="1"> | |
<title>Title 1</title> | |
<gallery> | |
<item> | |
<image>Image 1</image> | |
</item> | |
</gallery> | |
</entry> | |
<entry id="2"> | |
<title>Title 2</title> | |
<gallery> | |
<item> | |
<image>Image 2a</image> | |
</item> | |
<item> | |
<image>Image 2b</image> | |
</item> | |
</gallery> | |
</entry> | |
</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="entry" /> | |
</xsl:template> | |
<xsl:template match="entry"> | |
<!-- Get title --> | |
<xsl:value-of select="title" /> | |
<!-- Get images --> | |
<xsl:apply-templates select="gallery/item/image" /> | |
</xsl:template> | |
<xsl:template match="item/image"> | |
<xsl:value-of select="." /> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment