source: documentation/trunk/tutorials/processing/xml-to-one-html.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.2 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
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 <xsl:output method="html"/>
8 <!-- set mode to cd/web depending on where the files will end up -->
9 <xsl:variable name="mode">wiki</xsl:variable>
10
11 <xsl:template match="TutorialList">
12 <html>
13 <head>
14 <title><xsl:apply-templates select="Title/Text"/></title>
15 </head>
16 <body>
17 <h2><xsl:apply-templates select="Title/Text"/></h2>
18 <h3><xsl:apply-templates select="SupplementaryText/Text[@id='current']"/><xsl:text> </xsl:text><xsl:value-of select="Version/@current"/></h3>
19 <xsl:apply-templates select="Comment"/>
20 <a name="index"/>
21 <dl>
22 <xsl:apply-templates select="Tutorial[not(@hidden)]" mode="index"/>
23 </dl>
24 <xsl:apply-templates select="Tutorial[not(@hidden)]"/>
25
26 <hr/><div style="text-align:center;"><xsl:apply-templates select="SupplementaryText/Text[@id='copyright']"/></div>
27 </body>
28 </html>
29 </xsl:template>
30
31 <xsl:template match="Tutorial" mode="index">
32 <dt><a href="#{@id}"><xsl:apply-templates select="Title/Text"/></a></dt>
33 <dd><xsl:for-each select="Content/Heading">
34 <xsl:apply-templates/><br/>
35 </xsl:for-each>
36 </dd>
37 </xsl:template>
38
39 <xsl:template match="Tutorial">
40 <div style="page-break-before: always;">
41 <a name="{@id}"/>
42 <h2><xsl:apply-templates select="Title/Text"/></h2>
43 <div style="text-align:right;">
44 <xsl:call-template name="supplementary">
45 <xsl:with-param name="mode" select="$mode"/>
46 </xsl:call-template>
47 </div>
48 <xsl:apply-templates select="Content/*"/>
49 <br/>
50 <br/>
51 </div>
52 </xsl:template>
53
54 <xsl:template name="supplementary">
55 <xsl:param name="mode">web</xsl:param>
56 <!--
57 <xsl:call-template name="IndexLink">
58 <xsl:with-param name="mode">combined</xsl:with-param>
59 </xsl:call-template>
60 -->
61 <xsl:apply-templates select="Prerequisite" mode="combined"/>
62 <xsl:if test="SampleFiles">
63 <xsl:call-template name="SampleFiles">
64 <xsl:with-param name="mode"><xsl:value-of select="$mode"/></xsl:with-param>
65 </xsl:call-template>
66 </xsl:if>
67 <xsl:apply-templates select="Version"/>
68 </xsl:template>
69
70</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.