view xslt/dirmap.xslt @ 2846:fdf1464e1977

Moved banner to the external file to make partial rollout possible. An idea is to have several banners and show them with different probability specified by split directive in the nginx.conf
author Sergey Budnevitch <sb@waeme.net>
date Tue, 10 May 2022 18:07:27 +0400
parents 4011ba8fdf30
children
line wrap: on
line source

<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) Nginx, Inc.
  -->

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

<xsl:output method="text"/>

<xsl:strip-space elements="*"/>

<xsl:template match="link">
    <xsl:value-of select="@id"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="substring-before(@doc, '.xml')"/>
    <xsl:text>.html#</xsl:text>
    <xsl:value-of select="@id"/>
    <xsl:text>;&#10;</xsl:text>
</xsl:template>

<xsl:template match="link[@id = 'include']">
    <xsl:text>\</xsl:text>
    <xsl:value-of select="@id"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="substring-before(@doc, '.xml')"/>
    <xsl:text>.html#</xsl:text>
    <xsl:value-of select="@id"/>
    <xsl:text>;&#10;</xsl:text>
</xsl:template>

<xsl:template match="link[starts-with(@id, 'var_')]">
    <xsl:text>$</xsl:text>
    <xsl:value-of select="substring-after(@id, 'var_')"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="substring-before(@doc, '.xml')"/>
    <xsl:text>.html#</xsl:text>
    <xsl:value-of select="@id"/>
    <xsl:text>;&#10;</xsl:text>
</xsl:template>

<xsl:template match="links | varlinks">
    <xsl:for-each select="link"><xsl:sort select="@id"/>
        <xsl:if test="count(preceding-sibling::link[@id = current()/@id]) = 0">
            <xsl:apply-templates select="."/>
        </xsl:if>
    </xsl:for-each>
</xsl:template>

</xsl:stylesheet>