source: trunk/gli/help/gen-one-html-for-doc.xsl@ 5416

Last change on this file since 5416 was 5416, checked in by mdewsnip, 21 years ago

XSLT code for generating an HTML version of the help text suitable for including in the User's Guide.

  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
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="html"/>
5
6 <xsl:template match="Anchor"/>
7
8 <xsl:template match="Break">
9 <p/>
10 </xsl:template>
11
12 <xsl:template match="Contents">
13 <p/>
14 </xsl:template>
15
16 <xsl:template match="Document">
17 <html>
18 <head>
19 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></meta>
20 <title>The Greenstone Librarian Interface - Help Pages</title>
21 </head>
22 <body bgcolor="#E0F0E0">
23 <xsl:for-each select="Section">
24 <!-- Skip the first section -->
25 <xsl:if test="position() > 1">
26 <xsl:call-template name="processSection">
27 <xsl:with-param name="sectionHead" select="position()"/>
28 </xsl:call-template>
29 </xsl:if>
30 </xsl:for-each>
31 </body>
32 </html>
33 </xsl:template>
34
35 <xsl:template match="ObviousSentence"/>
36
37 <xsl:template match="Reference">
38 <a href="#{@target}"><xsl:apply-templates/></a>
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 <a name="{@name}">
51 <xsl:call-template name="processTitle">
52 <xsl:with-param name="sectionNumber" select="$sectionHead"/>
53 <xsl:with-param name="sectionTitle" select="Title"/>
54 </xsl:call-template>
55 </a>
56 </xsl:if>
57
58 <xsl:apply-templates/>
59
60 <xsl:for-each select="Section">
61 <xsl:call-template name="processSection">
62 <xsl:with-param name="sectionHead" select="concat($sectionHead, '.', position())"/>
63 </xsl:call-template>
64 </xsl:for-each>
65 </xsl:template>
66
67
68 <xsl:template name="processTitle">
69 <xsl:param name="sectionNumber"/>
70 <xsl:param name="sectionTitle"/>
71
72 <xsl:choose>
73 <xsl:when test="contains($sectionNumber, '.')">
74 <h4><i><xsl:value-of select="$sectionTitle"/></i></h4>
75 </xsl:when>
76 <xsl:otherwise>
77 <h4><xsl:value-of select="$sectionTitle"/></h4>
78 </xsl:otherwise>
79 </xsl:choose>
80 </xsl:template>
81
82</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.