Skip to content

Instantly share code, notes, and snippets.

@ctbarber
Created March 27, 2017 19:13
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/96351f903026d45cefe4fb8bcbaf602f to your computer and use it in GitHub Desktop.
Save ctbarber/96351f903026d45cefe4fb8bcbaf602f to your computer and use it in GitHub Desktop.
<!-- begin template match for video snippet -->
<xsl:template match="table[@class='snippet-flex-video']" mode="copy">
<xsl:variable name="widescreen">
<xsl:choose>
<xsl:when test="lower-case(tbody/tr[2]/td[2]/node()) = 'yes'">
<xsl:text> widescreen</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>
<xsl:variable name="vimeo">
<xsl:choose>
<xsl:when test="lower-case(tbody/tr[3]/td[2]/node()) = 'yes'">
<xsl:text> vimeo</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="flex-video{$widescreen}{$vimeo}">
<xsl:apply-templates select="tbody/tr[4]/td[2]/node()" mode="copy"/>
</div>
</xsl:template>
<!-- end template match for video snippet -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment