CSTUG

Stylesheet

<xsl:stylesheet extension-element-prefixes="saxon" version="2.0">

<!-- This file contains a template for creating a link to the original XML or XSL file. It requires Saxon v.8. It should be a no-op in other XSLT processors but may cause fatal error in processors that do not handle XSTL2 + XPath2. -->
<xsl:variable name="basename"> <xsl:if test="function-available('saxon:system-id')"> <xsl:analyze-string select="saxon:system-id()" regex="[^/]+$"> <xsl:matching-substring> <xsl:choose> <xsl:when test="contains(., '%7e')"> <xsl:value-of select="concat(substring-before(.,'%7e'), '~', substring-after(.,'%7e'))"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> </xsl:choose> </xsl:matching-substring> </xsl:analyze-string> </xsl:if> </xsl:variable> <xsl:template name="xmlink"> <xsl:if test="$basename != ''"> <a title="{$basename}" href="{$basename}"> <xsl:value-of select="$basename"/> </a> </xsl:if> </xsl:template> <xsl:variable name="add-ext">.html</xsl:variable> </xsl:stylesheet>

xmlink2.xsl