Created
May 27, 2011 13:35
-
-
Save kanduvisla/995258 to your computer and use it in GitHub Desktop.
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
<!-- Addition to the ninja XSL utility --> | |
<xsl:template match="a[@target='_blank']" mode="html"> | |
<a> | |
<xsl:attribute name="rel">external</xsl:attribute> | |
<xsl:apply-templates select="* | @*[not(name()='target')] | text()" mode="html"/> | |
</a> | |
</xsl:template> | |
<!-- Provide an alt-tag for images with no alt-tag: --> | |
<xsl:template match="img[not(@alt) or @alt = '']" mode="html"> | |
<xsl:element name="{name()}"> | |
<xsl:apply-templates select="* | @* | text()" mode="html"/> | |
<xsl:attribute name="alt"> | |
<xsl:value-of select="concat('Image of ', $website-name)" /> | |
</xsl:attribute> | |
</xsl:element> | |
</xsl:template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment