source: BOOK/stylesheets/clfs-profile.xsl@ 01f0f37

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

Also render the short descriptions for programs.

  • Property mode set to 100644
File size: 43.2 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 <!-- c:contents -> sect2: Build or reference the contents sect2 -->
224 <xsl:for-each select="c:contents">
225
226 <xsl:text>&#xa;&#xa;</xsl:text>
227
228 <xsl:element name="sect2">
229 <xsl:attribute name="role">
230 <xsl:text>content</xsl:text>
231 </xsl:attribute>
232 <xsl:choose>
233 <xsl:when test="string-length(@c:ref) > 0">
234 <!-- Insert an xref to the actual contents list -->
235 <xsl:text>&#xa; </xsl:text>
236 <xsl:element name="title" />
237 <xsl:text>&#xa;&#xa; </xsl:text>
238 <xsl:element name="para">
239 <xsl:text>Details on this package are located in </xsl:text>
240 <xsl:element name="xref">
241 <xsl:attribute name="linkend">
242 <xsl:value-of select="@c:ref" />
243 <xsl:text>-contents</xsl:text>
244 </xsl:attribute>
245 <xsl:attribute name="role">
246 <xsl:text>.</xsl:text>
247 </xsl:attribute>
248 </xsl:element>
249 </xsl:element>
250 </xsl:when>
251 <xsl:otherwise>
252 <!-- This page gets the contents list -->
253 <xsl:attribute name="id">
254 <xsl:value-of select="$id" />
255 <xsl:text>-contents</xsl:text>
256 </xsl:attribute>
257 <xsl:text>&#xa; </xsl:text>
258 <xsl:element name="title">
259 <xsl:text>Contents of </xsl:text>
260 <xsl:value-of select="../c:title" />
261 </xsl:element>
262 <xsl:text>&#xa;&#xa;</xsl:text>
263 <!-- Begin the Summary List -->
264 <xsl:element name="segmentedlist">
265 <xsl:if test="count(c:program) &gt; 0">
266 <xsl:text>&#xa; </xsl:text>
267 <xsl:element name="segtitle">
268 <xsl:text>Installed Programs</xsl:text>
269 </xsl:element>
270 </xsl:if>
271 <xsl:if test="count(c:library) &gt; 0">
272 <xsl:text>&#xa; </xsl:text>
273 <xsl:element name="segtitle">
274 <xsl:text>Installed Libraries</xsl:text>
275 </xsl:element>
276 </xsl:if>
277 <xsl:if test="count(c:directory) &gt; 0">
278 <xsl:text>&#xa; </xsl:text>
279 <xsl:element name="segtitle">
280 <xsl:text>Installed Directories</xsl:text>
281 </xsl:element>
282 </xsl:if>
283 <xsl:text>&#xa;&#xa; </xsl:text>
284 <xsl:element name="seglistitem">
285
286 <!-- Begin the seg list for Programs -->
287 <xsl:if test="count(c:program) &gt; 0">
288 <xsl:text>&#xa; </xsl:text>
289 <xsl:element name="seg">
290 <xsl:for-each select="c:program">
291 <xsl:value-of select="c:name" />
292 <xsl:if test="count(../c:program) &gt; 1">
293 <xsl:choose>
294 <xsl:when test="position() &lt; (last() - 1)">
295 <xsl:text>, </xsl:text>
296 </xsl:when>
297 <xsl:when test="position() = last() - 1">
298 <xsl:text> and </xsl:text>
299 </xsl:when>
300 </xsl:choose>
301 </xsl:if>
302 </xsl:for-each>
303 </xsl:element>
304 </xsl:if>
305 <!-- End the seg list for Programs -->
306
307 <!-- Begin the seg list for Libraries -->
308 <xsl:if test="count(c:library) &gt; 0">
309 <xsl:text>&#xa; </xsl:text>
310 <xsl:element name="seg">
311 <xsl:for-each select="c:library">
312 <xsl:value-of select="c:name" />
313 <xsl:if test="count(../c:library) &gt; 1">
314 <xsl:choose>
315 <xsl:when test="position() &lt; (last() - 1)">
316 <xsl:text>, </xsl:text>
317 </xsl:when>
318 <xsl:when test="position() = last() - 1">
319 <xsl:text> and </xsl:text>
320 </xsl:when>
321 </xsl:choose>
322 </xsl:if>
323 </xsl:for-each>
324 </xsl:element>
325 </xsl:if>
326 <!-- End the seg list for Libraries -->
327
328 <!-- Begin the seg list for Directories -->
329 <xsl:if test="count(c:directory) &gt; 0">
330 <xsl:text>&#xa; </xsl:text>
331 <xsl:element name="seg">
332 <xsl:for-each select="c:directory">
333 <xsl:value-of select="c:name" />
334 <xsl:if test="count(../c:directory) &gt; 1">
335 <xsl:if test="position() &lt; (last() - 1)">
336 <xsl:text>, </xsl:text>
337 </xsl:if>
338 <xsl:if test="position() = last() - 1">
339 <xsl:text> and </xsl:text>
340 </xsl:if>
341 </xsl:if>
342 </xsl:for-each>
343 </xsl:element>
344 </xsl:if>
345 <!-- End the seg list for Directories -->
346
347 <xsl:text>&#xa; </xsl:text>
348 </xsl:element>
349 <xsl:text>&#xa;</xsl:text>
350 </xsl:element>
351 <xsl:text>&#xa;&#xa;</xsl:text>
352 <!-- End of the Summary List -->
353
354 <!-- Begin Short Desc List -->
355 <xsl:element name="variablelist">
356
357 <!-- Render As -->
358 <xsl:text>&#xa; </xsl:text>
359 <xsl:element name="bridgehead">
360 <xsl:attribute name="renderas">
361 <xsl:text>sect3</xsl:text>
362 </xsl:attribute>
363 <xsl:text>Short Descriptions</xsl:text>
364 </xsl:element>
365
366 <!-- Processing Instructions -->
367 <xsl:text>&#xa; </xsl:text>
368 <xsl:processing-instruction name="dbfo">
369 <xsl:text>list-presentation="list"</xsl:text>
370 </xsl:processing-instruction>
371 <xsl:text>&#xa; </xsl:text>
372 <xsl:processing-instruction name="dbhtml">
373 <xsl:text>list-presentation="table"</xsl:text>
374 </xsl:processing-instruction>
375
376 <!-- Begin the Short Desc For-Each for Programs -->
377 <xsl:for-each select="c:program">
378 <xsl:text>&#xa;&#xa; </xsl:text>
379 <xsl:element name="varlistentry">
380 <xsl:attribute name="id">
381 <xsl:value-of select="c:name" />
382 </xsl:attribute>
383
384 <!-- Term -->
385 <xsl:text>&#xa; </xsl:text>
386 <xsl:element name="term">
387 <xsl:element name="command">
388 <xsl:value-of select="c:name" />
389 </xsl:element>
390 </xsl:element>
391 <!-- End Term -->
392
393 <!-- List Item -->
394 <xsl:text>&#xa; </xsl:text>
395 <xsl:element name="listitem">
396
397 <xsl:text>&#xa; </xsl:text>
398 <xsl:element name="para">
399 <xsl:apply-templates select="c:description" />
400 </xsl:element>
401
402 <xsl:text>&#xa; </xsl:text>
403 <xsl:element name="indexterm">
404 <xsl:attribute name="zone">
405 <xsl:value-of select="$id" />
406 <xsl:text> </xsl:text>
407 <xsl:value-of select="c:name" />
408 </xsl:attribute>
409 <xsl:text>&#xa; </xsl:text>
410 <xsl:element name="primary">
411 <xsl:attribute name="sortas">
412 <xsl:text>b-</xsl:text>
413 <xsl:value-of select="c:name" />
414 </xsl:attribute>
415 <xsl:value-of select="c:name" />
416 </xsl:element>
417 <xsl:text>&#xa; </xsl:text>
418 </xsl:element>
419
420 <xsl:text>&#xa; </xsl:text>
421 </xsl:element><!-- listitem -->
422 <!-- End List Item -->
423
424 <xsl:text>&#xa; </xsl:text>
425 </xsl:element><!-- varlistentry -->
426 </xsl:for-each>
427 <!-- End the Short Desc For-Each for Programs -->
428
429 <!-- Begin the Short Desc For-Each for Libraries -->
430 <xsl:for-each select="c:library">
431 <xsl:text>&#xa;&#xa; </xsl:text>
432 <xsl:element name="varlistentry">
433 <xsl:attribute name="id">
434 <xsl:value-of select="c:name" />
435 </xsl:attribute>
436
437 <!-- Term -->
438 <xsl:text>&#xa; </xsl:text>
439 <xsl:element name="term">
440 <xsl:element name="filename">
441 <xsl:attribute name="class">
442 <xsl:text>libraryfile</xsl:text>
443 </xsl:attribute>
444 <xsl:value-of select="c:name" />
445 </xsl:element>
446 </xsl:element>
447 <!-- End Term -->
448
449 <!-- List Item -->
450 <xsl:text>&#xa; </xsl:text>
451 <xsl:element name="listitem">
452
453 <xsl:text>&#xa; </xsl:text>
454 <xsl:element name="para">
455 <xsl:apply-templates select="c:description" />
456 </xsl:element>
457
458 <xsl:text>&#xa; </xsl:text>
459 <xsl:element name="indexterm">
460 <xsl:attribute name="zone">
461 <xsl:value-of select="$id" />
462 <xsl:text> </xsl:text>
463 <xsl:value-of select="c:name" />
464 </xsl:attribute>
465 <xsl:text>&#xa; </xsl:text>
466 <xsl:element name="primary">
467 <xsl:attribute name="sortas">
468 <xsl:text>c-</xsl:text>
469 <xsl:value-of select="c:name" />
470 </xsl:attribute>
471 <xsl:value-of select="c:name" />
472 </xsl:element>
473 <xsl:text>&#xa; </xsl:text>
474 </xsl:element>
475
476 <xsl:text>&#xa; </xsl:text>
477 </xsl:element><!-- listitem -->
478 <!-- End List Item -->
479
480 <xsl:text>&#xa; </xsl:text>
481 </xsl:element><!-- varlistentry -->
482 </xsl:for-each>
483 <!-- End the Short Desc For-Each for Libraries -->
484
485 <xsl:text>&#xa;&#xa;</xsl:text>
486 </xsl:element><!-- variablelist -->
487 <!-- End Short Desc List -->
488 </xsl:otherwise>
489 </xsl:choose>
490
491 <xsl:text>&#xa;&#xa;</xsl:text>
492 </xsl:element><!-- sect2 -->
493 </xsl:for-each><!-- c:contents -> sect2 -->
494
495 <xsl:text>&#xa;&#xa;</xsl:text>
496
497 </xsl:element><!-- Sect1 -->
498
499 </xsl:template><!-- package-stub -->
500
501 <!-- Apply the profile to the 32bit package -->
502
503 <xsl:template match="c:para" mode="filter-bits-32">
504 <xsl:variable name="ismultilib">
505 <xsl:choose>
506 <xsl:when test="contains($clfs.multilib, ',')">
507 <xsl:text>true</xsl:text>
508 </xsl:when>
509 <xsl:otherwise>
510 <xsl:text>false</xsl:text>
511 </xsl:otherwise>
512 </xsl:choose>
513 </xsl:variable>
514 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
515 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
516 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
517 <xsl:element name="para">
518 <xsl:apply-templates select="node()" mode="filter-bits-32" />
519 </xsl:element>
520 </xsl:if>
521 </xsl:if>
522 </xsl:if>
523 </xsl:template>
524
525 <xsl:template match="c:install/c:command" mode="filter-bits-32">
526 <xsl:variable name="ismultilib">
527 <xsl:choose>
528 <xsl:when test="contains($clfs.multilib, ',')">
529 <xsl:text>true</xsl:text>
530 </xsl:when>
531 <xsl:otherwise>
532 <xsl:text>false</xsl:text>
533 </xsl:otherwise>
534 </xsl:choose>
535 </xsl:variable>
536 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
537 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
538 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
539 <xsl:element name="userinput">
540 <xsl:if test="@c:nodump = 'true'">
541 <xsl:attribute name="role">
542 <xsl:text>nodump</xsl:text>
543 </xsl:attribute>
544 </xsl:if>
545 <xsl:element name="screen">
546 <xsl:apply-templates select="@*|node()" mode="filter-bits-32" />
547 </xsl:element>
548 </xsl:element>
549 </xsl:if>
550 </xsl:if>
551 </xsl:if>
552 </xsl:template>
553
554 <xsl:template match="c:literal" mode="filter-bits-32">
555 <xsl:variable name="ismultilib">
556 <xsl:choose>
557 <xsl:when test="contains($clfs.multilib, ',')">
558 <xsl:text>true</xsl:text>
559 </xsl:when>
560 <xsl:otherwise>
561 <xsl:text>false</xsl:text>
562 </xsl:otherwise>
563 </xsl:choose>
564 </xsl:variable>
565 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
566 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
567 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
568 <xsl:element name="literal">
569 <xsl:apply-templates select="node()" mode="filter-bits-32" />
570 </xsl:element>
571 </xsl:if>
572 </xsl:if>
573 </xsl:if>
574 </xsl:template>
575
576 <xsl:template match="c:replaceable" mode="filter-bits-32">
577 <xsl:variable name="ismultilib">
578 <xsl:choose>
579 <xsl:when test="contains($clfs.multilib, ',')">
580 <xsl:text>true</xsl:text>
581 </xsl:when>
582 <xsl:otherwise>
583 <xsl:text>false</xsl:text>
584 </xsl:otherwise>
585 </xsl:choose>
586 </xsl:variable>
587 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
588 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
589 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
590 <xsl:element name="replaceable">
591 <xsl:apply-templates select="node()" mode="filter-bits-32" />
592 </xsl:element>
593 </xsl:if>
594 </xsl:if>
595 </xsl:if>
596 </xsl:template>
597
598 <xsl:template match="c:application" mode="filter-bits-32">
599 <xsl:variable name="ismultilib">
600 <xsl:choose>
601 <xsl:when test="contains($clfs.multilib, ',')">
602 <xsl:text>true</xsl:text>
603 </xsl:when>
604 <xsl:otherwise>
605 <xsl:text>false</xsl:text>
606 </xsl:otherwise>
607 </xsl:choose>
608 </xsl:variable>
609 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
610 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
611 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
612 <xsl:element name="application">
613 <xsl:apply-templates select="node()" mode="filter-bits-32" />
614 </xsl:element>
615 </xsl:if>
616 </xsl:if>
617 </xsl:if>
618 </xsl:template>
619
620 <xsl:template match="c:dirname" mode="filter-bits-32">
621 <xsl:variable name="ismultilib">
622 <xsl:choose>
623 <xsl:when test="contains($clfs.multilib, ',')">
624 <xsl:text>true</xsl:text>
625 </xsl:when>
626 <xsl:otherwise>
627 <xsl:text>false</xsl:text>
628 </xsl:otherwise>
629 </xsl:choose>
630 </xsl:variable>
631 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
632 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
633 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
634 <xsl:element name="filename">
635 <xsl:attribute name="class">
636 <xsl:text>directory</xsl:text>
637 </xsl:attribute>
638 <xsl:apply-templates select="node()" mode="filter-bits-32" />
639 </xsl:element>
640 </xsl:if>
641 </xsl:if>
642 </xsl:if>
643 </xsl:template>
644
645 <xsl:template match="c:filename" mode="filter-bits-32">
646 <xsl:variable name="ismultilib">
647 <xsl:choose>
648 <xsl:when test="contains($clfs.multilib, ',')">
649 <xsl:text>true</xsl:text>
650 </xsl:when>
651 <xsl:otherwise>
652 <xsl:text>false</xsl:text>
653 </xsl:otherwise>
654 </xsl:choose>
655 </xsl:variable>
656 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
657 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
658 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
659 <xsl:element name="filename">
660 <xsl:apply-templates select="node()" mode="filter-bits-32" />
661 </xsl:element>
662 </xsl:if>
663 </xsl:if>
664 </xsl:if>
665 </xsl:template>
666
667 <xsl:template match="c:command" mode="filter-bits-32">
668 <xsl:variable name="ismultilib">
669 <xsl:choose>
670 <xsl:when test="contains($clfs.multilib, ',')">
671 <xsl:text>true</xsl:text>
672 </xsl:when>
673 <xsl:otherwise>
674 <xsl:text>false</xsl:text>
675 </xsl:otherwise>
676 </xsl:choose>
677 </xsl:variable>
678 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
679 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
680 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
681 <xsl:element name="command">
682 <xsl:apply-templates select="node()" mode="filter-bits-32" />
683 </xsl:element>
684 </xsl:if>
685 </xsl:if>
686 </xsl:if>
687 </xsl:template>
688
689 <xsl:template match="@c:arch" mode="filter-bits-32" />
690 <xsl:template match="@c:bits" mode="filter-bits-32" />
691 <xsl:template match="@c:multilib" mode="filter-bits-32" />
692
693 <!-- Apply the profile to the n32 package -->
694
695 <xsl:template match="c:para" mode="filter-bits-n32">
696 <xsl:variable name="ismultilib">
697 <xsl:choose>
698 <xsl:when test="contains($clfs.multilib, ',')">
699 <xsl:text>true</xsl:text>
700 </xsl:when>
701 <xsl:otherwise>
702 <xsl:text>false</xsl:text>
703 </xsl:otherwise>
704 </xsl:choose>
705 </xsl:variable>
706 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
707 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
708 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
709 <xsl:element name="para">
710 <xsl:apply-templates select="node()" mode="filter-bits-n32" />
711 </xsl:element>
712 </xsl:if>
713 </xsl:if>
714 </xsl:if>
715 </xsl:template>
716
717 <xsl:template match="c:install/c:command" mode="filter-bits-n32">
718 <xsl:variable name="ismultilib">
719 <xsl:choose>
720 <xsl:when test="contains($clfs.multilib, ',')">
721 <xsl:text>true</xsl:text>
722 </xsl:when>
723 <xsl:otherwise>
724 <xsl:text>false</xsl:text>
725 </xsl:otherwise>
726 </xsl:choose>
727 </xsl:variable>
728 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
729 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
730 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
731 <xsl:element name="userinput">
732 <xsl:if test="@c:nodump = 'true'">
733 <xsl:attribute name="role">
734 <xsl:text>nodump</xsl:text>
735 </xsl:attribute>
736 </xsl:if>
737 <xsl:element name="screen">
738 <xsl:apply-templates select="@*|node()" mode="filter-bits-n32" />
739 </xsl:element>
740 </xsl:element>
741 </xsl:if>
742 </xsl:if>
743 </xsl:if>
744 </xsl:template>
745
746 <xsl:template match="c:literal" mode="filter-bits-n32">
747 <xsl:variable name="ismultilib">
748 <xsl:choose>
749 <xsl:when test="contains($clfs.multilib, ',')">
750 <xsl:text>true</xsl:text>
751 </xsl:when>
752 <xsl:otherwise>
753 <xsl:text>false</xsl:text>
754 </xsl:otherwise>
755 </xsl:choose>
756 </xsl:variable>
757 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
758 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
759 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
760 <xsl:element name="literal">
761 <xsl:apply-templates select="node()" mode="filter-bits-n32" />
762 </xsl:element>
763 </xsl:if>
764 </xsl:if>
765 </xsl:if>
766 </xsl:template>
767
768 <xsl:template match="c:replaceable" mode="filter-bits-n32">
769 <xsl:variable name="ismultilib">
770 <xsl:choose>
771 <xsl:when test="contains($clfs.multilib, ',')">
772 <xsl:text>true</xsl:text>
773 </xsl:when>
774 <xsl:otherwise>
775 <xsl:text>false</xsl:text>
776 </xsl:otherwise>
777 </xsl:choose>
778 </xsl:variable>
779 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
780 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
781 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
782 <xsl:element name="replaceable">
783 <xsl:apply-templates select="node()" mode="filter-bits-n32" />
784 </xsl:element>
785 </xsl:if>
786 </xsl:if>
787 </xsl:if>
788 </xsl:template>
789
790 <xsl:template match="c:application" mode="filter-bits-n32">
791 <xsl:variable name="ismultilib">
792 <xsl:choose>
793 <xsl:when test="contains($clfs.multilib, ',')">
794 <xsl:text>true</xsl:text>
795 </xsl:when>
796 <xsl:otherwise>
797 <xsl:text>false</xsl:text>
798 </xsl:otherwise>
799 </xsl:choose>
800 </xsl:variable>
801 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
802 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
803 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
804 <xsl:element name="application">
805 <xsl:apply-templates select="node()" mode="filter-bits-n32" />
806 </xsl:element>
807 </xsl:if>
808 </xsl:if>
809 </xsl:if>
810 </xsl:template>
811
812 <xsl:template match="c:dirname" mode="filter-bits-n32">
813 <xsl:variable name="ismultilib">
814 <xsl:choose>
815 <xsl:when test="contains($clfs.multilib, ',')">
816 <xsl:text>true</xsl:text>
817 </xsl:when>
818 <xsl:otherwise>
819 <xsl:text>false</xsl:text>
820 </xsl:otherwise>
821 </xsl:choose>
822 </xsl:variable>
823 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
824 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
825 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
826 <xsl:element name="filename">
827 <xsl:attribute name="class">
828 <xsl:text>directory</xsl:text>
829 </xsl:attribute>
830 <xsl:apply-templates select="node()" mode="filter-bits-n32" />
831 </xsl:element>
832 </xsl:if>
833 </xsl:if>
834 </xsl:if>
835 </xsl:template>
836
837 <xsl:template match="c:filename" mode="filter-bits-n32">
838 <xsl:variable name="ismultilib">
839 <xsl:choose>
840 <xsl:when test="contains($clfs.multilib, ',')">
841 <xsl:text>true</xsl:text>
842 </xsl:when>
843 <xsl:otherwise>
844 <xsl:text>false</xsl:text>
845 </xsl:otherwise>
846 </xsl:choose>
847 </xsl:variable>
848 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
849 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
850 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
851 <xsl:element name="filename">
852 <xsl:apply-templates select="node()" mode="filter-bits-n32" />
853 </xsl:element>
854 </xsl:if>
855 </xsl:if>
856 </xsl:if>
857 </xsl:template>
858
859 <xsl:template match="c:command" mode="filter-bits-n32">
860 <xsl:variable name="ismultilib">
861 <xsl:choose>
862 <xsl:when test="contains($clfs.multilib, ',')">
863 <xsl:text>true</xsl:text>
864 </xsl:when>
865 <xsl:otherwise>
866 <xsl:text>false</xsl:text>
867 </xsl:otherwise>
868 </xsl:choose>
869 </xsl:variable>
870 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
871 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
872 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
873 <xsl:element name="command">
874 <xsl:apply-templates select="node()" mode="filter-bits-n32" />
875 </xsl:element>
876 </xsl:if>
877 </xsl:if>
878 </xsl:if>
879 </xsl:template>
880
881 <xsl:template match="@c:arch" mode="filter-bits-n32" />
882 <xsl:template match="@c:bits" mode="filter-bits-n32" />
883 <xsl:template match="@c:multilib" mode="filter-bits-n32" />
884
885 <!-- Apply the profile to the 64bit package -->
886
887 <xsl:template match="c:para" mode="filter-bits-64">
888 <xsl:variable name="ismultilib">
889 <xsl:choose>
890 <xsl:when test="contains($clfs.multilib, ',')">
891 <xsl:text>true</xsl:text>
892 </xsl:when>
893 <xsl:otherwise>
894 <xsl:text>false</xsl:text>
895 </xsl:otherwise>
896 </xsl:choose>
897 </xsl:variable>
898 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
899 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
900 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
901 <xsl:element name="para">
902 <xsl:apply-templates select="node()" mode="filter-bits-64" />
903 </xsl:element>
904 </xsl:if>
905 </xsl:if>
906 </xsl:if>
907 </xsl:template>
908
909 <xsl:template match="c:install/c:command" mode="filter-bits-64">
910 <xsl:variable name="ismultilib">
911 <xsl:choose>
912 <xsl:when test="contains($clfs.multilib, ',')">
913 <xsl:text>true</xsl:text>
914 </xsl:when>
915 <xsl:otherwise>
916 <xsl:text>false</xsl:text>
917 </xsl:otherwise>
918 </xsl:choose>
919 </xsl:variable>
920 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
921 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
922 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
923 <xsl:element name="userinput">
924 <xsl:if test="@c:nodump = 'true'">
925 <xsl:attribute name="role">
926 <xsl:text>nodump</xsl:text>
927 </xsl:attribute>
928 </xsl:if>
929 <xsl:element name="screen">
930 <xsl:apply-templates select="@*|node()" mode="filter-bits-64" />
931 </xsl:element>
932 </xsl:element>
933 </xsl:if>
934 </xsl:if>
935 </xsl:if>
936 </xsl:template>
937
938 <xsl:template match="c:literal" mode="filter-bits-64">
939 <xsl:variable name="ismultilib">
940 <xsl:choose>
941 <xsl:when test="contains($clfs.multilib, ',')">
942 <xsl:text>true</xsl:text>
943 </xsl:when>
944 <xsl:otherwise>
945 <xsl:text>false</xsl:text>
946 </xsl:otherwise>
947 </xsl:choose>
948 </xsl:variable>
949 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
950 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
951 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
952 <xsl:element name="literal">
953 <xsl:apply-templates select="node()" mode="filter-bits-64" />
954 </xsl:element>
955 </xsl:if>
956 </xsl:if>
957 </xsl:if>
958 </xsl:template>
959
960 <xsl:template match="c:replaceable" mode="filter-bits-64">
961 <xsl:variable name="ismultilib">
962 <xsl:choose>
963 <xsl:when test="contains($clfs.multilib, ',')">
964 <xsl:text>true</xsl:text>
965 </xsl:when>
966 <xsl:otherwise>
967 <xsl:text>false</xsl:text>
968 </xsl:otherwise>
969 </xsl:choose>
970 </xsl:variable>
971 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
972 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
973 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
974 <xsl:element name="replaceable">
975 <xsl:apply-templates select="node()" mode="filter-bits-64" />
976 </xsl:element>
977 </xsl:if>
978 </xsl:if>
979 </xsl:if>
980 </xsl:template>
981
982 <xsl:template match="c:application" mode="filter-bits-64">
983 <xsl:variable name="ismultilib">
984 <xsl:choose>
985 <xsl:when test="contains($clfs.multilib, ',')">
986 <xsl:text>true</xsl:text>
987 </xsl:when>
988 <xsl:otherwise>
989 <xsl:text>false</xsl:text>
990 </xsl:otherwise>
991 </xsl:choose>
992 </xsl:variable>
993 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
994 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
995 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
996 <xsl:element name="application">
997 <xsl:apply-templates select="node()" mode="filter-bits-64" />
998 </xsl:element>
999 </xsl:if>
1000 </xsl:if>
1001 </xsl:if>
1002 </xsl:template>
1003
1004 <xsl:template match="c:dirname" mode="filter-bits-64">
1005 <xsl:variable name="ismultilib">
1006 <xsl:choose>
1007 <xsl:when test="contains($clfs.multilib, ',')">
1008 <xsl:text>true</xsl:text>
1009 </xsl:when>
1010 <xsl:otherwise>
1011 <xsl:text>false</xsl:text>
1012 </xsl:otherwise>
1013 </xsl:choose>
1014 </xsl:variable>
1015 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
1016 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
1017 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
1018 <xsl:element name="filename">
1019 <xsl:attribute name="class">
1020 <xsl:text>directory</xsl:text>
1021 </xsl:attribute>
1022 <xsl:apply-templates select="node()" mode="filter-bits-64" />
1023 </xsl:element>
1024 </xsl:if>
1025 </xsl:if>
1026 </xsl:if>
1027 </xsl:template>
1028
1029 <xsl:template match="c:filename" mode="filter-bits-64">
1030 <xsl:variable name="ismultilib">
1031 <xsl:choose>
1032 <xsl:when test="contains($clfs.multilib, ',')">
1033 <xsl:text>true</xsl:text>
1034 </xsl:when>
1035 <xsl:otherwise>
1036 <xsl:text>false</xsl:text>
1037 </xsl:otherwise>
1038 </xsl:choose>
1039 </xsl:variable>
1040 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
1041 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
1042 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
1043 <xsl:element name="filename">
1044 <xsl:apply-templates select="node()" mode="filter-bits-64" />
1045 </xsl:element>
1046 </xsl:if>
1047 </xsl:if>
1048 </xsl:if>
1049 </xsl:template>
1050
1051 <xsl:template match="c:command" mode="filter-bits-64">
1052 <xsl:variable name="ismultilib">
1053 <xsl:choose>
1054 <xsl:when test="contains($clfs.multilib, ',')">
1055 <xsl:text>true</xsl:text>
1056 </xsl:when>
1057 <xsl:otherwise>
1058 <xsl:text>false</xsl:text>
1059 </xsl:otherwise>
1060 </xsl:choose>
1061 </xsl:variable>
1062 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
1063 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
1064 <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
1065 <xsl:element name="command">
1066 <xsl:apply-templates select="node()" mode="filter-bits-64" />
1067 </xsl:element>
1068 </xsl:if>
1069 </xsl:if>
1070 </xsl:if>
1071 </xsl:template>
1072
1073 <xsl:template match="@c:arch" mode="filter-bits-64" />
1074 <xsl:template match="@c:bits" mode="filter-bits-64" />
1075 <xsl:template match="@c:multilib" mode="filter-bits-64" />
1076
1077 <!-- Apply the profile filter to the entire document -->
1078 <xsl:template match="//*[@c:arch]|//*[@c:multilib]">
1079 <xsl:variable name="ismultilib">
1080 <xsl:choose>
1081 <xsl:when test="contains($clfs.multilib, ',')">
1082 <xsl:text>true</xsl:text>
1083 </xsl:when>
1084 <xsl:otherwise>
1085 <xsl:text>false</xsl:text>
1086 </xsl:otherwise>
1087 </xsl:choose>
1088 </xsl:variable>
1089 <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
1090 <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
1091 <xsl:copy>
1092 <xsl:apply-templates select="@*|node()" />
1093 </xsl:copy>
1094 </xsl:if>
1095 </xsl:if>
1096 </xsl:template>
1097
1098 <!-- Remove the profileing attributes for the remaining objects -->
1099 <xsl:template match="@c:arch" />
1100 <xsl:template match="@c:bits" />
1101 <xsl:template match="@c:multilib" />
1102
1103</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.