Skip to content

Instantly share code, notes, and snippets.

/master.xml
Created Nov 6, 2012

Embed
What would you like to do?
<data>
<plant-of-the-month>
<section id="20" handle="plant-of-the-month">plant of the month</section>
<entry id="99">
<genus handle="fgfg">fgfg</genus>
<common-name handle="ggfdgb">ggfdgb</common-name>
<latin-name handle="dghgh">dghgh</latin-name>
<flowers-jan>Yes</flowers-jan>
<flowers-feb>Yes</flowers-feb>
<flowers-mar>No</flowers-mar>
<!--etc-->
</entry>
</plant-of-the-month>
</data>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" />
<xsl:template match="data/plant-of-the-month/entry">
<h3>Plant of the Month</h3>
<!-- flowers -->
<!--jan-->
<xsl:choose>
<xsl:when test="flowers-jan='Yes'"><a class="btn btn-success" href="{$root}/plants/jan/"> Jan </a></xsl:when>
<xsl:otherwise><a class="btn" href="{$root}/plants/jan/"> Jan </a></xsl:otherwise>
</xsl:choose>
<!--feb-->
<xsl:choose>
<xsl:when test="flowers-feb='Yes'"><a class="btn btn-success" href="{$root}/plants/feb/"> Feb </a></xsl:when>
<xsl:otherwise><a class="btn" href="{$root}/plants/feb/"> Feb </a></xsl:otherwise>
</xsl:choose>
<!--march-->
<xsl:choose>
<xsl:when test="flowers-mar='Yes'"><a class="btn btn-success" href="{$root}/plants/mar/"> Mar </a></xsl:when>
<xsl:otherwise><a class="btn" href="{$root}/plants/mar/"> Mar </a></xsl:otherwise>
</xsl:choose>
<!--etc-->
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.