Mercurial > hg > nginx-site
view xslt/link.xslt @ 488:78ab3599e1fe
Added CVE-2011-4315 (buffer overflow in resolver).
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 13 Apr 2012 12:28:23 +0000 |
parents | aa00b4d476c8 |
children | 2a061496979a |
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:apply-templates/> </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>