directiveindex.xsl revision d3cd98e7839dd1c737c18d42a916ed20860a50e1
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta<?xml version="1.0"?>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta<xsl:stylesheet version="1.0"
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta xmlns="http://www.w3.org/1999/xhtml">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <!-- -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <!-- <directiveindex> -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <!-- Builds the directive index page -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <!-- -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:template match="directiveindex">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <html xml:lang="{$messages/@lang}" lang="{$messages/@lang}">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:call-template name="head"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta<xsl:text>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta</xsl:text> <!-- insert line break -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <body id="directive-index">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:call-template name="top"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:variable name="directives" select="document(sitemap/category[@id='modules']/modulefilelist/modulefile)/modulesynopsis[status!='Obsolete']/directivesynopsis[not(@location)]"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <!-- collect the start letters -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:variable name="start-letters">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:call-template name="directive-startletters">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:with-param name="directives" select="$directives"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </xsl:call-template>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </xsl:variable>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <div id="preamble">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <h1>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:value-of select="title"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </h1>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta<xsl:text>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta</xsl:text> <!-- insert line break -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:apply-templates select="summary" />
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta<xsl:text>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta</xsl:text> <!-- insert line break -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <!-- letter line -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <p class="letters">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:call-template name="letter-bar">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:with-param name="letters" select="$start-letters"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:with-param name="first" select="true()"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </xsl:call-template>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </p>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <!-- /letter line -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta<xsl:text>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta</xsl:text> <!-- insert a line break -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </div> <!-- /preamble -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta<xsl:text>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta</xsl:text> <!-- insert line break -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <div id="directive-list">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <ul>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta<xsl:text>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta</xsl:text> <!-- insert line break -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:call-template name="dindex-of-letter">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:with-param name="letters-todo" select="$start-letters"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:with-param name="directives" select="$directives"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </xsl:call-template>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </ul>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </div> <!-- /directive-list -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta<xsl:text>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta</xsl:text> <!-- insert line break -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:call-template name="bottom"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta<xsl:text>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta</xsl:text> <!-- insert line break -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </body>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </html>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </xsl:template>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <!-- -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <!-- the working horse. builds list items of all -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <!-- directives starting with one letter -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <!-- when done, it calls itself to catch the next letter -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <!-- -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:template name="dindex-of-letter">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:param name="letters-todo"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:param name="directives"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:variable name="letter" select="substring($letters-todo,1,1)"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:for-each select="$directives[$letter=translate(substring(normalize-space(name),1,1),$lowercase,$uppercase)]">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:sort select="name"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <li>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <a href="{/name}.html#{translate(name,$uppercase,$lowercase)}">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:if test="position()=1">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:attribute name="id"><xsl:value-of select="$letter"/></xsl:attribute>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:attribute name="name"><xsl:value-of select="$letter"/></xsl:attribute>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </xsl:if>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:if test="@type = 'section'">&lt;</xsl:if>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:value-of select="name"/>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:if test="@type = 'section'">&gt;</xsl:if>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </a>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </li>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta<xsl:text>
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta</xsl:text> <!-- insert a line break -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta </xsl:for-each> <!-- /directives -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <!-- call next letter, if there is -->
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:if test="string-length($letters-todo) &gt; 1">
9a3e40dc49c1e38bf58e45be5adff37615f3910bJan Cholasta <xsl:call-template name="dindex-of-letter">
<xsl:with-param name="letters-todo" select="substring($letters-todo,2)"/>
<xsl:with-param name="directives" select="$directives"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- /dindex-of-letter -->
</xsl:stylesheet>