Changeset 7b0cc7e8


Ignore:
Timestamp:
Mar 6, 2011, 7:26:52 PM (13 years ago)
Author:
Joe Ciccone <jciccone@…>
Children:
af43a09
Parents:
33cb2bd
Message:

Automatically generate the indexterm element from the title. This will
need to be changed in the future because a real package will have a
version number attached to the title.

File:
1 edited

Legend:

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

    r33cb2bd r7b0cc7e8  
    8787        </xsl:processing-instruction>
    8888
     89        <xsl:variable name="titlesuffix">
     90          <xsl:if test="contains($clfs.multilib, ',') and ($multibuild = 'true')">
     91            <xsl:choose>
     92              <xsl:when test="$bits = '32'">
     93                <xsl:text>32Bit</xsl:text>
     94              </xsl:when>
     95              <xsl:when test="$bits = 'n32'">
     96                <xsl:text>N32</xsl:text>
     97              </xsl:when>
     98              <xsl:when test="$bits = '64'">
     99                <xsl:text>64Bit</xsl:text>
     100              </xsl:when>
     101            </xsl:choose>
     102          </xsl:if>
     103        </xsl:variable>
     104
    89105        <xsl:for-each select="title">
    90106          <xsl:element name="title">
    91107            <xsl:copy-of select="@*|node()" />
    92             <xsl:if test="contains($clfs.multilib, ',') and ($multibuild = 'true')">
     108            <xsl:if test="string-length($titlesuffix) > 0">
    93109              <xsl:text> - </xsl:text>
    94               <xsl:choose>
    95                 <xsl:when test="$bits = '32'">
    96                   <xsl:text>32Bit</xsl:text>
    97                 </xsl:when>
    98                 <xsl:when test="$bits = 'n32'">
    99                   <xsl:text>N32</xsl:text>
    100                 </xsl:when>
    101                 <xsl:when test="$bits = '64'">
    102                   <xsl:text>64Bit</xsl:text>
    103                 </xsl:when>
    104               </xsl:choose>
     110              <xsl:value-of select="$titlesuffix"/>
    105111            </xsl:if>
    106112          </xsl:element>
    107113        </xsl:for-each>
     114
     115        <xsl:element name="indexterm">
     116          <xsl:attribute name="zone">
     117            <xsl:value-of select="concat($id, $idsuffix)" />
     118          </xsl:attribute>
     119          <xsl:element name="primary">
     120            <xsl:attribute name="sortas">
     121              <xsl:text>a-</xsl:text>
     122              <xsl:value-of select="title" />
     123            </xsl:attribute>
     124            <xsl:value-of select="title" />
     125          </xsl:element>
     126          <xsl:if test="string-length($titlesuffix) > 0">
     127            <xsl:element name="secondary">
     128              <xsl:value-of select="$titlesuffix" />
     129            </xsl:element>
     130          </xsl:if>
     131        </xsl:element>
    108132
    109133        <xsl:choose>
Note: See TracChangeset for help on using the changeset viewer.