source: BOOK/stylesheets/clfs-profile.xsl@ 9db1668

Last change on this file since 9db1668 was 9db1668, checked in by Joe Ciccone <jciccone@…>, 14 years ago

Parse inline items as well.

  • Property mode set to 100644
File size: 31.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:c="http://schema.cross-lfs.org/book"
4 version="1.0">
5
6 <!-- Declare our output type -->
7 <xsl:output method="xml"
8 indent="no"
9 omit-xml-declaration="no"
10 encoding="utf-8"
11 doctype-public="-//OASIS//DTD DocBook XML V4.5//EN"
12 doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" />
13
14 <xsl:param name="clfs.arch" select="''" />
15 <xsl:param name="clfs.multilib" select="''" />
16
17 <!-- Apply the other templates -->
18 <xsl:template match="@*|node()" priority="-1">
19 <xsl:copy>
20 <xsl:apply-templates select="@*|node()" />
21 </xsl:copy>
22 </xsl:template>
23
24 <!-- Build the package xml -->
25 <xsl:template match="//c:package">
26 <xsl:param name="id" select="@id" />
27 <xsl:param name="multibuild" select="@c:multibuild" />
28 <xsl:call-template name="package-iterator">
29 <xsl:with-param name="id" select="$id" />
30 <xsl:with-param name="multibuild" select="$multibuild" />
31 <xsl:with-param name="bits" select="$clfs.multilib" />
32 </xsl:call-template>
33 </xsl:template>
34
35 <xsl:template name="package-iterator">
36 <xsl:param name="id" /> <!-- Base ID of the resulting package -->
37 <xsl:param name="multibuild" /> <!-- Do we need to install for each bitsize? -->
38 <xsl:param name="bits" /> <!-- Which bit sizes to create a package for -->
39
40 <xsl:variable name="currentbits" select="substring-before(concat($bits, ','), ',')" />
41 <xsl:variable name="remainingbits" select="substring-after($bits, ',')" />
42
43 <xsl:if test="not(boolean($remainingbits) and $multibuild = 'false')">
44 <xsl:call-template name="package-stub">
45 <xsl:with-param name="id" select="$id" />
46 <xsl:with-param name="idsuffix">
47 <xsl:if test="$remainingbits">
48 <xsl:value-of select="concat('-', $currentbits)" />
49 </xsl:if>
50 </xsl:with-param>
51 <xsl:with-param name="bits" select="substring-before(concat($bits, ','), ',')" />
52 <xsl:with-param name="multibuild" select="$multibuild" />
53 </xsl:call-template>
54 </xsl:if>
55
56 <xsl:if test="$remainingbits">
57 <xsl:text>
58
59 </xsl:text>
60 <xsl:call-template name="package-iterator">
61 <xsl:with-param name="id" select="$id" />
62 <xsl:with-param name="multibuild" select="$multibuild" />
63 <xsl:with-param name="bits" select="$remainingbits" />
64 </xsl:call-template>
65 </xsl:if>
66
67 </xsl:template>
68
69 <xsl:template name="package-stub">
70 <xsl:param name="id" /> <!-- Base ID of the resulting package -->
71 <xsl:param name="idsuffix" /> <!-- Suffix to attach to the end of the ID for this perticular instance -->
72 <xsl:param name="bits" /> <!-- Which bit sizes to create a package for -->
73 <xsl:param name="multibuild" /> <!-- Are there multiple instances of this package? -->
74
75 <!-- Translate the package into a sect1 -->
76 <xsl:element name="sect1">
77
78 <!-- Set the ID of the target Sect1 -->
79 <xsl:attribute name="id">
80 <xsl:value-of select="concat($id, $idsuffix)" />
81 </xsl:attribute>
82
83 <!-- New Line -->
84 <xsl:text>
85</xsl:text>
86
87 <!-- Set the Target Filename -->
88 <xsl:processing-instruction name="dbhtml">
89 <xsl:text>filename=&quot;</xsl:text>
90 <xsl:value-of select="concat($id, $idsuffix)" />
91 <xsl:text>.html&quot;</xsl:text>
92 </xsl:processing-instruction>
93
94 <!-- New Line x2 -->
95 <xsl:text>
96
97</xsl:text>
98
99 <!-- Determine if the title is going to have a suffix or not -->
100 <xsl:variable name="titlesuffix">
101 <xsl:if test="contains($clfs.multilib, ',') and ($multibuild = 'true')">
102 <xsl:choose>
103 <xsl:when test="$bits = '32'">
104 <xsl:text>32Bit</xsl:text>
105 </xsl:when>
106 <xsl:when test="$bits = 'n32'">
107 <xsl:text>N32</xsl:text>
108 </xsl:when>
109 <xsl:when test="$bits = '64'">
110 <xsl:text>64Bit</xsl:text>
111 </xsl:when>
112 </xsl:choose>
113 </xsl:if>
114 </xsl:variable>
115
116 <!-- title: Write out a new title tag -->
117 <xsl:element name="title">
118 <xsl:value-of select="c:title" />
119 <xsl:text>-</xsl:text>
120 <xsl:value-of select="c:version" />
121 <xsl:if test="string-length($titlesuffix) > 0">
122 <xsl:text> - </xsl:text>
123 <xsl:value-of select="$titlesuffix"/>
124 </xsl:if>
125 </xsl:element><!-- title -->
126
127 <!-- New Line x2 -->
128 <xsl:text>
129
130</xsl:text>
131
132 <!-- indexterm: Add the Intex Entry for this package -->
133 <xsl:element name="indexterm">
134 <xsl:attribute name="zone">
135 <xsl:value-of select="concat($id, $idsuffix)" />
136 </xsl:attribute>
137 <xsl:text>
138 </xsl:text>
139 <xsl:element name="primary">
140 <xsl:attribute name="sortas">
141 <xsl:text>a-</xsl:text>
142 <xsl:value-of select="c:title" />
143 </xsl:attribute>
144 <xsl:value-of select="c:title" />
145 </xsl:element>
146 <xsl:if test="string-length($titlesuffix) > 0">
147 <xsl:text>
148 </xsl:text>
149 <xsl:element name="secondary">
150 <xsl:value-of select="$titlesuffix" />
151 </xsl:element>
152 </xsl:if>
153 <xsl:text>
154</xsl:text>
155 </xsl:element><!-- indexterm -->
156
157 <!-- New Line x2 -->
158 <xsl:text>
159
160</xsl:text>
161
162 <!-- sect2[role="installation"]: Add the sect2 for the package header -->
163 <xsl:element name="sect2">
164 <xsl:attribute name="role">
165 <xsl:text>installation</xsl:text>
166 </xsl:attribute>
167 <xsl:text>
168 </xsl:text>
169 <xsl:element name="title" />
170 <xsl:text>
171
172 </xsl:text>
173 <xsl:element name="para">
174 <xsl:choose>
175 <xsl:when test="$bits = '32'">
176 <xsl:apply-templates select="c:description/@*|c:description/node()" mode="filter-bits-32" />
177 </xsl:when>
178 <xsl:when test="$bits = 'n32'">
179 <xsl:apply-templates select="c:description/@*|c:description/node()" mode="filter-bits-n32" />
180 </xsl:when>
181 <xsl:when test="$bits = '64'">
182 <xsl:apply-templates select="c:description/@*|c:description/node()" mode="filter-bits-64" />
183 </xsl:when>
184 </xsl:choose>
185 </xsl:element>
186 <xsl:text>
187
188</xsl:text>
189 </xsl:element>
190
191 <!-- New Line x2 -->
192 <xsl:text>
193
194</xsl:text>
195
196 <!-- c:install -> sect2: For each c:install build a sect2 section -->
197 <xsl:for-each select="c:install">
198 <xsl:element name="sect2">
199 <xsl:text>
200 </xsl:text>
201 <xsl:element name="title">
202 <xsl:text>Installing</xsl:text>
203 </xsl:element>
204 <xsl:text>
205
206</xsl:text>
207 <xsl:choose>
208 <xsl:when test="$bits = '32'">
209 <xsl:apply-templates select="@*|node()" mode="filter-bits-32" />
210 </xsl:when>
211 <xsl:when test="$bits = 'n32'">
212 <xsl:apply-templates select="@*|node()" mode="filter-bits-n32" />
213 </xsl:when>
214 <xsl:when test="$bits = '64'">
215 <xsl:apply-templates select="@*|node()" mode="filter-bits-64" />
216 </xsl:when>
217 </xsl:choose>
218 <xsl:text>
219</xsl:text>
220 </xsl:element>
221 </xsl:for-each><!-- c:install -> sect2 -->
222
223 <!-- New Line x2 -->
224 <xsl:text>
225
226</xsl:text>
227
228 </xsl:element><!-- Sect1 -->
229
230 </xsl:template><!-- package-stub -->
231
232 <!-- Apply the profile to the 32bit package -->
233
234 <xsl:template match="c:para" mode="filter-bits-32">
235 <xsl:variable name="ismultilib">
236 <xsl:choose>
237 <xsl:when test="contains($clfs.multilib, ',')">
238 <xsl:text>true</xsl:text>
239 </xsl:when>
240 <xsl:otherwise>
241 <xsl:text>false</xsl:text>
242 </xsl:otherwise>
243 </xsl:choose>
244 </xsl:variable>
245 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
246 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
247 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
248 <xsl:element name="para">
249 <xsl:apply-templates select="node()" mode="filter-bits-32" />
250 </xsl:element>
251 </xsl:if>
252 </xsl:if>
253 </xsl:if>
254 </xsl:template>
255
256 <xsl:template match="c:install/c:command" mode="filter-bits-32">
257 <xsl:variable name="ismultilib">
258 <xsl:choose>
259 <xsl:when test="contains($clfs.multilib, ',')">
260 <xsl:text>true</xsl:text>
261 </xsl:when>
262 <xsl:otherwise>
263 <xsl:text>false</xsl:text>
264 </xsl:otherwise>
265 </xsl:choose>
266 </xsl:variable>
267 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
268 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
269 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
270 <xsl:element name="userinput">
271 <xsl:if test="@c:nodump = 'true'">
272 <xsl:attribute name="role">
273 <xsl:text>nodump</xsl:text>
274 </xsl:attribute>
275 </xsl:if>
276 <xsl:element name="screen">
277 <xsl:apply-templates select="@*|node()" mode="filter-bits-32" />
278 </xsl:element>
279 </xsl:element>
280 </xsl:if>
281 </xsl:if>
282 </xsl:if>
283 </xsl:template>
284
285 <xsl:template match="c:literal" mode="filter-bits-32">
286 <xsl:variable name="ismultilib">
287 <xsl:choose>
288 <xsl:when test="contains($clfs.multilib, ',')">
289 <xsl:text>true</xsl:text>
290 </xsl:when>
291 <xsl:otherwise>
292 <xsl:text>false</xsl:text>
293 </xsl:otherwise>
294 </xsl:choose>
295 </xsl:variable>
296 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
297 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
298 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
299 <xsl:element name="literal">
300 <xsl:apply-templates select="node()" mode="filter-bits-32" />
301 </xsl:element>
302 </xsl:if>
303 </xsl:if>
304 </xsl:if>
305 </xsl:template>
306
307 <xsl:template match="c:replaceable" mode="filter-bits-32">
308 <xsl:variable name="ismultilib">
309 <xsl:choose>
310 <xsl:when test="contains($clfs.multilib, ',')">
311 <xsl:text>true</xsl:text>
312 </xsl:when>
313 <xsl:otherwise>
314 <xsl:text>false</xsl:text>
315 </xsl:otherwise>
316 </xsl:choose>
317 </xsl:variable>
318 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
319 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
320 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
321 <xsl:element name="replaceable">
322 <xsl:apply-templates select="node()" mode="filter-bits-32" />
323 </xsl:element>
324 </xsl:if>
325 </xsl:if>
326 </xsl:if>
327 </xsl:template>
328
329 <xsl:template match="c:application" mode="filter-bits-32">
330 <xsl:variable name="ismultilib">
331 <xsl:choose>
332 <xsl:when test="contains($clfs.multilib, ',')">
333 <xsl:text>true</xsl:text>
334 </xsl:when>
335 <xsl:otherwise>
336 <xsl:text>false</xsl:text>
337 </xsl:otherwise>
338 </xsl:choose>
339 </xsl:variable>
340 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
341 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
342 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
343 <xsl:element name="application">
344 <xsl:apply-templates select="node()" mode="filter-bits-32" />
345 </xsl:element>
346 </xsl:if>
347 </xsl:if>
348 </xsl:if>
349 </xsl:template>
350
351 <xsl:template match="c:dirname" mode="filter-bits-32">
352 <xsl:variable name="ismultilib">
353 <xsl:choose>
354 <xsl:when test="contains($clfs.multilib, ',')">
355 <xsl:text>true</xsl:text>
356 </xsl:when>
357 <xsl:otherwise>
358 <xsl:text>false</xsl:text>
359 </xsl:otherwise>
360 </xsl:choose>
361 </xsl:variable>
362 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
363 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
364 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
365 <xsl:element name="filename">
366 <xsl:attribute name="class">
367 <xsl:text>directory</xsl:text>
368 </xsl:attribute>
369 <xsl:apply-templates select="node()" mode="filter-bits-32" />
370 </xsl:element>
371 </xsl:if>
372 </xsl:if>
373 </xsl:if>
374 </xsl:template>
375
376 <xsl:template match="c:filename" mode="filter-bits-32">
377 <xsl:variable name="ismultilib">
378 <xsl:choose>
379 <xsl:when test="contains($clfs.multilib, ',')">
380 <xsl:text>true</xsl:text>
381 </xsl:when>
382 <xsl:otherwise>
383 <xsl:text>false</xsl:text>
384 </xsl:otherwise>
385 </xsl:choose>
386 </xsl:variable>
387 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
388 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
389 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
390 <xsl:element name="filename">
391 <xsl:apply-templates select="node()" mode="filter-bits-32" />
392 </xsl:element>
393 </xsl:if>
394 </xsl:if>
395 </xsl:if>
396 </xsl:template>
397
398 <xsl:template match="c:command" mode="filter-bits-32">
399 <xsl:variable name="ismultilib">
400 <xsl:choose>
401 <xsl:when test="contains($clfs.multilib, ',')">
402 <xsl:text>true</xsl:text>
403 </xsl:when>
404 <xsl:otherwise>
405 <xsl:text>false</xsl:text>
406 </xsl:otherwise>
407 </xsl:choose>
408 </xsl:variable>
409 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
410 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
411 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
412 <xsl:element name="command">
413 <xsl:apply-templates select="node()" mode="filter-bits-32" />
414 </xsl:element>
415 </xsl:if>
416 </xsl:if>
417 </xsl:if>
418 </xsl:template>
419
420 <xsl:template match="@c:arch" mode="filter-bits-32" />
421 <xsl:template match="@c:bits" mode="filter-bits-32" />
422 <xsl:template match="@c:multilib" mode="filter-bits-32" />
423
424 <!-- Apply the profile to the n32 package -->
425
426 <xsl:template match="c:para" mode="filter-bits-n32">
427 <xsl:variable name="ismultilib">
428 <xsl:choose>
429 <xsl:when test="contains($clfs.multilib, ',')">
430 <xsl:text>true</xsl:text>
431 </xsl:when>
432 <xsl:otherwise>
433 <xsl:text>false</xsl:text>
434 </xsl:otherwise>
435 </xsl:choose>
436 </xsl:variable>
437 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
438 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
439 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
440 <xsl:element name="para">
441 <xsl:apply-templates select="node()" mode="filter-bits-n32" />
442 </xsl:element>
443 </xsl:if>
444 </xsl:if>
445 </xsl:if>
446 </xsl:template>
447
448 <xsl:template match="c:install/c:command" mode="filter-bits-n32">
449 <xsl:variable name="ismultilib">
450 <xsl:choose>
451 <xsl:when test="contains($clfs.multilib, ',')">
452 <xsl:text>true</xsl:text>
453 </xsl:when>
454 <xsl:otherwise>
455 <xsl:text>false</xsl:text>
456 </xsl:otherwise>
457 </xsl:choose>
458 </xsl:variable>
459 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
460 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
461 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
462 <xsl:element name="userinput">
463 <xsl:if test="@c:nodump = 'true'">
464 <xsl:attribute name="role">
465 <xsl:text>nodump</xsl:text>
466 </xsl:attribute>
467 </xsl:if>
468 <xsl:element name="screen">
469 <xsl:apply-templates select="@*|node()" mode="filter-bits-n32" />
470 </xsl:element>
471 </xsl:element>
472 </xsl:if>
473 </xsl:if>
474 </xsl:if>
475 </xsl:template>
476
477 <xsl:template match="c:literal" mode="filter-bits-n32">
478 <xsl:variable name="ismultilib">
479 <xsl:choose>
480 <xsl:when test="contains($clfs.multilib, ',')">
481 <xsl:text>true</xsl:text>
482 </xsl:when>
483 <xsl:otherwise>
484 <xsl:text>false</xsl:text>
485 </xsl:otherwise>
486 </xsl:choose>
487 </xsl:variable>
488 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
489 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
490 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
491 <xsl:element name="literal">
492 <xsl:apply-templates select="node()" mode="filter-bits-n32" />
493 </xsl:element>
494 </xsl:if>
495 </xsl:if>
496 </xsl:if>
497 </xsl:template>
498
499 <xsl:template match="c:replaceable" mode="filter-bits-n32">
500 <xsl:variable name="ismultilib">
501 <xsl:choose>
502 <xsl:when test="contains($clfs.multilib, ',')">
503 <xsl:text>true</xsl:text>
504 </xsl:when>
505 <xsl:otherwise>
506 <xsl:text>false</xsl:text>
507 </xsl:otherwise>
508 </xsl:choose>
509 </xsl:variable>
510 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
511 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
512 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
513 <xsl:element name="replaceable">
514 <xsl:apply-templates select="node()" mode="filter-bits-n32" />
515 </xsl:element>
516 </xsl:if>
517 </xsl:if>
518 </xsl:if>
519 </xsl:template>
520
521 <xsl:template match="c:application" mode="filter-bits-n32">
522 <xsl:variable name="ismultilib">
523 <xsl:choose>
524 <xsl:when test="contains($clfs.multilib, ',')">
525 <xsl:text>true</xsl:text>
526 </xsl:when>
527 <xsl:otherwise>
528 <xsl:text>false</xsl:text>
529 </xsl:otherwise>
530 </xsl:choose>
531 </xsl:variable>
532 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
533 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
534 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
535 <xsl:element name="application">
536 <xsl:apply-templates select="node()" mode="filter-bits-n32" />
537 </xsl:element>
538 </xsl:if>
539 </xsl:if>
540 </xsl:if>
541 </xsl:template>
542
543 <xsl:template match="c:dirname" mode="filter-bits-n32">
544 <xsl:variable name="ismultilib">
545 <xsl:choose>
546 <xsl:when test="contains($clfs.multilib, ',')">
547 <xsl:text>true</xsl:text>
548 </xsl:when>
549 <xsl:otherwise>
550 <xsl:text>false</xsl:text>
551 </xsl:otherwise>
552 </xsl:choose>
553 </xsl:variable>
554 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
555 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
556 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
557 <xsl:element name="filename">
558 <xsl:attribute name="class">
559 <xsl:text>directory</xsl:text>
560 </xsl:attribute>
561 <xsl:apply-templates select="node()" mode="filter-bits-n32" />
562 </xsl:element>
563 </xsl:if>
564 </xsl:if>
565 </xsl:if>
566 </xsl:template>
567
568 <xsl:template match="c:filename" mode="filter-bits-n32">
569 <xsl:variable name="ismultilib">
570 <xsl:choose>
571 <xsl:when test="contains($clfs.multilib, ',')">
572 <xsl:text>true</xsl:text>
573 </xsl:when>
574 <xsl:otherwise>
575 <xsl:text>false</xsl:text>
576 </xsl:otherwise>
577 </xsl:choose>
578 </xsl:variable>
579 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
580 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
581 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
582 <xsl:element name="filename">
583 <xsl:apply-templates select="node()" mode="filter-bits-n32" />
584 </xsl:element>
585 </xsl:if>
586 </xsl:if>
587 </xsl:if>
588 </xsl:template>
589
590 <xsl:template match="c:command" mode="filter-bits-n32">
591 <xsl:variable name="ismultilib">
592 <xsl:choose>
593 <xsl:when test="contains($clfs.multilib, ',')">
594 <xsl:text>true</xsl:text>
595 </xsl:when>
596 <xsl:otherwise>
597 <xsl:text>false</xsl:text>
598 </xsl:otherwise>
599 </xsl:choose>
600 </xsl:variable>
601 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
602 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
603 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
604 <xsl:element name="command">
605 <xsl:apply-templates select="node()" mode="filter-bits-n32" />
606 </xsl:element>
607 </xsl:if>
608 </xsl:if>
609 </xsl:if>
610 </xsl:template>
611
612 <xsl:template match="@c:arch" mode="filter-bits-n32" />
613 <xsl:template match="@c:bits" mode="filter-bits-n32" />
614 <xsl:template match="@c:multilib" mode="filter-bits-n32" />
615
616 <!-- Apply the profile to the 64bit package -->
617
618 <xsl:template match="c:para" mode="filter-bits-64">
619 <xsl:variable name="ismultilib">
620 <xsl:choose>
621 <xsl:when test="contains($clfs.multilib, ',')">
622 <xsl:text>true</xsl:text>
623 </xsl:when>
624 <xsl:otherwise>
625 <xsl:text>false</xsl:text>
626 </xsl:otherwise>
627 </xsl:choose>
628 </xsl:variable>
629 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
630 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
631 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
632 <xsl:element name="para">
633 <xsl:apply-templates select="node()" mode="filter-bits-64" />
634 </xsl:element>
635 </xsl:if>
636 </xsl:if>
637 </xsl:if>
638 </xsl:template>
639
640 <xsl:template match="c:install/c:command" mode="filter-bits-64">
641 <xsl:variable name="ismultilib">
642 <xsl:choose>
643 <xsl:when test="contains($clfs.multilib, ',')">
644 <xsl:text>true</xsl:text>
645 </xsl:when>
646 <xsl:otherwise>
647 <xsl:text>false</xsl:text>
648 </xsl:otherwise>
649 </xsl:choose>
650 </xsl:variable>
651 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
652 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
653 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
654 <xsl:element name="userinput">
655 <xsl:if test="@c:nodump = 'true'">
656 <xsl:attribute name="role">
657 <xsl:text>nodump</xsl:text>
658 </xsl:attribute>
659 </xsl:if>
660 <xsl:element name="screen">
661 <xsl:apply-templates select="@*|node()" mode="filter-bits-64" />
662 </xsl:element>
663 </xsl:element>
664 </xsl:if>
665 </xsl:if>
666 </xsl:if>
667 </xsl:template>
668
669 <xsl:template match="c:literal" mode="filter-bits-64">
670 <xsl:variable name="ismultilib">
671 <xsl:choose>
672 <xsl:when test="contains($clfs.multilib, ',')">
673 <xsl:text>true</xsl:text>
674 </xsl:when>
675 <xsl:otherwise>
676 <xsl:text>false</xsl:text>
677 </xsl:otherwise>
678 </xsl:choose>
679 </xsl:variable>
680 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
681 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
682 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
683 <xsl:element name="literal">
684 <xsl:apply-templates select="node()" mode="filter-bits-64" />
685 </xsl:element>
686 </xsl:if>
687 </xsl:if>
688 </xsl:if>
689 </xsl:template>
690
691 <xsl:template match="c:replaceable" mode="filter-bits-64">
692 <xsl:variable name="ismultilib">
693 <xsl:choose>
694 <xsl:when test="contains($clfs.multilib, ',')">
695 <xsl:text>true</xsl:text>
696 </xsl:when>
697 <xsl:otherwise>
698 <xsl:text>false</xsl:text>
699 </xsl:otherwise>
700 </xsl:choose>
701 </xsl:variable>
702 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
703 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
704 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
705 <xsl:element name="replaceable">
706 <xsl:apply-templates select="node()" mode="filter-bits-64" />
707 </xsl:element>
708 </xsl:if>
709 </xsl:if>
710 </xsl:if>
711 </xsl:template>
712
713 <xsl:template match="c:application" mode="filter-bits-64">
714 <xsl:variable name="ismultilib">
715 <xsl:choose>
716 <xsl:when test="contains($clfs.multilib, ',')">
717 <xsl:text>true</xsl:text>
718 </xsl:when>
719 <xsl:otherwise>
720 <xsl:text>false</xsl:text>
721 </xsl:otherwise>
722 </xsl:choose>
723 </xsl:variable>
724 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
725 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
726 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
727 <xsl:element name="application">
728 <xsl:apply-templates select="node()" mode="filter-bits-64" />
729 </xsl:element>
730 </xsl:if>
731 </xsl:if>
732 </xsl:if>
733 </xsl:template>
734
735 <xsl:template match="c:dirname" mode="filter-bits-64">
736 <xsl:variable name="ismultilib">
737 <xsl:choose>
738 <xsl:when test="contains($clfs.multilib, ',')">
739 <xsl:text>true</xsl:text>
740 </xsl:when>
741 <xsl:otherwise>
742 <xsl:text>false</xsl:text>
743 </xsl:otherwise>
744 </xsl:choose>
745 </xsl:variable>
746 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
747 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
748 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
749 <xsl:element name="filename">
750 <xsl:attribute name="class">
751 <xsl:text>directory</xsl:text>
752 </xsl:attribute>
753 <xsl:apply-templates select="node()" mode="filter-bits-64" />
754 </xsl:element>
755 </xsl:if>
756 </xsl:if>
757 </xsl:if>
758 </xsl:template>
759
760 <xsl:template match="c:filename" mode="filter-bits-64">
761 <xsl:variable name="ismultilib">
762 <xsl:choose>
763 <xsl:when test="contains($clfs.multilib, ',')">
764 <xsl:text>true</xsl:text>
765 </xsl:when>
766 <xsl:otherwise>
767 <xsl:text>false</xsl:text>
768 </xsl:otherwise>
769 </xsl:choose>
770 </xsl:variable>
771 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
772 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
773 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
774 <xsl:element name="filename">
775 <xsl:apply-templates select="node()" mode="filter-bits-64" />
776 </xsl:element>
777 </xsl:if>
778 </xsl:if>
779 </xsl:if>
780 </xsl:template>
781
782 <xsl:template match="c:command" mode="filter-bits-64">
783 <xsl:variable name="ismultilib">
784 <xsl:choose>
785 <xsl:when test="contains($clfs.multilib, ',')">
786 <xsl:text>true</xsl:text>
787 </xsl:when>
788 <xsl:otherwise>
789 <xsl:text>false</xsl:text>
790 </xsl:otherwise>
791 </xsl:choose>
792 </xsl:variable>
793 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
794 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
795 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
796 <xsl:element name="command">
797 <xsl:apply-templates select="node()" mode="filter-bits-64" />
798 </xsl:element>
799 </xsl:if>
800 </xsl:if>
801 </xsl:if>
802 </xsl:template>
803
804 <xsl:template match="@c:arch" mode="filter-bits-64" />
805 <xsl:template match="@c:bits" mode="filter-bits-64" />
806 <xsl:template match="@c:multilib" mode="filter-bits-64" />
807
808 <!-- Apply the profile filter to the entire document -->
809 <xsl:template match="//*[@c:arch]|//*[@c:multilib]">
810 <xsl:variable name="ismultilib">
811 <xsl:choose>
812 <xsl:when test="contains($clfs.multilib, ',')">
813 <xsl:text>true</xsl:text>
814 </xsl:when>
815 <xsl:otherwise>
816 <xsl:text>false</xsl:text>
817 </xsl:otherwise>
818 </xsl:choose>
819 </xsl:variable>
820 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
821 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
822 <xsl:copy>
823 <xsl:apply-templates select="@*|node()" />
824 </xsl:copy>
825 </xsl:if>
826 </xsl:if>
827 </xsl:template>
828
829 <!-- Remove the profileing attributes for the remaining objects -->
830 <xsl:template match="@c:arch" />
831 <xsl:template match="@c:bits" />
832 <xsl:template match="@c:multilib" />
833
834</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.