root/main/trunk/gli/help/gen-one-tex.xsl @ 32138

Revision 11594, 2.5 KB (checked in by kjdon, 14 years ago)

modified for the new XML format that works with the translator

  • Property svn:keywords set to Author Date Id Revision
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
4  <xsl:output method="text" encoding="iso-8859-1"/>
5
6  <xsl:template match="Document-old">
7    <html>
8      <head>
9        <title>The Greenstone Librarian Interface - Help Pages</title>
10      </head>
11      <body bgcolor="#E0F0E0">
12    <xsl:for-each select="Section">
13      <!-- Skip the first section -->
14      <xsl:if test="position() > 1">
15        <xsl:call-template name="processSection">
16          <xsl:with-param name="sectionHead" select="position()"/>
17        </xsl:call-template>
18          </xsl:if>
19    </xsl:for-each>
20      </body>
21    </html>
22  </xsl:template>
23
24  <xsl:template match="Document">
25    % START OF AUTO-GENERATED GLI USER GUIDE
26    <xsl:for-each select="Section">
27      <!-- Skip the first section -->
28      <xsl:if test="position() > 1">
29    <xsl:call-template name="processSection">
30      <xsl:with-param name="sectionHead" select="position()"/>
31    </xsl:call-template>
32      </xsl:if>
33    </xsl:for-each>
34  </xsl:template>
35
36  <xsl:template match="Reference">
37    <xsl:variable name="target" select="@target"/>
38    <xsl:value-of select="/Document//Section[@name=$target]/Title/Text"/>
39  </xsl:template>
40
41  <xsl:template match="Section"/>
42
43  <xsl:template match="Title"/>
44
45
46  <xsl:template name="processSection">
47    <xsl:param name="sectionHead"/>
48
49    <xsl:if test="Title">
50        <xsl:call-template name="processTitle">
51          <xsl:with-param name="sectionNumber" select="$sectionHead"/>
52      <xsl:with-param name="sectionTitle" select="Title"/>
53        </xsl:call-template>
54    </xsl:if>
55
56    <xsl:apply-templates/>
57
58    <xsl:for-each select="Section">
59      <xsl:call-template name="processSection">
60        <xsl:with-param name="sectionHead" select="concat($sectionHead, '.', position())"/>
61      </xsl:call-template>
62    </xsl:for-each>
63  </xsl:template>
64
65
66  <xsl:template name="processTitle">
67    <xsl:param name="sectionNumber"/>
68    <xsl:param name="sectionTitle"/>
69
70    <xsl:choose>
71      <xsl:when test="contains($sectionNumber, '.')">
72        <!--<h4><xsl:value-of select="$sectionTitle"/></h4>-->
73\paragraph{\emph{<xsl:value-of select="$sectionTitle/Text"/>}}<xsl:text>
74    </xsl:text>
75      </xsl:when>
76      <xsl:otherwise>
77        <!--<h3><xsl:value-of select="$sectionTitle"/></h3>-->
78\subsubsection{<xsl:value-of select="$sectionTitle/Text"/>}<xsl:text>
79    </xsl:text>
80      </xsl:otherwise>
81    </xsl:choose>
82  </xsl:template>
83
84  <xsl:template match="Text">
85    <xsl:apply-templates/><xsl:text>
86</xsl:text>
87  </xsl:template>
88
89</xsl:stylesheet>
Note: See TracBrowser for help on using the browser.