moduleindex.xsl revision d3cd98e7839dd1c737c18d42a916ed20860a50e1
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 <!-- Builds the moduleindex page -->
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <!-- -->
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <xsl:template match="moduleindex">
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <html xml:lang="{$messages/@lang}" lang="{$messages/@lang}">
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <xsl:call-template name="head"/>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele
d3cd98e7839dd1c737c18d42a916ed20860a50e1nd<xsl:text>
d3cd98e7839dd1c737c18d42a916ed20860a50e1nd</xsl:text> <!-- insert line break -->
d3cd98e7839dd1c737c18d42a916ed20860a50e1nd
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <body id="module-index">
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <xsl:call-template name="top"/>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <div id="preamble">
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <h1>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <xsl:value-of select="title"/>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele </h1>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele
d3cd98e7839dd1c737c18d42a916ed20860a50e1nd<xsl:text>
d3cd98e7839dd1c737c18d42a916ed20860a50e1nd</xsl:text> <!-- insert line break -->
d3cd98e7839dd1c737c18d42a916ed20860a50e1nd
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <xsl:apply-templates select="summary" />
3726777f47ac4bba3e21b075905959bbea47e72eerikabele </div>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd<xsl:text>
e0471b26427a7310358a7a3a835bd146072e4c29nd</xsl:text> <!-- insert line break -->
3c56725151a46fef84ce376d709b5339da28e10fnd
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <xsl:call-template name="toplink"/>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele
e0471b26427a7310358a7a3a835bd146072e4c29nd<xsl:text>
e0471b26427a7310358a7a3a835bd146072e4c29nd</xsl:text> <!-- insert line break -->
e0471b26427a7310358a7a3a835bd146072e4c29nd
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <div class="section">
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <h2>
3c56725151a46fef84ce376d709b5339da28e10fnd <a name="core" id="core">
3c56725151a46fef84ce376d709b5339da28e10fnd <xsl:value-of select="$messages/message[@name='corefeatures']"/>
3c56725151a46fef84ce376d709b5339da28e10fnd </a>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele </h2>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele
e0471b26427a7310358a7a3a835bd146072e4c29nd<xsl:text>
e0471b26427a7310358a7a3a835bd146072e4c29nd</xsl:text> <!-- insert line break -->
e0471b26427a7310358a7a3a835bd146072e4c29nd
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <dl>
3c56725151a46fef84ce376d709b5339da28e10fnd
3c56725151a46fef84ce376d709b5339da28e10fnd<xsl:text>
3c56725151a46fef84ce376d709b5339da28e10fnd</xsl:text> <!-- insert line break -->
3c56725151a46fef84ce376d709b5339da28e10fnd
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:for-each select="document(sitemap/category[@id='modules']/modulefilelist/modulefile)/modulesynopsis[status='MPM' or status='Core']">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:sort select="name"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <dt>
e0471b26427a7310358a7a3a835bd146072e4c29nd <a href="{name}.html">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:value-of select="name"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd </a>
e0471b26427a7310358a7a3a835bd146072e4c29nd </dt>
e0471b26427a7310358a7a3a835bd146072e4c29nd <dd>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:apply-templates select="description"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd </dd>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd<xsl:text>
e0471b26427a7310358a7a3a835bd146072e4c29nd</xsl:text> <!-- insert line break -->
e0471b26427a7310358a7a3a835bd146072e4c29nd
3726777f47ac4bba3e21b075905959bbea47e72eerikabele </xsl:for-each>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele </dl>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele </div>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <!-- /core section -->
3726777f47ac4bba3e21b075905959bbea47e72eerikabele
e0471b26427a7310358a7a3a835bd146072e4c29nd<xsl:text>
e0471b26427a7310358a7a3a835bd146072e4c29nd</xsl:text> <!-- insert line break -->
e0471b26427a7310358a7a3a835bd146072e4c29nd
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <xsl:call-template name="toplink"/>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele
e0471b26427a7310358a7a3a835bd146072e4c29nd<xsl:text>
e0471b26427a7310358a7a3a835bd146072e4c29nd</xsl:text> <!-- insert line break -->
e0471b26427a7310358a7a3a835bd146072e4c29nd
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <div class="section">
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <h2>
3c56725151a46fef84ce376d709b5339da28e10fnd <a name="other" id="other">
3c56725151a46fef84ce376d709b5339da28e10fnd <xsl:value-of select="$messages/message[@name='othermodules']"/>
3c56725151a46fef84ce376d709b5339da28e10fnd </a>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele </h2>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele
3c56725151a46fef84ce376d709b5339da28e10fnd<xsl:text>
3c56725151a46fef84ce376d709b5339da28e10fnd</xsl:text> <!-- insert line break -->
3c56725151a46fef84ce376d709b5339da28e10fnd
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:variable name="modules" select="document(sitemap/category[@id='modules']/modulefilelist/modulefile)/modulesynopsis[status!='MPM' and status!='Core' and status!='Obsolete']"/>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- collect the start letters -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:variable name="start-letters">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:call-template name="module-startletters">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:with-param name="modules" select="$modules"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:call-template>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:variable>
3c56725151a46fef84ce376d709b5339da28e10fnd
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- letter line -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <p class="letters">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:call-template name="letter-bar">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:with-param name="letters" select="$start-letters"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:with-param name="first" select="true()"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:call-template>
e0471b26427a7310358a7a3a835bd146072e4c29nd </p>
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- /letter line -->
3c56725151a46fef84ce376d709b5339da28e10fnd
3c56725151a46fef84ce376d709b5339da28e10fnd<xsl:text>
e0471b26427a7310358a7a3a835bd146072e4c29nd</xsl:text> <!-- insert line break -->
3c56725151a46fef84ce376d709b5339da28e10fnd
e0471b26427a7310358a7a3a835bd146072e4c29nd <dl>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:call-template name="mindex-of-letter">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:with-param name="letters-todo" select="$start-letters"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:with-param name="modules" select="$modules"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:call-template>
3c56725151a46fef84ce376d709b5339da28e10fnd </dl>
3c56725151a46fef84ce376d709b5339da28e10fnd </div>
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- /modules section -->
3c56725151a46fef84ce376d709b5339da28e10fnd
e0471b26427a7310358a7a3a835bd146072e4c29nd<xsl:text>
e0471b26427a7310358a7a3a835bd146072e4c29nd</xsl:text> <!-- insert line break -->
3c56725151a46fef84ce376d709b5339da28e10fnd
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <xsl:call-template name="bottom"/>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele
e0471b26427a7310358a7a3a835bd146072e4c29nd<xsl:text>
e0471b26427a7310358a7a3a835bd146072e4c29nd</xsl:text> <!-- insert line break -->
e0471b26427a7310358a7a3a835bd146072e4c29nd
3726777f47ac4bba3e21b075905959bbea47e72eerikabele </body>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele </html>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele </xsl:template>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <!-- /moduleindex -->
3726777f47ac4bba3e21b075905959bbea47e72eerikabele
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- the working horse. builds list items of all -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- modules starting with one letter -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- when done, it calls itself to catch the next letter -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:template name="mindex-of-letter">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:param name="letters-todo"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:param name="modules"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:variable name="letter" select="substring($letters-todo,1,1)"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:variable name="translist">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:call-template name="module-trans">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:with-param name="modules" select="$modules"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:call-template>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:variable>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:for-each select="$modules[$letter=substring(substring-before(substring-after($translist, concat('- ', translate(normalize-space(name),$lowercase,$uppercase), ' ')), ' -'), 1, 1)]">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:sort select="substring-before(substring-after($translist, concat('- ', translate(normalize-space(name),$lowercase,$uppercase), ' ')), ' -')"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <dt>
e0471b26427a7310358a7a3a835bd146072e4c29nd <a href="{name}.html">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:if test="position()=1">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:attribute name="id"><xsl:value-of select="$letter"/></xsl:attribute>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:attribute name="name"><xsl:value-of select="$letter"/></xsl:attribute>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:if>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:value-of select="name"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd </a>
e0471b26427a7310358a7a3a835bd146072e4c29nd </dt>
e0471b26427a7310358a7a3a835bd146072e4c29nd <dd>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:apply-templates select="description"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd </dd>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd<xsl:text>
e0471b26427a7310358a7a3a835bd146072e4c29nd</xsl:text> <!-- insert a line break -->
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:for-each> <!-- /directives -->
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- call next letter, if there is -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:if test="string-length($letters-todo) &gt; 1">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:call-template name="mindex-of-letter">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:with-param name="letters-todo" select="substring($letters-todo,2)"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:with-param name="modules" select="$modules"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:call-template>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:if>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:template>
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- /mindex-of-letter -->
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- collect start letters of modules -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:template name="module-startletters">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:param name="modules"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:variable name="translist">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:call-template name="module-trans">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:with-param name="modules" select="$modules"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:call-template>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:variable>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:call-template name="_squeeze-letters">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:with-param name="lastletter" select="''"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:with-param name="letters">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:for-each select="$modules">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:sort select="substring-before(substring-after($translist, concat('- ', translate(normalize-space(name),$lowercase,$uppercase), ' ')), ' -')"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:value-of select="substring(substring-before(substring-after($translist, concat('- ', translate(normalize-space(name),$lowercase,$uppercase), ' ')), ' -'), 1, 1)"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:for-each>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:with-param>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:call-template>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:template>
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- /module-startletters -->
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- define module name translations for sorting -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- it's a kind of a hack... -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- we build a string that contains the following data: -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- "- modulename sortname - modulename sortname - ..." -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- (with all data in uppercase) -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- So, the translation from modulename to sortname -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- can be done with the expression below: -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!--
e0471b26427a7310358a7a3a835bd146072e4c29nd substring-before(
e0471b26427a7310358a7a3a835bd146072e4c29nd substring-after($translist,
e0471b26427a7310358a7a3a835bd146072e4c29nd concat('- ',
e0471b26427a7310358a7a3a835bd146072e4c29nd translate(modulename,
e0471b26427a7310358a7a3a835bd146072e4c29nd $lowercase,
e0471b26427a7310358a7a3a835bd146072e4c29nd $uppercase),
e0471b26427a7310358a7a3a835bd146072e4c29nd ' ')
e0471b26427a7310358a7a3a835bd146072e4c29nd ),
e0471b26427a7310358a7a3a835bd146072e4c29nd ' -')
e0471b26427a7310358a7a3a835bd146072e4c29nd -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:template name="module-trans">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:param name="modules"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:text>-</xsl:text>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:for-each select="$modules">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:variable name="sname" select="translate(normalize-space(name),$lowercase,$uppercase)"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:text> </xsl:text>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:value-of select="$sname"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:text> </xsl:text>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:choose>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:when test="starts-with($sname,'MOD_') or starts-with($sname,'MPM_')">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:value-of select="substring($sname, 5)"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:when>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:when test="starts-with($sname,'MPMT_')">
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:value-of select="substring($sname, 6)"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:when>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:otherwise>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:value-of select="$sname"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:otherwise>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:choose>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:text> -</xsl:text>
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:for-each>
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:template>
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- /module-trans -->
e0471b26427a7310358a7a3a835bd146072e4c29nd
e0471b26427a7310358a7a3a835bd146072e4c29nd </xsl:stylesheet>