source: documentation/trunk/tutorials/processing/xml-to-top-index.xsl@ 25472

Last change on this file since 25472 was 25472, checked in by ak19, 12 years ago
  1. ApplyXSLT takes an additional parameter: the Greenstone major version number, or sets this to 2 if none is provided. This is then passed onto the XSLT files. 2. generate-html.sh/bat will pass any commandline parameters on to ApplyXSLT.java. 3. Simplified the generate-html.bat file with a for loop to avoid code duplication. 4. The MajorVersion element will now be processed by processing/common.xsl: anything in a MajorVersion element whose number matches the Greenstone major version number specified to generate-html.sh/bat (or ApplyXSLT.java) will be output to html, if the MajorVersion number does not match, it won't be output.
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
5 <xsl:param name="gs-major-version"/>
6 <xsl:include href="common.xsl"/>
7
8 <xsl:output method="html"/>
9
10 <xsl:variable name="es">español</xsl:variable>
11 <xsl:variable name="fr">français</xsl:variable>
12 <xsl:variable name="ru">русскОй</xsl:variable>
13 <xsl:template match="TutorialList">
14 <html>
15 <head>
16 <title><xsl:apply-templates select="Title/Text"/>: <xsl:value-of select="Version/@current"/></title>
17 </head>
18 <body>
19 <h2><xsl:apply-templates select="Title/Text"/><xsl:text> </xsl:text><a href="es/index.html"><xsl:value-of select="$es"/></a><xsl:text> </xsl:text><a href="fr/index.html"><xsl:value-of select="$fr"/></a><xsl:text> </xsl:text><a href="ru/index.html"><xsl:value-of select="$ru"/></a></h2>
20 <h3><xsl:apply-templates select="SupplementaryText/Text[@id='current']"/><xsl:text> </xsl:text><xsl:value-of select="Version/@current"/></h3>
21 <p><a href="en/all_tutorials.html"><xsl:apply-templates select="/TutorialList/SupplementaryText/Text[@id='print']"/></a><xsl:text> </xsl:text><a href="es/all_tutorials.html"><xsl:value-of select="$es"/></a><xsl:text> </xsl:text><a href="fr/all_tutorials.html"><xsl:value-of select="$fr"/></a><xsl:text> </xsl:text><a href="ru/all_tutorials.html"><xsl:value-of select="$ru"/></a></p>
22 <xsl:apply-templates select="Comment"/>
23 <dl>
24 <xsl:apply-templates select="Tutorial[not(@hidden)]"/>
25 </dl>
26 </body>
27 </html>
28 </xsl:template>
29
30 <xsl:template match="Tutorial">
31 <dt><a href="en/{@id}.htm"><xsl:apply-templates select="Title/Text"/></a><xsl:text> </xsl:text><a href="es/{@id}.htm"><xsl:value-of select="$es"/></a><xsl:text> </xsl:text><a href="fr/{@id}.htm"><xsl:value-of select="$fr"/></a><xsl:text> </xsl:text><a href="ru/{@id}.htm"><xsl:value-of select="$ru"/></a></dt>
32 <dd><xsl:for-each select="Content/Heading">
33 <xsl:apply-templates/><br/>
34 </xsl:for-each>
35 </dd>
36 </xsl:template>
37
38</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.