Created
November 21, 2011 15:07
-
-
Save davidhund/1382894 to your computer and use it in GitHub Desktop.
Order unorderable nodes :)
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> | |
<random-cta-buttons> | |
<section id="5" handle="cta-buttons">CTA Buttons</section> | |
<entry id="5"> | |
<internal-page-link> | |
<page handle="contact" id="50">Contact</page> | |
</internal-page-link> | |
<label handle="wat-kan-ik-doen">Wat kan ik doen?</label> | |
<special-type> | |
<item handle="help">help</item> | |
</special-type> | |
</entry> | |
<entry id="6"> | |
<internal-page-link> | |
<page handle="over-ecm" id="2">Over ECM</page> | |
</internal-page-link> | |
<label handle="over-ecm">Over ECM</label> | |
<special-type> | |
<item handle="info">info</item> | |
</special-type> | |
</entry> | |
<entry id="313"> | |
<internal-page-link> | |
<page handle="nieuws" id="6">Nieuws en Events</page> | |
</internal-page-link> | |
<label handle="laatste-nieuws-and-events">Laatste Nieuws & Events</label> | |
<special-type> | |
<item handle="info">info</item> | |
</special-type> | |
</entry> | |
</random-cta-buttons> | |
</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
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:template match="/data/random-buttons/item"> | |
<xsl:variable name="cta-href"> | |
<xsl:value-of select="'/'"/> | |
<xsl:call-template name="recursive-permalink"> | |
<xsl:with-param name="page-id" select="current()/internal-page-link/page/@id"/> | |
</xsl:call-template> | |
</xsl:variable> | |
<li class="{special-type/item/@handle}"> | |
<a href="{$cta-href}"> | |
<xsl:if test="generic-link != ''"> | |
<xsl:attribute name="href"><xsl:value-of select="generic-link"/></xsl:attribute> | |
</xsl:if> | |
<xsl:if test="title-on-hover"><xsl:attribute name="title"><xsl:value-of select="title-on-hover"/></xsl:attribute></xsl:if> | |
<xsl:value-of select="label"/> | |
</a> | |
</li> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment