- Timestamp:
- 12/10/2013 11:37:38 PM (11 years ago)
- Branches:
- 7.5-systemd, 7.6-systemd, 7.7-systemd, 7.8-systemd, 7.9-systemd
- Children:
- 112db9d
- Parents:
- f2a5108
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
stylesheets/lfs-xsl/docbook-xsl-1.78.1/xhtml/table.xsl
rf2a5108 rb1a51ac1 7 7 8 8 <!-- ******************************************************************** 9 $Id $9 $Id: table.xsl 9297 2012-04-22 03:56:16Z bobstayton $ 10 10 ******************************************************************** 11 11 … … 167 167 <xsl:when test="../title"> 168 168 <xsl:attribute name="summary"> 169 <!-- This screws up on inline markup and footnotes, oh well... --> 169 170 <xsl:value-of select="string(../title)"/> 170 171 </xsl:attribute> … … 293 294 </xsl:attribute> 294 295 </xsl:when> 295 296 297 298 299 296 <xsl:when test="../@frame='none'"> 297 <xsl:attribute name="style"> 298 <xsl:text>border: none;</xsl:text> 299 </xsl:attribute> 300 </xsl:when> 300 301 <xsl:otherwise> 301 302 <xsl:attribute name="style"> … … 398 399 <xsl:apply-templates select="tbody"/> 399 400 400 <xsl:if test=".//footnote ">401 <xsl:if test=".//footnote|../title//footnote"> 401 402 <tbody class="footnotes"> 402 403 <tr> 403 404 <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"/> 405 406 </td> 406 407 </tr> … … 450 451 </xsl:if> 451 452 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> 459 476 460 477 </xsl:element> … … 484 501 </xsl:if> 485 502 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> 493 525 494 526 </tbody> … … 497 529 <xsl:template match="row"> 498 530 <xsl:param name="spans"/> 531 <xsl:param name="browserows"/> 499 532 500 533 <xsl:choose> 501 534 <xsl:when test="contains($spans, '0')"> 502 535 <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"/> 504 538 </xsl:call-template> 505 539 </xsl:when> … … 507 541 <!-- 508 542 <xsl:message> 509 510 511 512 513 514 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> 515 549 </xsl:message> 516 550 --> 517 551 518 552 <xsl:if test="normalize-space(.//text()) != ''"> 519 553 <xsl:message>Warning: overlapped row contains content!</xsl:message> 520 554 </xsl:if> 521 555 522 556 <tr><xsl:comment> This row intentionally left blank </xsl:comment></tr> 523 557 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> 531 568 </xsl:otherwise> 532 569 </xsl:choose> … … 535 572 <xsl:template name="normal-row"> 536 573 <xsl:param name="spans"/> 574 <xsl:param name="browserows"/> 537 575 538 576 <xsl:variable name="row-height"> … … 555 593 556 594 <tr> 595 <xsl:call-template name="id.attribute"/> 557 596 <xsl:call-template name="tr.attributes"> 558 597 <xsl:with-param name="rownum"> … … 615 654 </tr> 616 655 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"/> 621 667 </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> 627 669 </xsl:if> 628 670 </xsl:template> 629 671 630 672 <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 632 682 <xsl:param name="spans"/> 633 683 … … 636 686 <xsl:when test="ancestor::thead">th</xsl:when> 637 687 <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> 638 691 <xsl:otherwise>td</xsl:otherwise> 639 692 </xsl:choose> … … 676 729 <xsl:choose> 677 730 <!-- 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)"> 679 732 <xsl:value-of select="0"/> 680 733 </xsl:when> … … 765 818 766 819 <xsl:element name="{$cellgi}" namespace="http://www.w3.org/1999/xhtml"> 820 <xsl:call-template name="id.attribute"/> 767 821 <xsl:if test="$bgcolor != ''"> 768 822 <xsl:attribute name="bgcolor"> … … 771 825 </xsl:if> 772 826 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> 778 840 779 841 <xsl:if test="$show.revisionflag and @revisionflag"> … … 910 972 <xsl:text>0:</xsl:text> 911 973 <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,':')"/> 914 976 </xsl:call-template> 915 977 </xsl:when> … … 989 1051 <xsl:when test="$colspec.colnum=$countcol"> 990 1052 <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> 1003 1080 1004 1081 <xsl:choose> … … 1021 1098 </xsl:attribute> 1022 1099 </xsl:if> 1100 1023 1101 <xsl:if test="$colspec/@charoff"> 1024 1102 <xsl:attribute name="charoff"> 1025 1103 <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"/> 1026 1110 </xsl:attribute> 1027 1111 </xsl:if>
Note:
See TracChangeset
for help on using the changeset viewer.