Created
September 25, 2017 17:29
-
-
Save jessgusclark/24db3aca156b5f1c8dbbda442a887549 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
<xsl:template match="table[@class='ou-btns_group_style1']"> | |
<xsl:for-each select="tbody/tr"> | |
<xsl:variable name="icon-className" select="td[3]"/> | |
<xsl:variable name="btn-bgcolor"> | |
<xsl:choose> | |
<xsl:when test="contains(td[4]/text(), 'red')">red</xsl:when> | |
<xsl:when test="contains(td[4]/text(), 'black')">black</xsl:when> | |
<!-- default no bg overlay --> | |
<xsl:otherwise>red</xsl:otherwise> | |
</xsl:choose> | |
</xsl:variable> | |
<div class="icon-btn {$btn-bgcolor}"> | |
<a href="{td[2]//a[1]/@href}" class="button"> | |
<xsl:if test="$icon-className != ''"><i class="icon icon-{$icon-className}"></i></xsl:if> | |
<span><xsl:value-of select="td[1]"/></span> | |
</a> | |
</div> | |
</xsl:for-each> | |
</xsl:template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment