Project

Profile

Help

Bug #3027 » cover-test.xsl

XSL test file - Ben Guillon, 2016-11-13 19:53

 
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>

<!--############################################################################
XSLT Test Stylesheet to check coverage
############################################################################ -->
<xsl:param name="texlive.version" select="'2008'"/>

<xsl:template match="u">
<xsl:param name="what" select="'full'"/>
<xsl:param name="when" select="'now'"/>
<xsl:variable name="url" select="@url"/>
<xsl:variable name="role" select="@role"/>
<!-- Another one -->
<xsl:variable name="position" select="@align"/>

<xsl:choose>
<xsl:when test="contains($url, 'http:')">
<xsl:variable name="shorturl" select="substring-after($url, 'http:/')"/>
<xsl:variable name="protocol" select="'HTTP'"/>
<external where="{$shorturl}" protocol="{$protocol}"/>
</xsl:when>
<xsl:when test="$role='xref'">
<xsl:variable name="section" select="substring-before($url, ':')"/>
<xsl:variable name="num" select="substring-after($url, ':')"/>
<internal header="{$section}" number="{$num}"/>
</xsl:when>
<xsl:otherwise>
<internal linkto="{$url}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="p[child::u]">
<links>
<xsl:apply-templates/>
</links>
</xsl:template>

</xsl:stylesheet>
(4-4/4)