blob: 50e4140f16512969edc517491c4cba03e4e203d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
<?xml version='1.0' encoding='ISO-8859-1'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
version="1.0">
<!-- screen -->
<xsl:template match="screen">
<xsl:choose>
<xsl:when test="child::* = userinput">
<pre class="userinput">
<xsl:apply-templates/>
</pre>
</xsl:when>
<xsl:otherwise>
<pre class="{name(.)}">
<xsl:apply-templates/>
</pre>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="userinput">
<xsl:choose>
<xsl:when test="ancestor::screen">
<kbd class="command">
<xsl:apply-templates/>
</kbd>
</xsl:when>
<xsl:otherwise>
<xsl:apply-imports/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- segementedlist -->
<xsl:template match="seg">
<xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
<xsl:variable name="seglist" select="ancestor::segmentedlist"/>
<xsl:variable name="segtitles" select="$seglist/segtitle"/>
<!-- Note: segtitle is only going to be the right thing in a well formed
SegmentedList. If there are too many Segs or too few SegTitles,
you'll get something odd...maybe an error -->
<div class="seg">
<strong>
<span class="segtitle">
<xsl:apply-templates select="$segtitles[$segnum=position()]" mode="segtitle-in-seg"/>
<xsl:text>: </xsl:text>
</span>
</strong>
<span class="seg">
<xsl:apply-templates/>
</span>
</div>
</xsl:template>
<!-- variablelist -->
<xsl:template match="variablelist">
<xsl:choose>
<xsl:when test="@role">
<div class="{@role}">
<xsl:apply-imports/>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:apply-imports/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Body attributes -->
<xsl:template name="body.attributes">
<xsl:attribute name="id">
<xsl:text>lfs</xsl:text>
</xsl:attribute>
<xsl:attribute name="class">
<xsl:value-of select="substring-after(/book/bookinfo/subtitle, ' ')"/>
</xsl:attribute>
</xsl:template>
<!-- External URLs in italic font -->
<xsl:template match="ulink" name="ulink">
<a>
<xsl:if test="@id">
<xsl:attribute name="id">
<xsl:value-of select="@id"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
<i>
<xsl:choose>
<xsl:when test="count(child::node())=0">
<xsl:value-of select="@url"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</i>
</a>
</xsl:template>
<!-- The <code> xhtml tag have look issues in some browsers, like Konqueror and.
isn't semantically correct (a filename isn't a code fragment) We will use <tt> for now. -->
<xsl:template name="inline.monoseq">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
<tt class="{local-name(.)}">
<xsl:if test="@dir">
<xsl:attribute name="dir">
<xsl:value-of select="@dir"/>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</tt>
</xsl:template>
<xsl:template name="inline.boldmonoseq">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
<!-- don't put <strong> inside figure, example, or table titles -->
<!-- or other titles that may already be represented with <strong>'s. -->
<xsl:choose>
<xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure'
or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
<tt class="{local-name(.)}">
<xsl:if test="@dir">
<xsl:attribute name="dir">
<xsl:value-of select="@dir"/>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</tt>
</xsl:when>
<xsl:otherwise>
<strong class="{local-name(.)}">
<tt>
<xsl:if test="@dir">
<xsl:attribute name="dir">
<xsl:value-of select="@dir"/>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</tt>
</strong>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="inline.italicmonoseq">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
<em class="{local-name(.)}">
<tt>
<xsl:if test="@dir">
<xsl:attribute name="dir">
<xsl:value-of select="@dir"/>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</tt>
</em>
</xsl:template>
</xsl:stylesheet>
|