Changeset 5508d22


Ignore:
Timestamp:
Mar 5, 2011, 8:48:28 PM (14 years ago)
Author:
Joe Ciccone <jciccone@…>
Children:
5171adc
Parents:
4a39252
Message:

Automatically add the suffix to the title containing the bitsize on multilib.

Location:
BOOK
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • BOOK/stylesheets/clfs-profile.xsl

    r4a39252 r5508d22  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    3   xmlns="http://www.w3.org/1999/xhtml"
    43  xmlns:c="http://schema.cross-lfs.org/book"
    54  version="1.0">
     
    5049          </xsl:with-param>
    5150          <xsl:with-param name="bits" select="substring-before(concat($bits, ','), ',')" />
     51          <xsl:with-param name="multi"><xsl:text>multi</xsl:text></xsl:with-param>
    5252        </xsl:call-template>
    5353        <xsl:if test="$remainingbits">
     
    6767          <xsl:with-param name="idsuffix" />
    6868          <xsl:with-param name="bits" select="substring-before(concat($bits, ','), ',')" />
     69          <xsl:with-param name="multi"><xsl:text>single</xsl:text></xsl:with-param>
    6970        </xsl:call-template>
    7071      </xsl:otherwise>
     
    7677    <xsl:param name="idsuffix" /> <!-- Suffix to attach to the end of the ID for this perticular instance -->
    7778    <xsl:param name="bits" /> <!-- Which bit sizes to create a package for -->
     79    <xsl:param name="multi" /> <!-- multi/single build -->
    7880
    7981    <xsl:for-each select="sect1">
    80 
    8182      <xsl:copy>
    8283        <xsl:attribute name="id">
     
    8586        <xsl:attribute name="role">
    8687          <xsl:text>package</xsl:text>
     88        </xsl:attribute>
     89        <xsl:attribute name="condition">
     90          <xsl:value-of select="$multi" />
    8791        </xsl:attribute>
    8892        <xsl:processing-instruction name="dbhtml">
     
    108112  <!-- Apply the profile to the 32bit package -->
    109113
     114  <xsl:template match="//sect1/title" mode="filter-bits-32">
     115    <xsl:element name="title">
     116      <xsl:copy-of select="@*|node()" />
     117      <xsl:if test="contains($clfs.multilib, ',')">
     118        <xsl:text> - 32Bit</xsl:text>
     119      </xsl:if>
     120    </xsl:element>
     121  </xsl:template>
     122
    110123  <xsl:template match="@*|node()" mode="filter-bits-32">
    111124    <xsl:variable name="ismultilib">
     
    135148
    136149  <!-- Apply the profile to the n32 package -->
     150 
     151  <xsl:template match="//sect1/title" mode="filter-bits-n32">
     152    <xsl:element name="title">
     153      <xsl:copy-of select="@*|node()" />
     154      <xsl:if test="contains($clfs.multilib, ',')">
     155        <xsl:text> - N32</xsl:text>
     156      </xsl:if>
     157    </xsl:element>
     158  </xsl:template>
    137159
    138160  <xsl:template match="@*|node()" mode="filter-bits-n32">
     
    163185
    164186  <!-- Apply the profile to the 64bit package -->
     187 
     188  <xsl:template match="//sect1/title" mode="filter-bits-64">
     189    <xsl:element name="title">
     190      <xsl:copy-of select="@*|node()" />
     191      <xsl:if test="contains($clfs.multilib, ',')">
     192        <xsl:text> - 64Bit</xsl:text>
     193      </xsl:if>
     194    </xsl:element>
     195  </xsl:template>
    165196
    166197  <xsl:template match="@*|node()" mode="filter-bits-64">
  • BOOK/testpart.xml

    r4a39252 r5508d22  
    2323      <c:package id="blah" c:multibuild="false">
    2424        <sect1>
    25           <title>Blah</title>
     25          <title><phrase>Blah</phrase></title>
    2626
    2727          <para>Testing... 1.. 2.. 3..</para>
     28
     29          <para c:bits="32">32</para>
     30          <para c:bits="n32">n32</para>
     31          <para c:bits="64">64</para>
    2832
    2933        </sect1>
     
    3236      <c:package id="blarg" c:multibuild="true">
    3337        <sect1>
    34           <title>Blarg
    35             <phrase c:multilib="true">
    36               <phrase c:bits="32"> - 32Bit</phrase>
    37               <phrase c:bits="n32"> - N32</phrase>
    38               <phrase c:bits="64"> - 64Bit</phrase>
    39             </phrase>
    40           </title>
     38          <title>Blarg</title>
    4139
    4240          <para>Testing... 1.. 2.. 3..</para>
Note: See TracChangeset for help on using the changeset viewer.