Example: The MonoDoc Stylesheet:
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template name="string-replace" > <xsl:param name="string"/> <xsl:param name="from"/> <xsl:choose> <xsl:when test="contains($string,'(')"> <xsl:call-template name="string-replace"> <xsl:with-param name="string" select="substring-before($string,'(')"/> <xsl:with-param name="from" select="$from"/> </xsl:call-template> </xsl:when> <xsl:when test="contains($string,$from)"> <xsl:call-template name="string-replace"> <xsl:with-param name="string" select="substring-after($string,$from)"/> <xsl:with-param name="from" select="$from"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$string"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="string-addsignature"> <xsl:param name="string"/> <xsl:choose> <xsl:when test="contains($string,'(')"> (<xsl:value-of select="substring-after($string,'(')"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template match="document"> <html> <head><title>Prueba de mono</title></head> <xsl:apply-templates/> </html> </xsl:template> <xsl:template match="para"> <p> <xsl:apply-templates/> </p> </xsl:template> <xsl:template match="paramref"> <i><xsl:value-of select="@name"/> <xsl:apply-templates/> </i> </xsl:template> <xsl:template match="example"> <pre> <xsl:apply-templates/> </pre> </xsl:template> <xsl:template match="see"> <xsl:choose> <xsl:when test="string-length(@langword)=0"> <a href="{@cref}"> <xsl:call-template name="string-replace"> <xsl:with-param name="string" select="@cref"/> <xsl:with-param name="from">.</xsl:with-param> </xsl:call-template> <xsl:call-template name="string-addsignature"> <xsl:with-param name="string" select="@cref"/> </xsl:call-template> <xsl:apply-templates/> </a> </xsl:when> <xsl:otherwise> <a href="{@langword}"><xsl:value-of select="@langword"/></a> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet>