Ignore:
Timestamp:
12/10/2013 11:37:38 PM (11 years ago)
Author:
Krejzi <krejzi@…>
Branches:
7.5-systemd, 7.6-systemd, 7.7-systemd, 7.8-systemd, 7.9-systemd
Children:
112db9d
Parents:
f2a5108
Message:

Import new branch

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

File:
1 moved

Legend:

Unmodified
Added
Removed
  • stylesheets/lfs-xsl/docbook-xsl-1.78.1/xhtml/table.xsl

    rf2a5108 rb1a51ac1  
    77
    88<!-- ********************************************************************
    9      $Id$
     9     $Id: table.xsl 9297 2012-04-22 03:56:16Z bobstayton $
    1010     ********************************************************************
    1111
     
    167167      <xsl:when test="../title">
    168168        <xsl:attribute name="summary">
     169          <!-- This screws up on inline markup and footnotes, oh well... -->
    169170          <xsl:value-of select="string(../title)"/>
    170171        </xsl:attribute>
     
    293294            </xsl:attribute>
    294295          </xsl:when>
    295           <xsl:when test="../@frame='none'">
    296             <xsl:attribute name="style">
    297               <xsl:text>border: none;</xsl:text>
    298             </xsl:attribute>
    299           </xsl:when>
     296          <xsl:when test="../@frame='none'">
     297            <xsl:attribute name="style">
     298              <xsl:text>border: none;</xsl:text>
     299            </xsl:attribute>
     300          </xsl:when>
    300301          <xsl:otherwise>
    301302            <xsl:attribute name="style">
     
    398399    <xsl:apply-templates select="tbody"/>
    399400
    400     <xsl:if test=".//footnote">
     401    <xsl:if test=".//footnote|../title//footnote">
    401402      <tbody class="footnotes">
    402403        <tr>
    403404          <td colspan="{@cols}">
    404             <xsl:apply-templates select=".//footnote" mode="table.footnote.mode"/>
     405            <xsl:apply-templates select=".//footnote|../title//footnote" mode="table.footnote.mode"/>
    405406          </td>
    406407        </tr>
     
    450451    </xsl:if>
    451452
    452     <xsl:apply-templates select="row[1]">
    453       <xsl:with-param name="spans">
    454         <xsl:call-template name="blank.spans">
    455           <xsl:with-param name="cols" select="../@cols"/>
    456         </xsl:call-template>
    457       </xsl:with-param>
    458     </xsl:apply-templates>
     453    <xsl:choose>
     454      <!-- recurse on rows only if @morerows is present -->
     455      <xsl:when test="row/entry/@morerows|row/entrytbl/@morerows">
     456        <xsl:apply-templates select="row[1]">
     457          <xsl:with-param name="spans">
     458            <xsl:call-template name="blank.spans">
     459              <xsl:with-param name="cols" select="../@cols"/>
     460            </xsl:call-template>
     461          </xsl:with-param>
     462          <xsl:with-param name="browserows" select="'recurse'"/>
     463        </xsl:apply-templates>
     464      </xsl:when>
     465      <xsl:otherwise>
     466        <xsl:apply-templates select="row">
     467          <xsl:with-param name="spans">
     468            <xsl:call-template name="blank.spans">
     469              <xsl:with-param name="cols" select="../@cols"/>
     470            </xsl:call-template>
     471          </xsl:with-param>
     472          <xsl:with-param name="browserows" select="'loop'"/>
     473        </xsl:apply-templates>
     474      </xsl:otherwise>
     475    </xsl:choose>
    459476
    460477  </xsl:element>
     
    484501    </xsl:if>
    485502
    486     <xsl:apply-templates select="row[1]">
    487       <xsl:with-param name="spans">
    488         <xsl:call-template name="blank.spans">
    489           <xsl:with-param name="cols" select="../@cols"/>
    490         </xsl:call-template>
    491       </xsl:with-param>
    492     </xsl:apply-templates>
     503    <xsl:choose>
     504      <xsl:when test="row/entry/@morerows|row/entrytbl/@morerows">
     505        <xsl:apply-templates select="row[1]">
     506          <xsl:with-param name="spans">
     507            <xsl:call-template name="blank.spans">
     508              <xsl:with-param name="cols" select="../@cols"/>
     509            </xsl:call-template>
     510          </xsl:with-param>
     511          <xsl:with-param name="browserows" select="'recurse'"/>
     512        </xsl:apply-templates>
     513      </xsl:when>
     514      <xsl:otherwise>
     515        <xsl:apply-templates select="row">
     516          <xsl:with-param name="spans">
     517            <xsl:call-template name="blank.spans">
     518              <xsl:with-param name="cols" select="../@cols"/>
     519            </xsl:call-template>
     520          </xsl:with-param>
     521          <xsl:with-param name="browserows" select="'loop'"/>
     522        </xsl:apply-templates>
     523      </xsl:otherwise>
     524    </xsl:choose>
    493525
    494526  </tbody>
     
    497529<xsl:template match="row">
    498530  <xsl:param name="spans"/>
     531  <xsl:param name="browserows"/>
    499532
    500533  <xsl:choose>
    501534    <xsl:when test="contains($spans, '0')">
    502535      <xsl:call-template name="normal-row">
    503         <xsl:with-param name="spans" select="$spans"/>
     536        <xsl:with-param name="spans" select="$spans"/>
     537        <xsl:with-param name="browserows" select="$browserows"/>
    504538      </xsl:call-template>
    505539    </xsl:when>
     
    507541      <!--
    508542      <xsl:message>
    509         <xsl:text>Ignoring row: </xsl:text>
    510         <xsl:value-of select="$spans"/>
    511         <xsl:text> = </xsl:text>
    512         <xsl:call-template name="consume-row">
    513           <xsl:with-param name="spans" select="$spans"/>
    514         </xsl:call-template>
     543        <xsl:text>Ignoring row: </xsl:text>
     544        <xsl:value-of select="$spans"/>
     545        <xsl:text> = </xsl:text>
     546        <xsl:call-template name="consume-row">
     547          <xsl:with-param name="spans" select="$spans"/>
     548        </xsl:call-template>
    515549      </xsl:message>
    516550      -->
    517551
    518552      <xsl:if test="normalize-space(.//text()) != ''">
    519         <xsl:message>Warning: overlapped row contains content!</xsl:message>
     553        <xsl:message>Warning: overlapped row contains content!</xsl:message>
    520554      </xsl:if>
    521555
    522556      <tr><xsl:comment> This row intentionally left blank </xsl:comment></tr>
    523557
    524       <xsl:apply-templates select="following-sibling::row[1]">
    525         <xsl:with-param name="spans">
    526           <xsl:call-template name="consume-row">
    527             <xsl:with-param name="spans" select="$spans"/>
    528           </xsl:call-template>
    529         </xsl:with-param>
    530       </xsl:apply-templates>
     558      <xsl:if test="$browserows = 'recurse'">
     559        <xsl:apply-templates select="following-sibling::row[1]">
     560          <xsl:with-param name="spans">
     561            <xsl:call-template name="consume-row">
     562              <xsl:with-param name="spans" select="$spans"/>
     563            </xsl:call-template>
     564          </xsl:with-param>
     565          <xsl:with-param name="browserows" select="$browserows"/>
     566        </xsl:apply-templates>
     567      </xsl:if>
    531568    </xsl:otherwise>
    532569  </xsl:choose>
     
    535572<xsl:template name="normal-row">
    536573  <xsl:param name="spans"/>
     574  <xsl:param name="browserows"/>
    537575
    538576  <xsl:variable name="row-height">
     
    555593
    556594  <tr>
     595    <xsl:call-template name="id.attribute"/>
    557596    <xsl:call-template name="tr.attributes">
    558597      <xsl:with-param name="rownum">
     
    615654  </tr>
    616655
    617   <xsl:if test="following-sibling::row">
    618     <xsl:variable name="nextspans">
    619       <xsl:apply-templates select="(entry|entrytbl)[1]" mode="span">
    620         <xsl:with-param name="spans" select="$spans"/>
     656  <xsl:if test="$browserows = 'recurse'">
     657    <xsl:if test="following-sibling::row">
     658      <xsl:variable name="nextspans">
     659        <xsl:apply-templates select="(entry|entrytbl)[1]" mode="span">
     660          <xsl:with-param name="spans" select="$spans"/>
     661        </xsl:apply-templates>
     662      </xsl:variable>
     663 
     664      <xsl:apply-templates select="following-sibling::row[1]">
     665        <xsl:with-param name="spans" select="$nextspans"/>
     666        <xsl:with-param name="browserows" select="$browserows"/>
    621667      </xsl:apply-templates>
    622     </xsl:variable>
    623 
    624     <xsl:apply-templates select="following-sibling::row[1]">
    625       <xsl:with-param name="spans" select="$nextspans"/>
    626     </xsl:apply-templates>
     668    </xsl:if>
    627669  </xsl:if>
    628670</xsl:template>
    629671
    630672<xsl:template match="entry|entrytbl" name="entry">
    631   <xsl:param name="col" select="1"/>
     673  <xsl:param name="col">
     674    <xsl:choose>
     675      <xsl:when test="@revisionflag">
     676        <xsl:number from="row"/>
     677      </xsl:when>
     678      <xsl:otherwise>1</xsl:otherwise>
     679    </xsl:choose>
     680  </xsl:param>
     681
    632682  <xsl:param name="spans"/>
    633683
     
    636686      <xsl:when test="ancestor::thead">th</xsl:when>
    637687      <xsl:when test="ancestor::tfoot">th</xsl:when>
     688      <xsl:when test="ancestor::tbody and                        (ancestor::table[@rowheader = 'firstcol'] or                       ancestor::informaltable[@rowheader = 'firstcol']) and                       ancestor-or-self::entry[1][count(preceding-sibling::entry) = 0]">
     689        <xsl:text>th</xsl:text>
     690      </xsl:when>
    638691      <xsl:otherwise>td</xsl:otherwise>
    639692    </xsl:choose>
     
    676729    <xsl:choose>
    677730      <!-- If this is the last row, rowsep never applies. -->
    678       <xsl:when test="ancestor::entrytbl                       and not (ancestor-or-self::row[1]/following-sibling::row)">
     731      <xsl:when test="ancestor::entrytbl                       and not (ancestor-or-self::row[1]/following-sibling::row)                       and not (ancestor::thead)">
    679732        <xsl:value-of select="0"/>
    680733      </xsl:when>
     
    765818
    766819      <xsl:element name="{$cellgi}" namespace="http://www.w3.org/1999/xhtml">
     820        <xsl:call-template name="id.attribute"/>
    767821        <xsl:if test="$bgcolor != ''">
    768822          <xsl:attribute name="bgcolor">
     
    771825        </xsl:if>
    772826
    773         <xsl:if test="$entry.propagates.style != 0 and @role">
    774           <xsl:apply-templates select="." mode="class.attribute">
    775             <xsl:with-param name="class" select="@role"/>
    776           </xsl:apply-templates>
    777         </xsl:if>
     827        <xsl:call-template name="locale.html.attributes"/>
     828        <xsl:choose>
     829          <xsl:when test="$entry.propagates.style != 0 and @role">
     830            <xsl:apply-templates select="." mode="class.attribute">
     831              <xsl:with-param name="class" select="@role"/>
     832            </xsl:apply-templates>
     833          </xsl:when>
     834          <xsl:otherwise>
     835            <xsl:apply-templates select="." mode="class.attribute">
     836              <xsl:with-param name="class" select="''"/>
     837            </xsl:apply-templates>
     838          </xsl:otherwise>
     839        </xsl:choose>
    778840
    779841        <xsl:if test="$show.revisionflag and @revisionflag">
     
    910972      <xsl:text>0:</xsl:text>
    911973      <xsl:call-template name="sentry">
    912         <xsl:with-param name="col" select="$col+$entry.colspan"/>
    913         <xsl:with-param name="spans" select="$following.spans"/>
     974        <xsl:with-param name="col" select="$col + 1"/>
     975        <xsl:with-param name="spans" select="substring-after($spans,':')"/>
    914976      </xsl:call-template>
    915977    </xsl:when>
     
    9891051        <xsl:when test="$colspec.colnum=$countcol">
    9901052          <col>
    991             <xsl:if test="$colspec/@colwidth                           and $use.extensions != 0                           and $tablecolumns.extension != 0">
    992               <xsl:attribute name="width">
    993                 <xsl:choose>
    994                   <xsl:when test="normalize-space($colspec/@colwidth) = '*'">
    995                     <xsl:value-of select="'1*'"/>
    996                   </xsl:when>
    997                   <xsl:otherwise>
    998                     <xsl:value-of select="$colspec/@colwidth"/>
    999                   </xsl:otherwise>
    1000                 </xsl:choose>
    1001               </xsl:attribute>
    1002             </xsl:if>
     1053            <xsl:choose>
     1054              <xsl:when test="$colspec/@colwidth                             and $use.extensions != 0                             and $tablecolumns.extension != 0">
     1055                <xsl:attribute name="width">
     1056                  <xsl:choose>
     1057                    <xsl:when test="normalize-space($colspec/@colwidth) = '*'">
     1058                      <xsl:value-of select="'1*'"/>
     1059                    </xsl:when>
     1060                    <xsl:otherwise>
     1061                      <xsl:value-of select="$colspec/@colwidth"/>
     1062                    </xsl:otherwise>
     1063                  </xsl:choose>
     1064                </xsl:attribute>
     1065              </xsl:when>
     1066              <!-- pass through to HTML if no * in colspecs -->
     1067              <xsl:when test="$colspec/@colwidth and                              not($colspec/parent::*/colspec/@colwidth[contains(.,'*')])">
     1068                <xsl:attribute name="width">
     1069                  <xsl:choose>
     1070                    <xsl:when test="normalize-space($colspec/@colwidth) = '*'">
     1071                      <xsl:value-of select="'1*'"/>
     1072                    </xsl:when>
     1073                    <xsl:otherwise>
     1074                      <xsl:value-of select="$colspec/@colwidth"/>
     1075                    </xsl:otherwise>
     1076                  </xsl:choose>
     1077                </xsl:attribute>
     1078              </xsl:when>
     1079            </xsl:choose>
    10031080
    10041081            <xsl:choose>
     
    10211098              </xsl:attribute>
    10221099            </xsl:if>
     1100           
    10231101            <xsl:if test="$colspec/@charoff">
    10241102              <xsl:attribute name="charoff">
    10251103                <xsl:value-of select="$colspec/@charoff"/>
     1104              </xsl:attribute>
     1105            </xsl:if>
     1106
     1107            <xsl:if test="$colspec/@colname">
     1108              <xsl:attribute name="class">
     1109                <xsl:value-of select="$colspec/@colname"/>
    10261110              </xsl:attribute>
    10271111            </xsl:if>
Note: See TracChangeset for help on using the changeset viewer.