Mercurial > hg > nginx-site
view xslt/link.xslt @ 519:e23d718ac865
A link to CHANGES for 1.3 corrected.
author | Maxim Konovalov <maxim@nginx.com> |
---|---|
date | Mon, 21 May 2012 15:15:17 +0000 |
parents | 2a061496979a |
children | eea23daa6e57 |
line wrap: on
line source
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="img"> <img src="{@href}"> <xsl:apply-templates/> </img> </xsl:template> <xsl:template match="link[@url]"> <a href="{@url}"> <xsl:choose> <xsl:when test="count(node()) != 0"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@url"/> </xsl:otherwise> </xsl:choose> </a> </xsl:template> <xsl:template match="link[@id and not(@doc)]"> <a href="#{@id}"> <xsl:choose> <xsl:when test="count(node()) != 0"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@id"/> </xsl:otherwise> </xsl:choose> </a> </xsl:template> <xsl:template match="link[@doc and not(@id)]"> <a href="{substring-before(@doc, '.xml')}.html"> <xsl:choose> <xsl:when test="count(node()) != 0"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:value-of select=" document(@doc)/article/@name | document(@doc)/module/@name"/> </xsl:otherwise> </xsl:choose> </a> </xsl:template> <xsl:template match="link[@id and @doc]"> <a href="{substring-before(@doc, '.xml')}.html#{@id}"> <xsl:choose> <xsl:when test="count(node()) != 0"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@id"/> </xsl:otherwise> </xsl:choose> </a> </xsl:template> <xsl:template match="links"> <xsl:for-each select="link"> <xsl:sort select="@id"/> <a href="{substring-before(@doc, '.xml')}.html#{@id}"> <xsl:value-of select="@id"/> </a> <br/> </xsl:for-each> </xsl:template> </xsl:stylesheet>