Created
February 21, 2013 23:14
-
-
Save bauhouse/5009329 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
<?xml version="1.0" encoding="utf-8" ?> | |
<data> | |
<slider-background> | |
<section id="11" handle="background-images">background images</section> | |
<entry id="18"> | |
<images size="1.46 MB" path="" type="image/jpeg"> | |
<filename>combines.jpg</filename> | |
<meta creation="2013-02-20T15:02:56-07:00" width="2300" height="1533" /> | |
</images> | |
</entry> | |
<entry id="17"> | |
<images size="276 KB" path="" type="image/jpeg"> | |
<filename>cbp0009340_veer.jpg</filename> | |
<meta creation="2013-02-20T15:02:41-07:00" width="640" height="426" /> | |
</images> | |
</entry> | |
<entry id="16"> | |
<images size="261 KB" path="" type="image/jpeg"> | |
<filename>bxp0004862_veer.jpg</filename> | |
<meta creation="2013-02-20T15:02:11-07:00" width="640" height="425" /> | |
</images> | |
</entry> | |
</slider-background> | |
</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
<?xml version="1.0" encoding="utf-8" ?> | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="xml" | |
encoding="UTF-8" | |
indent="yes" /> | |
<xsl:param name="workspace" select="'http://example.com/workspace'" /> | |
<xsl:template match="/data/slider-background"> | |
<script> | |
<xsl:text> | |
<![CDATA[$.backstretch([ | |
]]></xsl:text> | |
<xsl:apply-templates select="entry" mode="backstretch" /> | |
<xsl:text><![CDATA[ | |
], { | |
fade: 750, | |
duration: 4000 | |
});]]> | |
</xsl:text> | |
</script> | |
</xsl:template> | |
<xsl:template match="entry" mode="backstretch"> | |
<xsl:text>"</xsl:text><xsl:value-of select="concat($workspace, '/images/', images/filename)" /><xsl:text>"</xsl:text> | |
<xsl:if test="position() != last()"> | |
<xsl:text>, | |
</xsl:text> | |
</xsl:if> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment