Skip to content

Instantly share code, notes, and snippets.

@ctbarber
Created March 27, 2017 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctbarber/47e86b18b93aec97829323dbf339c92f to your computer and use it in GitHub Desktop.
Save ctbarber/47e86b18b93aec97829323dbf339c92f to your computer and use it in GitHub Desktop.
<!-- begin template match for media object snippet -->
<xsl:template match="table[@class='snippet-media-object']" mode="copy">
<xsl:variable name="alignment">
<xsl:choose>
<xsl:when test="lower-case(tbody/tr[3]/td[2]/node()) = 'bottom'">
<xsl:text> bottom</xsl:text>
</xsl:when>
<xsl:when test="lower-case(tbody/tr[3]/td[2]/node()) = 'middle'">
<xsl:text> middle</xsl:text>
</xsl:when>
<xsl:otherwise>
<!-- this sets class name and by default it is not included so no class needed -->
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<div class="media-object stack-for-small">
<div class="media-object-section{$alignment}">
<div>
<xsl:apply-templates select="tbody/tr[5]/td[1]/node()" mode="copy"/>
</div>
</div>
<div class="media-object-section main-section">
<xsl:apply-templates select="tbody/tr[5]/td[2]/node()" mode="copy"/>
</div>
</div>
</xsl:template>
<!-- end template match for media object snippet -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment