Changeset 8067

Show
Ignore:
Timestamp:
04/16/07 14:49:55 (1 year ago)
Author:
manuel
Message:

Added support for role="root" to screen.
Added revhistory templates.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/new-xsl/xhtml/lfs-mixed.xsl

    r8050 r8067  
    4646  <xsl:template match="screen"> 
    4747    <xsl:choose> 
     48      <xsl:when test="@role = 'root'"> 
     49        <pre class="root"> 
     50          <xsl:apply-templates/> 
     51        </pre> 
     52      </xsl:when> 
    4853      <xsl:when test="child::* = userinput"> 
    4954        <pre class="userinput"> 
    50             <xsl:apply-templates/> 
     55          <xsl:apply-templates/> 
    5156        </pre> 
    5257      </xsl:when> 
     
    8994      <strong> 
    9095        <span class="segtitle"> 
    91           <xsl:apply-templates select="$segtitles[$segnum=position()]" mode="segtitle-in-seg"/> 
     96          <xsl:apply-templates select="$segtitles[$segnum=position()]" 
     97                               mode="segtitle-in-seg"/> 
    9298          <xsl:text>: </xsl:text> 
    9399        </span> 
     
    173179         or other titles that may already be represented with <strong>'s. --> 
    174180    <xsl:choose> 
    175       <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' 
    176                       or local-name(../..) = 'example' or local-name(../..) = 'table' 
    177                       or local-name(../..) = 'formalpara')"> 
     181      <xsl:when test="local-name(..)='title' and (local-name(../..)='figure' 
     182                      or local-name(../..)='example' or local-name(../..)='table' 
     183                      or local-name(../..)='formalpara')"> 
    178184        <tt> 
    179185          <xsl:apply-templates select="." mode="class.attribute"/> 
     
    221227  </xsl:template> 
    222228 
     229  <!-- Revision History --> 
     230 
     231    <!-- revhistory mode titlepage.mode: 
     232           Removed hardcoded style attributes. 
     233           Removed support for separate revhistory file. --> 
     234    <!-- The original template is in {docbook-xsl}/xhtml/titlepage.xsl --> 
     235  <xsl:template match="revhistory" mode="titlepage.mode"> 
     236    <xsl:variable name="numcols"> 
     237      <xsl:choose> 
     238        <xsl:when test="//authorinitials">4</xsl:when> 
     239        <xsl:otherwise>3</xsl:otherwise> 
     240      </xsl:choose> 
     241    </xsl:variable> 
     242    <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> 
     243    <xsl:variable name="title"> 
     244      <xsl:call-template name="gentext"> 
     245        <xsl:with-param name="key">RevHistory</xsl:with-param> 
     246      </xsl:call-template> 
     247    </xsl:variable> 
     248    <xsl:variable name="contents"> 
     249      <div class="{name(.)}"> 
     250        <table summary="Revision history"> 
     251          <tr> 
     252            <th colspan="{$numcols}"> 
     253              <b> 
     254                <xsl:call-template name="gentext"> 
     255                  <xsl:with-param name="key" select="'RevHistory'"/> 
     256                </xsl:call-template> 
     257              </b> 
     258            </th> 
     259          </tr> 
     260          <xsl:apply-templates mode="titlepage.mode"> 
     261            <xsl:with-param name="numcols" select="$numcols"/> 
     262          </xsl:apply-templates> 
     263        </table> 
     264      </div> 
     265    </xsl:variable> 
     266    <xsl:copy-of select="$contents"/> 
     267  </xsl:template> 
     268 
     269    <!-- revhistory/revision mode titlepage.mode: 
     270           Removed hardcoded style attributes. --> 
     271    <!-- The original template is in {docbook-xsl}/xhtml/titlepage.xsl --> 
     272  <xsl:template match="revhistory/revision" mode="titlepage.mode"> 
     273    <xsl:param name="numcols" select="'3'"/> 
     274    <xsl:variable name="revnumber" select="revnumber"/> 
     275    <xsl:variable name="revdate" select="date"/> 
     276    <xsl:variable name="revauthor" select="authorinitials|author"/> 
     277    <xsl:variable name="revremark" select="revremark|revdescription"/> 
     278    <tr> 
     279      <td> 
     280        <xsl:if test="$revnumber"> 
     281          <xsl:call-template name="gentext"> 
     282            <xsl:with-param name="key" select="'Revision'"/> 
     283          </xsl:call-template> 
     284          <xsl:call-template name="gentext.space"/> 
     285          <xsl:apply-templates select="$revnumber[1]" mode="titlepage.mode"/> 
     286        </xsl:if> 
     287      </td> 
     288      <td> 
     289        <xsl:apply-templates select="$revdate[1]" mode="titlepage.mode"/> 
     290      </td> 
     291      <xsl:choose> 
     292        <xsl:when test="$revauthor"> 
     293          <td> 
     294            <xsl:for-each select="$revauthor"> 
     295              <xsl:apply-templates select="." mode="titlepage.mode"/> 
     296              <xsl:if test="position() != last()"> 
     297                <xsl:text>, </xsl:text> 
     298              </xsl:if> 
     299            </xsl:for-each> 
     300          </td> 
     301        </xsl:when> 
     302        <xsl:when test="$numcols &gt; 3"> 
     303          <td>&#160;</td> 
     304        </xsl:when> 
     305        <xsl:otherwise/> 
     306      </xsl:choose> 
     307      <td> 
     308        <xsl:apply-templates select="$revremark[1]" mode="titlepage.mode"/> 
     309      </td> 
     310    </tr> 
     311  </xsl:template> 
     312 
    223313</xsl:stylesheet>