1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
This file is part of db2mm, see db2mm.xslt for details
7
Copyright 2005, 2006 by Jeff Schering (jeffschering@gmail.com)
8
Copyright 2006 by Mikko Virkkilä (mvirkkil@cc.hut.fi)
10
This program is free software; you can redistribute it and/or modify
11
it under the terms of the GNU General Public License as published by
12
the Free Software Foundation; either version 2 of the License, or
13
(at your option) any later version.
15
This program is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License for more details.
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32
<xsl:template match="variablelist">
33
<xsl:apply-templates select="varlistentry"/>
34
<xsl:value-of select="$newline" />
37
<xsl:template match="varlistentry">
38
<xsl:apply-templates />
41
<xsl:template match="varlistentry/term">
42
<xsl:call-template name="listdepth" /><xsl:text>. '''</xsl:text>
43
<xsl:value-of select="text()"/>
44
<xsl:text>'''</xsl:text>
45
<xsl:value-of select="$newline" />
48
<xsl:template match="glosslist">
49
<xsl:apply-templates />
50
<xsl:value-of select="$newline"/>
53
<xsl:template match="glossterm">
54
<xsl:value-of select="."/>
58
<xsl:template match="glosslist/glossentry">
59
<xsl:text> </xsl:text>
60
<xsl:apply-templates select="glossterm" /><xsl:text>::</xsl:text>
62
<xsl:variable name="count">
63
<xsl:value-of select="count(glossdef/para)" />
66
<xsl:for-each select="glossdef/para">
67
<xsl:if test="$count>1">
68
<xsl:value-of select="$newline" />
69
<xsl:text> ::</xsl:text>
72
<xsl:text> </xsl:text>
73
<xsl:variable name="var">
74
<xsl:apply-templates/>
76
<xsl:value-of select="normalize-space($var)"/>
79
<xsl:value-of select="$newline" />
80
<xsl:value-of select="$newline" />
85
<xsl:template match="orderedlist|itemizedlist|procedure|substeps">
86
<xsl:apply-templates select="itemizedlist|orderedlist|listitem|procedure|step|substeps"/>
88
<!-- extra newline if end of list, to make things pretty -->
89
<!--<xsl:if test="count(ancestor::itemizedlist|ancestor::orderedlist|ancestor::procedure|ancestor::substeps)=0">
90
<xsl:value-of select="$newline" />
94
<xsl:template name="listdepth">
95
<xsl:for-each select="ancestor-or-self::listitem">
96
<xsl:value-of select="$space" />
98
<xsl:for-each select="ancestor-or-self::step">
99
<xsl:value-of select="$space" />
101
<xsl:for-each select="ancestor-or-self::varlistentry">
102
<xsl:value-of select="$space" />
106
<xsl:template name="listnumeration">
107
<!-- gets first parent with the numeration attribute. Variable will be "" if none is found-->
108
<xsl:variable name="numeration" select="ancestor::*[@numeration][1]/@numeration" />
112
'1': "arabic", (default)
118
<xsl:when test="$numeration='loweralpha'">
119
<xsl:text>a. </xsl:text>
121
<xsl:when test="$numeration='upperalpha'">
122
<xsl:text>A. </xsl:text>
124
<xsl:when test="$numeration='lowerroman'">
125
<xsl:text>i. </xsl:text>
127
<xsl:when test="$numeration='upperroman'">
128
<xsl:text>I. </xsl:text>
131
<xsl:text>1. </xsl:text>
137
<xsl:template match="listitem/para|step/para">
138
<xsl:if test="position()>1">
139
<xsl:text>[[BR]][[BR]]</xsl:text>
142
<xsl:variable name="var">
143
<xsl:apply-templates/>
145
<xsl:value-of select="normalize-space($var)"/>
151
<xsl:template match="orderedlist/listitem|step">
152
<xsl:call-template name="listdepth"/>
153
<xsl:call-template name="listnumeration" />
155
<xsl:variable name="var">
156
<xsl:apply-templates select="para"/>
158
<xsl:value-of select="normalize-space($var)"/>
159
<xsl:value-of select="$newline"/>
160
<xsl:apply-templates select="itemizedlist|varlistentry|orderedlist|step"/>
165
<xsl:template match="itemizedlist/listitem|varlistentry/listitem">
166
<xsl:call-template name="listdepth"/><xsl:text>* </xsl:text>
167
<xsl:variable name="var">
168
<xsl:apply-templates select="para"/>
170
<xsl:value-of select="normalize-space($var)"/>
171
<xsl:value-of select="$newline"/>
172
<xsl:apply-templates select="itemizedlist|varlistentry|orderedlist|step"/>