source: stylesheets/xhtml/lfs-mixed.xsl@ 76f291f

Last change on this file since 76f291f was 73b79203, checked in by Jim Gifford <clfs@…>, 19 years ago

r945@server (orig r943): manuel | 2005-12-20 12:49:34 -0800
Changed book's title and copyright.

  • Property mode set to 100644
File size: 8.7 KB
Line 
1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns="http://www.w3.org/1999/xhtml"
5 version="1.0">
6
7 <!-- screen -->
8 <xsl:template match="screen">
9 <xsl:choose>
10 <xsl:when test="child::* = userinput">
11 <pre class="userinput">
12 <xsl:apply-templates/>
13 </pre>
14 </xsl:when>
15 <xsl:otherwise>
16 <pre class="{name(.)}">
17 <xsl:apply-templates/>
18 </pre>
19 </xsl:otherwise>
20 </xsl:choose>
21 </xsl:template>
22
23 <xsl:template match="userinput">
24 <xsl:choose>
25 <xsl:when test="ancestor::screen">
26 <kbd class="command">
27 <xsl:apply-templates/>
28 </kbd>
29 </xsl:when>
30 <xsl:otherwise>
31 <xsl:apply-imports/>
32 </xsl:otherwise>
33 </xsl:choose>
34 </xsl:template>
35
36 <!-- segementedlist -->
37 <xsl:template match="seg">
38 <xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
39 <xsl:variable name="seglist" select="ancestor::segmentedlist"/>
40 <xsl:variable name="segtitles" select="$seglist/segtitle"/>
41 <!-- Note: segtitle is only going to be the right thing in a well formed
42 SegmentedList. If there are too many Segs or too few SegTitles,
43 you'll get something odd...maybe an error -->
44 <div class="seg">
45 <strong>
46 <span class="segtitle">
47 <xsl:apply-templates select="$segtitles[$segnum=position()]" mode="segtitle-in-seg"/>
48 <xsl:text>: </xsl:text>
49 </span>
50 </strong>
51 <span class="seg">
52 <xsl:apply-templates/>
53 </span>
54 </div>
55 </xsl:template>
56
57
58 <!-- variablelist -->
59 <xsl:template match="variablelist">
60 <xsl:choose>
61 <xsl:when test="@role">
62 <div class="{@role}">
63 <xsl:apply-imports/>
64 </div>
65 </xsl:when>
66 <xsl:otherwise>
67 <xsl:apply-imports/>
68 </xsl:otherwise>
69 </xsl:choose>
70 </xsl:template>
71
72
73 <!-- Body attributes -->
74 <xsl:template name="body.attributes">
75 <xsl:attribute name="id">
76 <xsl:text>lfs</xsl:text>
77 </xsl:attribute>
78 <xsl:attribute name="class">
79 <xsl:value-of select="substring-after(/book/bookinfo/subtitle, ' ')"/>
80 </xsl:attribute>
81 </xsl:template>
82
83 <!-- External URLs in italic font -->
84 <xsl:template match="ulink" name="ulink">
85 <a>
86 <xsl:if test="@id">
87 <xsl:attribute name="id">
88 <xsl:value-of select="@id"/>
89 </xsl:attribute>
90 </xsl:if>
91 <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
92 <i>
93 <xsl:choose>
94 <xsl:when test="count(child::node())=0">
95 <xsl:value-of select="@url"/>
96 </xsl:when>
97 <xsl:otherwise>
98 <xsl:apply-templates/>
99 </xsl:otherwise>
100 </xsl:choose>
101 </i>
102 </a>
103 </xsl:template>
104
105 <!-- The <code> xhtml tag have look issues in some browsers, like Konqueror and.
106 isn't semantically correct (a filename isn't a code fragment) We will use <tt> for now. -->
107 <xsl:template name="inline.monoseq">
108 <xsl:param name="content">
109 <xsl:call-template name="anchor"/>
110 <xsl:call-template name="simple.xlink">
111 <xsl:with-param name="content">
112 <xsl:apply-templates/>
113 </xsl:with-param>
114 </xsl:call-template>
115 </xsl:param>
116 <tt class="{local-name(.)}">
117 <xsl:if test="@dir">
118 <xsl:attribute name="dir">
119 <xsl:value-of select="@dir"/>
120 </xsl:attribute>
121 </xsl:if>
122 <xsl:copy-of select="$content"/>
123 </tt>
124 </xsl:template>
125
126 <xsl:template name="inline.boldmonoseq">
127 <xsl:param name="content">
128 <xsl:call-template name="anchor"/>
129 <xsl:call-template name="simple.xlink">
130 <xsl:with-param name="content">
131 <xsl:apply-templates/>
132 </xsl:with-param>
133 </xsl:call-template>
134 </xsl:param>
135 <!-- don't put <strong> inside figure, example, or table titles -->
136 <!-- or other titles that may already be represented with <strong>'s. -->
137 <xsl:choose>
138 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure'
139 or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
140 <tt class="{local-name(.)}">
141 <xsl:if test="@dir">
142 <xsl:attribute name="dir">
143 <xsl:value-of select="@dir"/>
144 </xsl:attribute>
145 </xsl:if>
146 <xsl:copy-of select="$content"/>
147 </tt>
148 </xsl:when>
149 <xsl:otherwise>
150 <strong class="{local-name(.)}">
151 <tt>
152 <xsl:if test="@dir">
153 <xsl:attribute name="dir">
154 <xsl:value-of select="@dir"/>
155 </xsl:attribute>
156 </xsl:if>
157 <xsl:copy-of select="$content"/>
158 </tt>
159 </strong>
160 </xsl:otherwise>
161 </xsl:choose>
162 </xsl:template>
163
164 <xsl:template name="inline.italicmonoseq">
165 <xsl:param name="content">
166 <xsl:call-template name="anchor"/>
167 <xsl:call-template name="simple.xlink">
168 <xsl:with-param name="content">
169 <xsl:apply-templates/>
170 </xsl:with-param>
171 </xsl:call-template>
172 </xsl:param>
173 <em class="{local-name(.)}">
174 <tt>
175 <xsl:if test="@dir">
176 <xsl:attribute name="dir">
177 <xsl:value-of select="@dir"/>
178 </xsl:attribute>
179 </xsl:if>
180 <xsl:copy-of select="$content"/>
181 </tt>
182 </em>
183 </xsl:template>
184
185 <!-- Adding bibliosource to titlepage -->
186 <xsl:template name="book.titlepage.recto">
187 <xsl:choose>
188 <xsl:when test="bookinfo/title">
189 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/title"/>
190 </xsl:when>
191 <xsl:when test="info/title">
192 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/title"/>
193 </xsl:when>
194 <xsl:when test="title">
195 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="title"/>
196 </xsl:when>
197 </xsl:choose>
198
199 <xsl:choose>
200 <xsl:when test="bookinfo/subtitle">
201 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/subtitle"/>
202 </xsl:when>
203 <xsl:when test="info/subtitle">
204 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/subtitle"/>
205 </xsl:when>
206 <xsl:when test="subtitle">
207 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="subtitle"/>
208 </xsl:when>
209 </xsl:choose>
210
211 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/corpauthor"/>
212 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/corpauthor"/>
213 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/authorgroup"/>
214 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/authorgroup"/>
215 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/author"/>
216 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/author"/>
217 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/othercredit"/>
218 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/othercredit"/>
219 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/releaseinfo"/>
220 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/releaseinfo"/>
221 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/copyright"/>
222 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/copyright"/>
223 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/bibliosource"/>
224 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/legalnotice"/>
225 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/legalnotice"/>
226 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/pubdate"/>
227 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/pubdate"/>
228 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revision"/>
229 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/revision"/>
230 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revhistory"/>
231 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/revhistory"/>
232 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/abstract"/>
233 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/abstract"/>
234 </xsl:template>
235
236 <xsl:template match="bibliosource" mode="book.titlepage.recto.auto.mode">
237 <div>
238 <p class="copyright">
239 <xsl:apply-templates/>
240 </p>
241 </div>
242 </xsl:template>
243
244</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.