Skip to content

Instantly share code, notes, and snippets.

@peterdietz
Created April 8, 2011 17:58
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 peterdietz/910388 to your computer and use it in GitHub Desktop.
Save peterdietz/910388 to your computer and use it in GitHub Desktop.
<xsl:template match="dri:xref">
<a>
<xsl:if test="@target">
<xsl:attribute name="href"><xsl:value-of select="@target"/></xsl:attribute>
</xsl:if>
<xsl:if test="@rend">
<xsl:choose>
<xsl:when test="@rend='_blank'">
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="class"><xsl:value-of select="@rend"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="@n">
<xsl:attribute name="name"><xsl:value-of select="@n"/></xsl:attribute>
</xsl:if>
<xsl:apply-templates />
</a>
</xsl:template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment