moduleindex.xsl revision 4489f0b54d190e8ac29906e1071bbad6c49de17e
3726777f47ac4bba3e21b075905959bbea47e72eerikabele<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <!-- Builds the moduleindex page -->
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <html xml:lang="{$messages/@lang}" lang="{$messages/@lang}">
4489f0b54d190e8ac29906e1071bbad6c49de17end <!-- /preamble -->
4489f0b54d190e8ac29906e1071bbad6c49de17end <xsl:value-of select="$messages/message[@name='corefeatures']"/>
4489f0b54d190e8ac29906e1071bbad6c49de17end <xsl:value-of select="$messages/message[@name='othermodules']"/>
4489f0b54d190e8ac29906e1071bbad6c49de17end <xsl:value-of select="$messages/message[@name='seealso']"/>
3c56725151a46fef84ce376d709b5339da28e10fnd <xsl:value-of select="$messages/message[@name='corefeatures']"/>
4489f0b54d190e8ac29906e1071bbad6c49de17end <!-- put core and mpm_common on top -->
4489f0b54d190e8ac29906e1071bbad6c49de17end <a href="{document(sitemap/category[@id='modules']/modulefilelist/modulefile[starts-with(.,'core.xml')])/modulesynopsis/name}.html">
4489f0b54d190e8ac29906e1071bbad6c49de17end <xsl:value-of select="document(sitemap/category[@id='modules']/modulefilelist/modulefile[starts-with(.,'core.xml')])/modulesynopsis/name"/>
4489f0b54d190e8ac29906e1071bbad6c49de17end <xsl:apply-templates select="document(sitemap/category[@id='modules']/modulefilelist/modulefile[starts-with(.,'core.xml')])/modulesynopsis/description"/>
4489f0b54d190e8ac29906e1071bbad6c49de17end <a href="{document(sitemap/category[@id='modules']/modulefilelist/modulefile[starts-with(.,'mpm_common.xml')])/modulesynopsis/name}.html">
4489f0b54d190e8ac29906e1071bbad6c49de17end <xsl:value-of select="document(sitemap/category[@id='modules']/modulefilelist/modulefile[starts-with(.,'mpm_common.xml')])/modulesynopsis/name"/>
4489f0b54d190e8ac29906e1071bbad6c49de17end <xsl:apply-templates select="document(sitemap/category[@id='modules']/modulefilelist/modulefile[starts-with(.,'mpm_common.xml')])/modulesynopsis/description"/>
4489f0b54d190e8ac29906e1071bbad6c49de17end <!-- /core, mpm_common -->
4489f0b54d190e8ac29906e1071bbad6c49de17end <xsl:variable name="modules" select="document(sitemap/category[@id='modules']/modulefilelist/modulefile)/modulesynopsis[status='MPM' and name != 'mpm_common']"/>
4489f0b54d190e8ac29906e1071bbad6c49de17end <xsl:sort select="substring-before(substring-after($translist, concat('- ', translate(normalize-space(name),$lowercase,$uppercase), ' ')), ' -')"/>
4489f0b54d190e8ac29906e1071bbad6c49de17end <!-- /mpm -->
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <!-- /core section -->
3c56725151a46fef84ce376d709b5339da28e10fnd <xsl:value-of select="$messages/message[@name='othermodules']"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:variable name="modules" select="document(sitemap/category[@id='modules']/modulefilelist/modulefile)/modulesynopsis[status!='MPM' and status!='Core' and status!='Obsolete']"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- collect the start letters -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- letter line -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- /letter line -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:with-param name="letters-todo" select="$start-letters"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- /modules section -->
4489f0b54d190e8ac29906e1071bbad6c49de17end <!-- /page-content -->
3726777f47ac4bba3e21b075905959bbea47e72eerikabele <!-- /moduleindex -->
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 <xsl:variable name="letter" select="substring($letters-todo,1,1)"/>
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 <xsl:attribute name="id"><xsl:value-of select="$letter"/></xsl:attribute>
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:attribute name="name"><xsl:value-of select="$letter"/></xsl:attribute>
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- call next letter, if there is -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:with-param name="letters-todo" select="substring($letters-todo,2)"/>
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- /mindex-of-letter -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- collect start letters of 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 <!-- /module-startletters -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- define module name translations for sorting -->
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 <!-- So, the translation from modulename to sortname -->
e0471b26427a7310358a7a3a835bd146072e4c29nd <!-- can be done with the expression below: -->
e0471b26427a7310358a7a3a835bd146072e4c29nd substring-before(
e0471b26427a7310358a7a3a835bd146072e4c29nd substring-after($translist,
e0471b26427a7310358a7a3a835bd146072e4c29nd concat('- ',
e0471b26427a7310358a7a3a835bd146072e4c29nd translate(modulename,
e0471b26427a7310358a7a3a835bd146072e4c29nd $lowercase,
e0471b26427a7310358a7a3a835bd146072e4c29nd $uppercase),
e0471b26427a7310358a7a3a835bd146072e4c29nd <xsl:variable name="sname" select="translate(normalize-space(name),$lowercase,$uppercase)"/>
4489f0b54d190e8ac29906e1071bbad6c49de17end <!-- /module-translist -->