Skip to content

Instantly share code, notes, and snippets.

@DavidOliver
Created April 4, 2013 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DavidOliver/5312374 to your computer and use it in GitHub Desktop.
Save DavidOliver/5312374 to your computer and use it in GitHub Desktop.
<data>
<params>
<workspace>http://192.168.1.4/symphony/workspace</workspace>
</params>
<images>
<section id="4" handle="images">Images</section>
<entry id="42">
<image-title handle="preview">Preview</image-title>
<image size="50 KB" path="/images/projektai" type="image/jpeg">
<filename>beute-beispielfoto-gruppe.jpg</filename>
<meta creation="2013-04-04T09:47:36+03:00" width="620" height="465" />
</image>
<image-select>
<item id="39" handle="projektas-2" section-handle="projektai" section-name="Projektai">Projektas-2</item>
</image-select>
<image-order>1</image-order>
</entry>
<entry id="40">
<image-title handle="main">Main</image-title>
<image size="106 KB" path="/images/projektai" type="image/jpeg">
<filename>belgium.jpg</filename>
<meta creation="2013-04-04T09:46:48+03:00" width="680" height="510" />
</image>
<image-select>
<item id="39" handle="projektas-2" section-handle="projektai" section-name="Projektai">Projektas-2</item>
</image-select>
<image-order>2</image-order>
</entry>
<entry id="37">
<image-title handle="projektas-1">Projektas-1</image-title>
<image size="8 KB" path="/images/projektai" type="image/jpeg">
<filename>zarmenas-avt_1.jpg</filename>
<meta creation="2013-04-04T09:43:07+03:00" width="120" height="120" />
</image>
<image-select>
<item id="3" handle="projektas-1" section-handle="projektai" section-name="Projektai">Projektas-1</item>
</image-select>
<image-order>1</image-order>
</entry>
<entry id="14">
<image-title handle="projektas-1">Projektas-1</image-title>
<image size="20 KB" path="/images/projektai" type="image/jpeg">
<filename>galvamogeliukas-2_resize.jpg</filename>
<meta creation="2013-04-04T09:42:30+03:00" width="64" height="61" />
</image>
<image-select>
<item id="3" handle="projektas-1" section-handle="projektai" section-name="Projektai">Projektas-1</item>
</image-select>
<image-order>2</image-order>
</entry>
</images>
<projektas>
<section id="2" handle="projektai">Projektai</section>
<entry id="39" images="2">
<projektas-title handle="projektas-2">Projektas-2</projektas-title>
<projektas-info mode="formatted"><p>Projektas-2 informacija</p>
<p>info
info
info
info</p>
</projektas-info>
</entry>
<entry id="3" images="2">
<projektas-title handle="projektas-1">Projektas-1</projektas-title>
<projektas-info mode="formatted"><p>Projektas-1 informacija</p>
</projektas-info>
</entry>
</projektas>
</data>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="image-by-project-id" match="/data/images/entry" use="image-select/item/@id"/>
<xsl:template match="/data">
<xsl:apply-templates select="projektas/entry"/>
</xsl:template>
<xsl:template match="/data/projektas/entry">
<article>
<h2><xsl:value-of select="projektas-title"/></h2>
<xsl:copy-of select="projektas-info/*"/>
<xsl:for-each select="key('image-by-project-id', @id)">
<p><xsl:value-of select="image-title"/>:</p>
<img src="{/data/params/workspace}{image/@path}/{image/filename}" />
</xsl:for-each>
</article>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment