Ignore:
Timestamp:
10/08/2013 08:03:29 PM (11 years ago)
Author:
Matthew Burgess <matthew@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 12.2, 12.2-rc1, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/loongarch-12.2, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
58675ce
Parents:
09a35dd
Message:

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 moved

Legend:

Unmodified
Added
Removed
  • stylesheets/lfs-xsl/docbook-xsl-1.78.1/xhtml-1_1/qandaset.xsl

    r09a35dd r15c7d39  
    55
    66<!-- ********************************************************************
    7      $Id$
     7     $Id: qandaset.xsl 9354 2012-05-12 23:29:36Z bobstayton $
    88     ********************************************************************
    99
     
    3030
    3131  <div>
    32     <xsl:apply-templates select="." mode="class.attribute"/>
     32    <xsl:apply-templates select="." mode="common.html.attributes"/>
     33    <xsl:call-template name="id.attribute">
     34      <xsl:with-param name="conditional" select="0"/>
     35    </xsl:call-template>
    3336    <xsl:apply-templates select="$title"/>
     37    <xsl:if test="not($title)">
     38      <!-- andhor is output on title if there is one -->
     39      <xsl:call-template name="anchor">
     40        <xsl:with-param name="conditional" select="0"/>
     41      </xsl:call-template>
     42    </xsl:if>
    3443    <xsl:if test="((contains($toc.params, 'toc') and $toc != '0') or $toc = '1')                   and not(ancestor::answer and not($qanda.nested.in.toc=0))">
    3544      <xsl:call-template name="process.qanda.toc"/>
     
    4554  </xsl:variable>
    4655  <xsl:element name="h{string(number($qalevel)+1)}" namespace="http://www.w3.org/1999/xhtml">
    47     <xsl:attribute name="class">
    48       <xsl:value-of select="local-name(.)"/>
    49     </xsl:attribute>
     56    <xsl:apply-templates select="." mode="class.attribute"/>
    5057    <xsl:call-template name="anchor">
    5158      <xsl:with-param name="node" select=".."/>
     
    6673  <xsl:if test="blockinfo/title|info/title|title">
    6774    <tr class="qandadiv">
    68       <td align="left" valign="top" colspan="2">
     75      <td align="{$direction.align.start}" valign="top" colspan="2">
    6976        <xsl:apply-templates select="(blockinfo/title|info/title|title)[1]"/>
    7077      </td>
     
    8491  <xsl:if test="(contains($toc.params, 'toc') and $toc != '0') or $toc = '1'">
    8592    <tr class="toc">
    86       <td align="left" valign="top" colspan="2">
     93      <td align="{$direction.align.start}" valign="top" colspan="2">
    8794        <xsl:call-template name="process.qanda.toc"/>
    8895      </td>
     
    9198  <xsl:if test="$preamble">
    9299    <tr class="toc">
    93       <td align="left" valign="top" colspan="2">
     100      <td align="{$direction.align.start}" valign="top" colspan="2">
    94101        <xsl:apply-templates select="$preamble"/>
    95102      </td>
     
    105112
    106113  <xsl:element name="h{string(number($qalevel)+1)}" namespace="http://www.w3.org/1999/xhtml">
    107     <xsl:attribute name="class">
    108       <xsl:value-of select="local-name(.)"/>
    109     </xsl:attribute>
     114    <xsl:apply-templates select="." mode="class.attribute"/>
     115    <xsl:call-template name="id.attribute">
     116      <xsl:with-param name="node" select=".."/>
     117      <xsl:with-param name="conditional" select="0"/>
     118    </xsl:call-template>
    110119    <xsl:call-template name="anchor">
    111120      <xsl:with-param name="node" select=".."/>
     
    127136<xsl:template match="question">
    128137  <xsl:variable name="deflabel">
    129     <xsl:choose>
    130       <xsl:when test="ancestor-or-self::*[@defaultlabel]">
    131         <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]                               /@defaultlabel"/>
    132       </xsl:when>
    133       <xsl:otherwise>
    134         <xsl:value-of select="$qanda.defaultlabel"/>
    135       </xsl:otherwise>
    136     </xsl:choose>
     138    <xsl:apply-templates select="." mode="qanda.defaultlabel"/>
    137139  </xsl:variable>
    138140
    139141  <tr>
    140     <xsl:apply-templates select="." mode="class.attribute"/>
    141     <td align="left" valign="top">
     142    <xsl:apply-templates select="." mode="common.html.attributes"/>
     143    <!-- capture the id of the  quandaentry -->
     144    <xsl:call-template name="id.attribute">
     145      <xsl:with-param name="node" select=".."/>
     146      <xsl:with-param name="conditional" select="0"/>
     147    </xsl:call-template>
     148    <td align="{$direction.align.start}" valign="top">
     149      <!-- and the id of the question too -->
     150      <xsl:call-template name="id.attribute">
     151        <xsl:with-param name="conditional" select="0"/>
     152      </xsl:call-template>
    142153      <xsl:call-template name="anchor">
    143154        <xsl:with-param name="node" select=".."/>
     
    149160
    150161      <xsl:variable name="label.content">
    151         <xsl:apply-templates select="." mode="label.markup"/>
    152         <xsl:if test="$deflabel = 'number' and not(label)">
    153           <xsl:apply-templates select="." mode="intralabel.punctuation"/>
    154         </xsl:if>
     162        <xsl:apply-templates select="." mode="qanda.label"/>
    155163      </xsl:variable>
    156164
    157165      <xsl:if test="string-length($label.content) &gt; 0">
    158         <p><b>
     166        <p><strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
    159167          <xsl:copy-of select="$label.content"/>
    160         </b></p>
     168        </strong></p>
    161169      </xsl:if>
    162170    </td>
    163     <td align="left" valign="top">
     171    <td align="{$direction.align.start}" valign="top">
    164172      <xsl:choose>
    165173        <xsl:when test="$deflabel = 'none' and not(label)">
    166           <b><xsl:apply-templates select="*[local-name(.) != 'label']"/></b>
     174          <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform"><xsl:apply-templates select="*[local-name(.) != 'label']"/></strong>
    167175        </xsl:when>
    168176        <xsl:otherwise>
     
    174182</xsl:template>
    175183
     184<xsl:template match="*" mode="qanda.defaultlabel">
     185  <xsl:choose>
     186    <xsl:when test="ancestor-or-self::*[@defaultlabel]">
     187      <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]                             /@defaultlabel"/>
     188    </xsl:when>
     189    <xsl:otherwise>
     190      <xsl:value-of select="$qanda.defaultlabel"/>
     191    </xsl:otherwise>
     192  </xsl:choose>
     193</xsl:template>
     194
     195<xsl:template match="question" mode="qanda.label">
     196  <xsl:variable name="deflabel">
     197    <xsl:apply-templates select="." mode="qanda.defaultlabel"/>
     198  </xsl:variable>
     199  <xsl:apply-templates select="." mode="label.markup"/>
     200  <xsl:if test="contains($deflabel, 'number') and not(label)">
     201    <xsl:apply-templates select="." mode="intralabel.punctuation"/>
     202  </xsl:if>
     203</xsl:template>
     204
    176205<xsl:template match="answer">
    177206  <xsl:variable name="deflabel">
    178     <xsl:choose>
    179       <xsl:when test="ancestor-or-self::*[@defaultlabel]">
    180         <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]                               /@defaultlabel"/>
    181       </xsl:when>
    182       <xsl:otherwise>
    183         <xsl:value-of select="$qanda.defaultlabel"/>
    184       </xsl:otherwise>
    185     </xsl:choose>
    186   </xsl:variable>
    187 
    188   <tr class="{local-name(.)}">
    189     <td align="left" valign="top">
     207    <xsl:apply-templates select="." mode="qanda.defaultlabel"/>
     208  </xsl:variable>
     209
     210  <tr>
     211    <xsl:apply-templates select="." mode="common.html.attributes"/>
     212    <xsl:call-template name="id.attribute"/>
     213    <td align="{$direction.align.start}" valign="top">
    190214      <xsl:call-template name="anchor"/>
    191215      <xsl:variable name="answer.label">
     
    193217      </xsl:variable>
    194218      <xsl:if test="string-length($answer.label) &gt; 0">
    195         <p><b>
     219        <p><strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
    196220          <xsl:copy-of select="$answer.label"/>
    197         </b></p>
     221        </strong></p>
    198222      </xsl:if>
    199223    </td>
    200     <td align="left" valign="top">
     224    <td align="{$direction.align.start}" valign="top">
    201225      <xsl:apply-templates select="*[local-name(.) != 'label'         and local-name(.) != 'qandaentry']"/>
    202226      <!-- * handle nested answer/qandaentry instances -->
     
    209233</xsl:template>
    210234
     235<xsl:template match="answer" mode="qanda.label">
     236  <xsl:apply-templates select="." mode="label.markup"/>
     237</xsl:template>
     238
    211239<xsl:template match="label">
    212240  <xsl:apply-templates/>
     
    239267  </xsl:variable>
    240268
    241   <xsl:apply-templates select="parent::qandadiv" mode="label.markup"/>
    242   <xsl:value-of select="$autotoc.label.separator"/>
     269  <xsl:variable name="div.label">
     270    <xsl:apply-templates select="parent::qandadiv" mode="label.markup"/>
     271  </xsl:variable>
     272  <xsl:if test="string-length($div.label) != 0">
     273    <xsl:copy-of select="$div.label"/>
     274    <xsl:value-of select="$autotoc.label.separator"/>
     275  </xsl:if>
    243276  <xsl:text> </xsl:text>
    244277  <a>
     
    264297<xsl:template match="question" mode="qandatoc.mode">
    265298  <xsl:variable name="firstch">
    266     <xsl:apply-templates select="(*[local-name(.)!='label'])[1]"/>
     299    <!-- Use a titleabbrev or title if available -->
     300    <xsl:choose>
     301      <xsl:when test="../blockinfo/titleabbrev">
     302        <xsl:apply-templates select="../blockinfo/titleabbrev[1]/node()"/>
     303      </xsl:when>
     304      <xsl:when test="../blockinfo/title">
     305        <xsl:apply-templates select="../blockinfo/title[1]/node()"/>
     306      </xsl:when>
     307      <xsl:when test="../info/titleabbrev">
     308        <xsl:apply-templates select="../info/titleabbrev[1]/node()"/>
     309      </xsl:when>
     310      <xsl:when test="../titleabbrev">
     311        <xsl:apply-templates select="../titleabbrev[1]/node()"/>
     312      </xsl:when>
     313      <xsl:when test="../info/title">
     314        <xsl:apply-templates select="../info/title[1]/node()"/>
     315      </xsl:when>
     316      <xsl:when test="../title">
     317        <xsl:apply-templates select="../title[1]/node()"/>
     318      </xsl:when>
     319      <xsl:otherwise>
     320        <xsl:apply-templates select="(*[local-name(.)!='label'])[1]/node()"/>
     321      </xsl:otherwise>
     322    </xsl:choose>
    267323  </xsl:variable>
    268324  <xsl:variable name="deflabel">
     
    279335  <dt>
    280336    <xsl:apply-templates select="." mode="label.markup"/>
    281     <xsl:if test="$deflabel = 'number' and not(label)">
     337    <xsl:if test="contains($deflabel,'number') and not(label)">
    282338      <xsl:apply-templates select="." mode="intralabel.punctuation"/>
    283339    </xsl:if>
     
    310366<xsl:template name="process.qandaset">
    311367
     368  <xsl:variable name="deflabel">
     369    <xsl:apply-templates select="." mode="qanda.defaultlabel"/>
     370  </xsl:variable>
     371
    312372  <xsl:variable name="label-width">
    313373    <xsl:call-template name="pi.dbhtml_label-width"/>
     
    326386  </xsl:variable>
    327387
    328   <table border="0" summary="Q and A Set">
     388  <table border="{$table.border.off}">
     389    <xsl:if test="$css.decoration != 0">
     390      <xsl:attribute name="style">width: 100%;</xsl:attribute>
     391    </xsl:if>
    329392    <xsl:if test="$table-summary != ''">
    330393      <xsl:attribute name="summary">
     
    345408    </xsl:if>
    346409
    347     <col align="left">
    348       <xsl:attribute name="width">
    349         <xsl:choose>
    350           <xsl:when test="$label-width != ''">
    351             <xsl:value-of select="$label-width"/>
    352           </xsl:when>
    353           <xsl:otherwise>1%</xsl:otherwise>
    354         </xsl:choose>
    355       </xsl:attribute>
    356     </col>
     410    <colgroup>
     411      <col align="{$direction.align.start}">
     412        <xsl:attribute name="width">
     413          <xsl:choose>
     414            <xsl:when test="$label-width != ''">
     415              <xsl:value-of select="$label-width"/>
     416            </xsl:when>
     417            <xsl:otherwise>
     418              <xsl:text>1%</xsl:text>
     419            </xsl:otherwise>
     420          </xsl:choose>
     421        </xsl:attribute>
     422      </col>
     423      <col/>
     424    </colgroup>
    357425    <tbody>
    358426      <xsl:apply-templates select="qandaentry|qandadiv"/>
Note: See TracChangeset for help on using the changeset viewer.