source: BOOK/stylesheets/clfs-profile.xsl @ 25844db

Last change on this file since 25844db was 25844db, checked in by Joe Ciccone <jciccone@…>, 13 years ago

Also render the short descriptions for directories.

  • Property mode set to 100644
File size: 45.9 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                <!-- Begin the Short Desc For-Each for Directories -->
486                <xsl:for-each select="c:directory">
487                  <xsl:text>&#xa;&#xa;  </xsl:text>
488                  <xsl:element name="varlistentry">
489                    <xsl:attribute name="id">
490                      <xsl:text>dir</xsl:text>
491                      <xsl:value-of select="translate(c:name, '/', '-')" />
492                    </xsl:attribute>
493                   
494                    <!-- Term -->
495                    <xsl:text>&#xa;    </xsl:text>
496                    <xsl:element name="term">
497                      <xsl:element name="filename">
498                        <xsl:attribute name="class">
499                          <xsl:text>directory</xsl:text>
500                        </xsl:attribute>
501                        <xsl:value-of select="c:name" />
502                      </xsl:element>
503                    </xsl:element>
504                    <!-- End Term -->
505                   
506                    <!-- List Item -->
507                    <xsl:text>&#xa;    </xsl:text>
508                    <xsl:element name="listitem">
509                     
510                      <xsl:text>&#xa;      </xsl:text>
511                      <xsl:element name="para">
512                        <xsl:apply-templates select="c:description/@*|c:description/node()" />
513                      </xsl:element>
514                     
515                      <xsl:text>&#xa;      </xsl:text>
516                      <xsl:element name="indexterm">
517                        <xsl:attribute name="zone">
518                          <xsl:value-of select="$id" />
519                          <xsl:text> dir</xsl:text>
520                          <xsl:value-of select="translate(c:name, '/', '-')" />
521                        </xsl:attribute>
522                        <xsl:text>&#xa;        </xsl:text>
523                        <xsl:element name="primary">
524                          <xsl:attribute name="sortas">
525                            <xsl:text>e-</xsl:text>
526                            <xsl:value-of select="c:name" />
527                          </xsl:attribute>
528                          <xsl:value-of select="c:name" />
529                        </xsl:element>
530                        <xsl:text>&#xa;      </xsl:text>
531                      </xsl:element>
532                     
533                      <xsl:text>&#xa;    </xsl:text>
534                    </xsl:element><!-- listitem -->
535                    <!-- End List Item -->
536                   
537                    <xsl:text>&#xa;  </xsl:text>
538                  </xsl:element><!-- varlistentry -->
539                </xsl:for-each>
540                <!-- End the Short Desc For-Each for Directories -->
541               
542                <xsl:text>&#xa;&#xa;</xsl:text>
543              </xsl:element><!-- variablelist -->
544              <!-- End Short Desc List -->
545            </xsl:otherwise>
546          </xsl:choose>
547         
548          <xsl:text>&#xa;&#xa;</xsl:text>
549        </xsl:element><!-- sect2 -->
550      </xsl:for-each><!-- c:contents -> sect2 -->
551
552      <xsl:text>&#xa;&#xa;</xsl:text>
553
554    </xsl:element><!-- Sect1 -->
555
556  </xsl:template><!-- package-stub -->
557
558  <!-- Apply the profile to the 32bit package -->
559 
560  <xsl:template match="c:para" mode="filter-bits-32">
561    <xsl:variable name="ismultilib">
562      <xsl:choose>
563        <xsl:when test="contains($clfs.multilib, ',')">
564          <xsl:text>true</xsl:text>
565        </xsl:when>
566        <xsl:otherwise>
567          <xsl:text>false</xsl:text>
568        </xsl:otherwise>
569      </xsl:choose>
570    </xsl:variable>
571    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
572      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
573        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
574          <xsl:element name="para">
575            <xsl:apply-templates select="node()" mode="filter-bits-32" />
576          </xsl:element>
577        </xsl:if>
578      </xsl:if>
579    </xsl:if>
580  </xsl:template>
581
582  <xsl:template match="c:install/c:command" mode="filter-bits-32">
583    <xsl:variable name="ismultilib">
584      <xsl:choose>
585        <xsl:when test="contains($clfs.multilib, ',')">
586          <xsl:text>true</xsl:text>
587        </xsl:when>
588        <xsl:otherwise>
589          <xsl:text>false</xsl:text>
590        </xsl:otherwise>
591      </xsl:choose>
592    </xsl:variable>
593    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
594      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
595        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
596          <xsl:element name="userinput">
597            <xsl:if test="@c:nodump = 'true'">
598              <xsl:attribute name="role">
599                <xsl:text>nodump</xsl:text>
600              </xsl:attribute>
601            </xsl:if>
602            <xsl:element name="screen">
603              <xsl:apply-templates select="@*|node()" mode="filter-bits-32" />
604            </xsl:element>
605          </xsl:element>
606        </xsl:if>
607      </xsl:if>
608    </xsl:if>
609  </xsl:template>
610 
611  <xsl:template match="c:literal" mode="filter-bits-32">
612    <xsl:variable name="ismultilib">
613      <xsl:choose>
614        <xsl:when test="contains($clfs.multilib, ',')">
615          <xsl:text>true</xsl:text>
616        </xsl:when>
617        <xsl:otherwise>
618          <xsl:text>false</xsl:text>
619        </xsl:otherwise>
620      </xsl:choose>
621    </xsl:variable>
622    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
623      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
624        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
625          <xsl:element name="literal">
626            <xsl:apply-templates select="node()" mode="filter-bits-32" />
627          </xsl:element>
628        </xsl:if>
629      </xsl:if>
630    </xsl:if>
631  </xsl:template>
632 
633  <xsl:template match="c:replaceable" mode="filter-bits-32">
634    <xsl:variable name="ismultilib">
635      <xsl:choose>
636        <xsl:when test="contains($clfs.multilib, ',')">
637          <xsl:text>true</xsl:text>
638        </xsl:when>
639        <xsl:otherwise>
640          <xsl:text>false</xsl:text>
641        </xsl:otherwise>
642      </xsl:choose>
643    </xsl:variable>
644    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
645      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
646        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
647          <xsl:element name="replaceable">
648            <xsl:apply-templates select="node()" mode="filter-bits-32" />
649          </xsl:element>
650        </xsl:if>
651      </xsl:if>
652    </xsl:if>
653  </xsl:template>
654 
655  <xsl:template match="c:application" mode="filter-bits-32">
656    <xsl:variable name="ismultilib">
657      <xsl:choose>
658        <xsl:when test="contains($clfs.multilib, ',')">
659          <xsl:text>true</xsl:text>
660        </xsl:when>
661        <xsl:otherwise>
662          <xsl:text>false</xsl:text>
663        </xsl:otherwise>
664      </xsl:choose>
665    </xsl:variable>
666    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
667      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
668        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
669          <xsl:element name="application">
670            <xsl:apply-templates select="node()" mode="filter-bits-32" />
671          </xsl:element>
672        </xsl:if>
673      </xsl:if>
674    </xsl:if>
675  </xsl:template>
676 
677  <xsl:template match="c:dirname" mode="filter-bits-32">
678    <xsl:variable name="ismultilib">
679      <xsl:choose>
680        <xsl:when test="contains($clfs.multilib, ',')">
681          <xsl:text>true</xsl:text>
682        </xsl:when>
683        <xsl:otherwise>
684          <xsl:text>false</xsl:text>
685        </xsl:otherwise>
686      </xsl:choose>
687    </xsl:variable>
688    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
689      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
690        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
691          <xsl:element name="filename">
692            <xsl:attribute name="class">
693              <xsl:text>directory</xsl:text>
694            </xsl:attribute>
695            <xsl:apply-templates select="node()" mode="filter-bits-32" />
696          </xsl:element>
697        </xsl:if>
698      </xsl:if>
699    </xsl:if>
700  </xsl:template>
701 
702  <xsl:template match="c:filename" mode="filter-bits-32">
703    <xsl:variable name="ismultilib">
704      <xsl:choose>
705        <xsl:when test="contains($clfs.multilib, ',')">
706          <xsl:text>true</xsl:text>
707        </xsl:when>
708        <xsl:otherwise>
709          <xsl:text>false</xsl:text>
710        </xsl:otherwise>
711      </xsl:choose>
712    </xsl:variable>
713    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
714      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
715        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
716          <xsl:element name="filename">
717            <xsl:apply-templates select="node()" mode="filter-bits-32" />
718          </xsl:element>
719        </xsl:if>
720      </xsl:if>
721    </xsl:if>
722  </xsl:template>
723 
724  <xsl:template match="c:command" mode="filter-bits-32">
725    <xsl:variable name="ismultilib">
726      <xsl:choose>
727        <xsl:when test="contains($clfs.multilib, ',')">
728          <xsl:text>true</xsl:text>
729        </xsl:when>
730        <xsl:otherwise>
731          <xsl:text>false</xsl:text>
732        </xsl:otherwise>
733      </xsl:choose>
734    </xsl:variable>
735    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
736      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
737        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',32,')">
738          <xsl:element name="command">
739            <xsl:apply-templates select="node()" mode="filter-bits-32" />
740          </xsl:element>
741        </xsl:if>
742      </xsl:if>
743    </xsl:if>
744  </xsl:template>
745
746  <xsl:template match="@c:arch" mode="filter-bits-32" />
747  <xsl:template match="@c:bits" mode="filter-bits-32" />
748  <xsl:template match="@c:multilib" mode="filter-bits-32" />
749
750  <!-- Apply the profile to the n32 package -->
751 
752  <xsl:template match="c:para" mode="filter-bits-n32">
753    <xsl:variable name="ismultilib">
754      <xsl:choose>
755        <xsl:when test="contains($clfs.multilib, ',')">
756          <xsl:text>true</xsl:text>
757        </xsl:when>
758        <xsl:otherwise>
759          <xsl:text>false</xsl:text>
760        </xsl:otherwise>
761      </xsl:choose>
762    </xsl:variable>
763    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
764      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
765        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
766          <xsl:element name="para">
767            <xsl:apply-templates select="node()" mode="filter-bits-n32" />
768          </xsl:element>
769        </xsl:if>
770      </xsl:if>
771    </xsl:if>
772  </xsl:template>
773
774  <xsl:template match="c:install/c:command" mode="filter-bits-n32">
775    <xsl:variable name="ismultilib">
776      <xsl:choose>
777        <xsl:when test="contains($clfs.multilib, ',')">
778          <xsl:text>true</xsl:text>
779        </xsl:when>
780        <xsl:otherwise>
781          <xsl:text>false</xsl:text>
782        </xsl:otherwise>
783      </xsl:choose>
784    </xsl:variable>
785    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
786      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
787        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
788          <xsl:element name="userinput">
789            <xsl:if test="@c:nodump = 'true'">
790              <xsl:attribute name="role">
791                <xsl:text>nodump</xsl:text>
792              </xsl:attribute>
793            </xsl:if>
794            <xsl:element name="screen">
795              <xsl:apply-templates select="@*|node()" mode="filter-bits-n32" />
796            </xsl:element>
797          </xsl:element>
798        </xsl:if>
799      </xsl:if>
800    </xsl:if>
801  </xsl:template>
802 
803  <xsl:template match="c:literal" mode="filter-bits-n32">
804    <xsl:variable name="ismultilib">
805      <xsl:choose>
806        <xsl:when test="contains($clfs.multilib, ',')">
807          <xsl:text>true</xsl:text>
808        </xsl:when>
809        <xsl:otherwise>
810          <xsl:text>false</xsl:text>
811        </xsl:otherwise>
812      </xsl:choose>
813    </xsl:variable>
814    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
815      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
816        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
817          <xsl:element name="literal">
818            <xsl:apply-templates select="node()" mode="filter-bits-n32" />
819          </xsl:element>
820        </xsl:if>
821      </xsl:if>
822    </xsl:if>
823  </xsl:template>
824 
825  <xsl:template match="c:replaceable" mode="filter-bits-n32">
826    <xsl:variable name="ismultilib">
827      <xsl:choose>
828        <xsl:when test="contains($clfs.multilib, ',')">
829          <xsl:text>true</xsl:text>
830        </xsl:when>
831        <xsl:otherwise>
832          <xsl:text>false</xsl:text>
833        </xsl:otherwise>
834      </xsl:choose>
835    </xsl:variable>
836    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
837      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
838        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
839          <xsl:element name="replaceable">
840            <xsl:apply-templates select="node()" mode="filter-bits-n32" />
841          </xsl:element>
842        </xsl:if>
843      </xsl:if>
844    </xsl:if>
845  </xsl:template>
846 
847  <xsl:template match="c:application" mode="filter-bits-n32">
848    <xsl:variable name="ismultilib">
849      <xsl:choose>
850        <xsl:when test="contains($clfs.multilib, ',')">
851          <xsl:text>true</xsl:text>
852        </xsl:when>
853        <xsl:otherwise>
854          <xsl:text>false</xsl:text>
855        </xsl:otherwise>
856      </xsl:choose>
857    </xsl:variable>
858    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
859      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
860        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
861          <xsl:element name="application">
862            <xsl:apply-templates select="node()" mode="filter-bits-n32" />
863          </xsl:element>
864        </xsl:if>
865      </xsl:if>
866    </xsl:if>
867  </xsl:template>
868 
869  <xsl:template match="c:dirname" mode="filter-bits-n32">
870    <xsl:variable name="ismultilib">
871      <xsl:choose>
872        <xsl:when test="contains($clfs.multilib, ',')">
873          <xsl:text>true</xsl:text>
874        </xsl:when>
875        <xsl:otherwise>
876          <xsl:text>false</xsl:text>
877        </xsl:otherwise>
878      </xsl:choose>
879    </xsl:variable>
880    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
881      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
882        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
883          <xsl:element name="filename">
884            <xsl:attribute name="class">
885              <xsl:text>directory</xsl:text>
886            </xsl:attribute>
887            <xsl:apply-templates select="node()" mode="filter-bits-n32" />
888          </xsl:element>
889        </xsl:if>
890      </xsl:if>
891    </xsl:if>
892  </xsl:template>
893 
894  <xsl:template match="c:filename" mode="filter-bits-n32">
895    <xsl:variable name="ismultilib">
896      <xsl:choose>
897        <xsl:when test="contains($clfs.multilib, ',')">
898          <xsl:text>true</xsl:text>
899        </xsl:when>
900        <xsl:otherwise>
901          <xsl:text>false</xsl:text>
902        </xsl:otherwise>
903      </xsl:choose>
904    </xsl:variable>
905    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
906      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
907        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
908          <xsl:element name="filename">
909            <xsl:apply-templates select="node()" mode="filter-bits-n32" />
910          </xsl:element>
911        </xsl:if>
912      </xsl:if>
913    </xsl:if>
914  </xsl:template>
915 
916  <xsl:template match="c:command" mode="filter-bits-n32">
917    <xsl:variable name="ismultilib">
918      <xsl:choose>
919        <xsl:when test="contains($clfs.multilib, ',')">
920          <xsl:text>true</xsl:text>
921        </xsl:when>
922        <xsl:otherwise>
923          <xsl:text>false</xsl:text>
924        </xsl:otherwise>
925      </xsl:choose>
926    </xsl:variable>
927    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
928      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
929        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',n32,')">
930          <xsl:element name="command">
931            <xsl:apply-templates select="node()" mode="filter-bits-n32" />
932          </xsl:element>
933        </xsl:if>
934      </xsl:if>
935    </xsl:if>
936  </xsl:template>
937
938  <xsl:template match="@c:arch" mode="filter-bits-n32" />
939  <xsl:template match="@c:bits" mode="filter-bits-n32" />
940  <xsl:template match="@c:multilib" mode="filter-bits-n32" />
941
942  <!-- Apply the profile to the 64bit package -->
943 
944  <xsl:template match="c:para" mode="filter-bits-64">
945    <xsl:variable name="ismultilib">
946      <xsl:choose>
947        <xsl:when test="contains($clfs.multilib, ',')">
948          <xsl:text>true</xsl:text>
949        </xsl:when>
950        <xsl:otherwise>
951          <xsl:text>false</xsl:text>
952        </xsl:otherwise>
953      </xsl:choose>
954    </xsl:variable>
955    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
956      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
957        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
958          <xsl:element name="para">
959            <xsl:apply-templates select="node()" mode="filter-bits-64" />
960          </xsl:element>
961        </xsl:if>
962      </xsl:if>
963    </xsl:if>
964  </xsl:template>
965
966  <xsl:template match="c:install/c:command" mode="filter-bits-64">
967    <xsl:variable name="ismultilib">
968      <xsl:choose>
969        <xsl:when test="contains($clfs.multilib, ',')">
970          <xsl:text>true</xsl:text>
971        </xsl:when>
972        <xsl:otherwise>
973          <xsl:text>false</xsl:text>
974        </xsl:otherwise>
975      </xsl:choose>
976    </xsl:variable>
977    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
978      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
979        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
980          <xsl:element name="userinput">
981            <xsl:if test="@c:nodump = 'true'">
982              <xsl:attribute name="role">
983                <xsl:text>nodump</xsl:text>
984              </xsl:attribute>
985            </xsl:if>
986            <xsl:element name="screen">
987              <xsl:apply-templates select="@*|node()" mode="filter-bits-64" />
988            </xsl:element>
989          </xsl:element>
990        </xsl:if>
991      </xsl:if>
992    </xsl:if>
993  </xsl:template>
994 
995  <xsl:template match="c:literal" mode="filter-bits-64">
996    <xsl:variable name="ismultilib">
997      <xsl:choose>
998        <xsl:when test="contains($clfs.multilib, ',')">
999          <xsl:text>true</xsl:text>
1000        </xsl:when>
1001        <xsl:otherwise>
1002          <xsl:text>false</xsl:text>
1003        </xsl:otherwise>
1004      </xsl:choose>
1005    </xsl:variable>
1006    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
1007      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
1008        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
1009          <xsl:element name="literal">
1010            <xsl:apply-templates select="node()" mode="filter-bits-64" />
1011          </xsl:element>
1012        </xsl:if>
1013      </xsl:if>
1014    </xsl:if>
1015  </xsl:template>
1016 
1017  <xsl:template match="c:replaceable" mode="filter-bits-64">
1018    <xsl:variable name="ismultilib">
1019      <xsl:choose>
1020        <xsl:when test="contains($clfs.multilib, ',')">
1021          <xsl:text>true</xsl:text>
1022        </xsl:when>
1023        <xsl:otherwise>
1024          <xsl:text>false</xsl:text>
1025        </xsl:otherwise>
1026      </xsl:choose>
1027    </xsl:variable>
1028    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
1029      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
1030        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
1031          <xsl:element name="replaceable">
1032            <xsl:apply-templates select="node()" mode="filter-bits-64" />
1033          </xsl:element>
1034        </xsl:if>
1035      </xsl:if>
1036    </xsl:if>
1037  </xsl:template>
1038 
1039  <xsl:template match="c:application" mode="filter-bits-64">
1040    <xsl:variable name="ismultilib">
1041      <xsl:choose>
1042        <xsl:when test="contains($clfs.multilib, ',')">
1043          <xsl:text>true</xsl:text>
1044        </xsl:when>
1045        <xsl:otherwise>
1046          <xsl:text>false</xsl:text>
1047        </xsl:otherwise>
1048      </xsl:choose>
1049    </xsl:variable>
1050    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
1051      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
1052        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
1053          <xsl:element name="application">
1054            <xsl:apply-templates select="node()" mode="filter-bits-64" />
1055          </xsl:element>
1056        </xsl:if>
1057      </xsl:if>
1058    </xsl:if>
1059  </xsl:template>
1060 
1061  <xsl:template match="c:dirname" mode="filter-bits-64">
1062    <xsl:variable name="ismultilib">
1063      <xsl:choose>
1064        <xsl:when test="contains($clfs.multilib, ',')">
1065          <xsl:text>true</xsl:text>
1066        </xsl:when>
1067        <xsl:otherwise>
1068          <xsl:text>false</xsl:text>
1069        </xsl:otherwise>
1070      </xsl:choose>
1071    </xsl:variable>
1072    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
1073      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
1074        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
1075          <xsl:element name="filename">
1076            <xsl:attribute name="class">
1077              <xsl:text>directory</xsl:text>
1078            </xsl:attribute>
1079            <xsl:apply-templates select="node()" mode="filter-bits-64" />
1080          </xsl:element>
1081        </xsl:if>
1082      </xsl:if>
1083    </xsl:if>
1084  </xsl:template>
1085 
1086  <xsl:template match="c:filename" mode="filter-bits-64">
1087    <xsl:variable name="ismultilib">
1088      <xsl:choose>
1089        <xsl:when test="contains($clfs.multilib, ',')">
1090          <xsl:text>true</xsl:text>
1091        </xsl:when>
1092        <xsl:otherwise>
1093          <xsl:text>false</xsl:text>
1094        </xsl:otherwise>
1095      </xsl:choose>
1096    </xsl:variable>
1097    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
1098      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
1099        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
1100          <xsl:element name="filename">
1101            <xsl:apply-templates select="node()" mode="filter-bits-64" />
1102          </xsl:element>
1103        </xsl:if>
1104      </xsl:if>
1105    </xsl:if>
1106  </xsl:template>
1107 
1108  <xsl:template match="c:command" mode="filter-bits-64">
1109    <xsl:variable name="ismultilib">
1110      <xsl:choose>
1111        <xsl:when test="contains($clfs.multilib, ',')">
1112          <xsl:text>true</xsl:text>
1113        </xsl:when>
1114        <xsl:otherwise>
1115          <xsl:text>false</xsl:text>
1116        </xsl:otherwise>
1117      </xsl:choose>
1118    </xsl:variable>
1119    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
1120      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
1121        <xsl:if test="(string-length(@c:bits) = 0) or contains(concat(',',@c:bits,','), ',64,')">
1122          <xsl:element name="command">
1123            <xsl:apply-templates select="node()" mode="filter-bits-64" />
1124          </xsl:element>
1125        </xsl:if>
1126      </xsl:if>
1127    </xsl:if>
1128  </xsl:template>
1129
1130  <xsl:template match="@c:arch" mode="filter-bits-64" />
1131  <xsl:template match="@c:bits" mode="filter-bits-64" />
1132  <xsl:template match="@c:multilib" mode="filter-bits-64" />
1133
1134  <!-- Apply the profile filter to the entire document -->
1135  <xsl:template match="//*[@c:arch]|//*[@c:multilib]">
1136    <xsl:variable name="ismultilib">
1137      <xsl:choose>
1138        <xsl:when test="contains($clfs.multilib, ',')">
1139          <xsl:text>true</xsl:text>
1140        </xsl:when>
1141        <xsl:otherwise>
1142          <xsl:text>false</xsl:text>
1143        </xsl:otherwise>
1144      </xsl:choose>
1145    </xsl:variable>
1146    <xsl:if test="(string-length(@c:arch) = 0) or contains(concat(',',@c:arch,','), concat(',', $clfs.arch, ','))">
1147      <xsl:if test="(string-length(@c:multilib) = 0) or contains(concat(',',@c:multilib,','), concat(',', $ismultilib, ','))">
1148        <xsl:copy>
1149          <xsl:apply-templates select="@*|node()" />
1150        </xsl:copy>
1151      </xsl:if>
1152    </xsl:if>
1153  </xsl:template>
1154
1155  <!-- Remove the profileing attributes for the remaining objects -->
1156  <xsl:template match="@c:arch" />
1157  <xsl:template match="@c:bits" />
1158  <xsl:template match="@c:multilib" />
1159
1160</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.