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