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