metanorma-ogc 2.3.8 → 2.3.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/ogc/html/html_ogc_intro.html +0 -1
  3. data/lib/isodoc/ogc/html/word_ogc_intro.html +0 -3
  4. data/lib/isodoc/ogc/html/word_ogc_intro_wp.html +0 -3
  5. data/lib/isodoc/ogc/html_convert.rb +1 -11
  6. data/lib/isodoc/ogc/i18n-en.yaml +1 -0
  7. data/lib/isodoc/ogc/metadata.rb +10 -0
  8. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +852 -315
  9. data/lib/isodoc/ogc/ogc.best-practice.xsl +852 -315
  10. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +852 -315
  11. data/lib/isodoc/ogc/ogc.community-practice.xsl +852 -315
  12. data/lib/isodoc/ogc/ogc.community-standard.xsl +852 -315
  13. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +852 -315
  14. data/lib/isodoc/ogc/ogc.draft-standard.xsl +852 -315
  15. data/lib/isodoc/ogc/ogc.engineering-report.xsl +852 -315
  16. data/lib/isodoc/ogc/ogc.other.xsl +852 -315
  17. data/lib/isodoc/ogc/ogc.policy.xsl +852 -315
  18. data/lib/isodoc/ogc/ogc.reference-model.xsl +852 -315
  19. data/lib/isodoc/ogc/ogc.release-notes.xsl +852 -315
  20. data/lib/isodoc/ogc/ogc.standard.xsl +852 -315
  21. data/lib/isodoc/ogc/ogc.test-suite.xsl +852 -315
  22. data/lib/isodoc/ogc/ogc.user-guide.xsl +852 -315
  23. data/lib/isodoc/ogc/ogc.white-paper.xsl +814 -271
  24. data/lib/isodoc/ogc/presentation_xml_convert.rb +9 -6
  25. data/lib/isodoc/ogc/sections.rb +48 -48
  26. data/lib/isodoc/ogc/word_convert.rb +3 -0
  27. data/lib/isodoc/ogc/xref.rb +1 -1
  28. data/lib/metanorma/ogc/boilerplate.xml +1 -1
  29. data/lib/metanorma/ogc/isodoc.rng +16 -7
  30. data/lib/metanorma/ogc/ogc.rng +3 -8
  31. data/lib/metanorma/ogc/validate.rb +18 -11
  32. data/lib/metanorma/ogc/version.rb +1 -1
  33. metadata +2 -2
@@ -423,174 +423,24 @@
423
423
  </fo:block>
424
424
  </fo:block-container>
425
425
 
426
- <fo:block color="{$color_blue}">
426
+ <!-- Contents, Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
427
427
 
428
- <xsl:variable name="title-toc">
429
- <xsl:call-template name="getTitle">
430
- <xsl:with-param name="name" select="'title-toc'"/>
431
- </xsl:call-template>
432
- </xsl:variable>
433
-
434
- <fo:block-container margin-left="-18mm">
435
- <fo:block-container margin-left="0mm">
436
- <fo:block margin-bottom="40pt">
437
- <fo:block font-size="33pt" margin-bottom="4pt" role="H1">
438
- <xsl:call-template name="addLetterSpacing">
439
- <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($title-toc))"/>
440
- <xsl:with-param name="letter-spacing" select="1.1"/>
441
- </xsl:call-template>
442
- </fo:block>
443
- <fo:block-container width="22.5mm" border-bottom="2pt solid {$color_design}">
444
- <fo:block margin-top="4pt"> </fo:block>
445
- </fo:block-container>
446
- </fo:block>
447
- </fo:block-container>
448
- </fo:block-container>
449
-
450
- <fo:block-container line-height="130%">
451
- <fo:block role="TOC">
452
- <xsl:for-each select="$contents//item[@display = 'true' and normalize-space(@id) != '']">
428
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
429
+ <xsl:sort select="@displayorder" data-type="number"/>
453
430
 
454
- <fo:block role="TOCI">
455
- <xsl:if test="@level = 1">
456
- <xsl:attribute name="margin-top">14pt</xsl:attribute>
457
- </xsl:if>
458
- <xsl:if test="@level = 1 or @parent = 'annex'">
459
- <xsl:attribute name="font-size">12pt</xsl:attribute>
460
- </xsl:if>
461
- <xsl:if test="@level &gt;= 2"> <!-- and not(@parent = 'annex') -->
462
- <xsl:attribute name="font-size">10pt</xsl:attribute>
463
- </xsl:if>
464
-
465
- <xsl:choose>
466
- <xsl:when test="@level = 1">
467
- <fo:list-block provisional-distance-between-starts="8mm">
468
- <xsl:if test="@type = 'annex'">
469
- <xsl:attribute name="provisional-distance-between-starts">0mm</xsl:attribute>
470
- </xsl:if>
471
- <fo:list-item>
472
- <fo:list-item-label end-indent="label-end()">
473
- <fo:block>
474
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@section))"/>
475
- </fo:block>
476
- </fo:list-item-label>
477
- <fo:list-item-body start-indent="body-start()">
478
- <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
479
- <fo:basic-link internal-destination="{@id}">
480
- <xsl:call-template name="setAltText">
481
- <xsl:with-param name="value" select="text()"/>
482
- </xsl:call-template>
483
- <xsl:variable name="sectionTitle">
484
- <xsl:apply-templates select="title"/>
485
- </xsl:variable>
486
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($sectionTitle))"/>
487
- <xsl:text> </xsl:text>
488
- <fo:inline keep-together.within-line="always">
489
- <fo:leader leader-pattern="dots"/>
490
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
491
- </fo:inline>
492
- </fo:basic-link>
493
- </fo:block>
494
- </fo:list-item-body>
495
- </fo:list-item>
496
- </fo:list-block>
497
- </xsl:when>
498
- <xsl:otherwise>
499
- <xsl:variable name="margin-left">
500
- <xsl:choose>
501
- <xsl:when test="number(@level) != 'NaN'"><xsl:value-of select="(@level - 1) * 8"/></xsl:when>
502
- <xsl:otherwise>8</xsl:otherwise>
503
- </xsl:choose>
504
- </xsl:variable>
505
- <fo:block text-align-last="justify" margin-left="{$margin-left}mm">
506
- <fo:basic-link internal-destination="{@id}">
507
- <xsl:call-template name="setAltText">
508
- <xsl:with-param name="value" select="text()"/>
509
- </xsl:call-template>
510
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@section))"/>
511
- <xsl:text> </xsl:text>
512
- <xsl:apply-templates select="title"/>
513
- <xsl:text> </xsl:text>
514
- <fo:inline keep-together.within-line="always">
515
- <fo:leader leader-pattern="dots"/>
516
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
517
- </fo:inline>
518
- </fo:basic-link>
519
- </fo:block>
520
- </xsl:otherwise>
521
- </xsl:choose>
522
-
523
- </fo:block>
524
- </xsl:for-each>
525
- </fo:block>
526
- </fo:block-container>
527
-
528
- <!-- List of Tables -->
529
- <xsl:if test="$contents//tables/table">
530
- <xsl:call-template name="insertListOf_Title">
531
- <xsl:with-param name="title" select="$title-list-tables"/>
532
- </xsl:call-template>
533
- <fo:block-container line-height="130%">
534
- <xsl:for-each select="$contents//tables/table">
535
- <xsl:call-template name="insertListOf_Item"/>
536
- </xsl:for-each>
537
- </fo:block-container>
538
- </xsl:if>
539
-
540
- <!-- List of Figures -->
541
- <xsl:if test="$contents//figures/figure">
542
- <xsl:call-template name="insertListOf_Title">
543
- <xsl:with-param name="title" select="$title-list-figures"/>
544
- </xsl:call-template>
545
- <fo:block-container line-height="130%">
546
- <xsl:for-each select="$contents//figures/figure">
547
- <xsl:call-template name="insertListOf_Item"/>
548
- </xsl:for-each>
549
- </fo:block-container>
550
- </xsl:if>
551
-
552
- <!-- List of Recommendations -->
553
- <xsl:if test="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]">
554
- <xsl:call-template name="insertListOf_Title">
555
- <xsl:with-param name="title" select="$title-list-recommendations"/>
556
- </xsl:call-template>
557
- <fo:block-container line-height="130%">
558
- <xsl:for-each select="xalan:nodeset($toc_recommendations)/*[normalize-space(@id) != '']">
559
- <fo:block text-align-last="justify" margin-top="6pt" role="TOCI">
560
- <fo:basic-link internal-destination="{@id}">
561
- <xsl:call-template name="setAltText">
562
- <xsl:with-param name="value" select="@alt-text"/>
563
- </xsl:call-template>
564
- <xsl:copy-of select="title/node()"/>
565
- <xsl:text> </xsl:text>
566
- <fo:inline keep-together.within-line="always">
567
- <fo:leader leader-pattern="dots"/>
568
- <fo:page-number-citation ref-id="{@id}"/>
569
- </fo:inline>
570
- </fo:basic-link>
571
- </fo:block>
572
- </xsl:for-each>
573
- </fo:block-container>
431
+ <xsl:if test="local-name() = 'foreword' or (local-name() = 'clause' and @type = 'security') or (local-name() = 'clause' and @type = 'submitting_orgs') or local-name() = 'introduction'">
432
+ <fo:block break-after="page"/>
574
433
  </xsl:if>
575
434
 
576
- </fo:block>
577
-
578
- <fo:block break-after="page"/>
579
-
580
- <fo:block line-height="125%">
581
- <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
582
-
583
- <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
584
- <xsl:sort select="@displayorder" data-type="number"/>
585
-
586
- <xsl:if test="local-name() = 'foreword' or (local-name() = 'clause' and @type = 'security') or (local-name() = 'clause' and @type = 'submitting_orgs') or local-name() = 'introduction'">
587
- <fo:block break-after="page"/>
435
+ <fo:block>
436
+ <xsl:if test="not(local-name() = 'clause' and @type = 'toc')">
437
+ <xsl:attribute name="line-height">125%</xsl:attribute>
588
438
  </xsl:if>
589
439
 
590
440
  <xsl:apply-templates select="."/>
591
- </xsl:for-each>
441
+ </fo:block>
442
+ </xsl:for-each>
592
443
 
593
- </fo:block>
594
444
  </fo:flow>
595
445
  </fo:page-sequence>
596
446
 
@@ -656,6 +506,170 @@
656
506
  </fo:block>
657
507
  </xsl:template>
658
508
 
509
+ <xsl:template match="ogc:preface/ogc:clause[@type = 'toc']" priority="4">
510
+ <fo:block color="{$color_blue}">
511
+
512
+ <xsl:apply-templates/>
513
+
514
+ <xsl:if test="count(*) = 1 and *[local-name() = 'title']"> <!-- if there isn't user ToC -->
515
+
516
+ <fo:block-container line-height="130%">
517
+ <fo:block role="TOC">
518
+ <xsl:for-each select="$contents//item[@display = 'true' and normalize-space(@id) != '']">
519
+
520
+ <fo:block role="TOCI">
521
+ <xsl:if test="@level = 1">
522
+ <xsl:attribute name="margin-top">14pt</xsl:attribute>
523
+ </xsl:if>
524
+ <xsl:if test="@level = 1 or @parent = 'annex'">
525
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
526
+ </xsl:if>
527
+ <xsl:if test="@level &gt;= 2"> <!-- and not(@parent = 'annex') -->
528
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
529
+ </xsl:if>
530
+
531
+ <xsl:choose>
532
+ <xsl:when test="@level = 1">
533
+ <fo:list-block provisional-distance-between-starts="8mm">
534
+ <xsl:if test="@type = 'annex'">
535
+ <xsl:attribute name="provisional-distance-between-starts">0mm</xsl:attribute>
536
+ </xsl:if>
537
+ <fo:list-item>
538
+ <fo:list-item-label end-indent="label-end()">
539
+ <fo:block>
540
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@section))"/>
541
+ </fo:block>
542
+ </fo:list-item-label>
543
+ <fo:list-item-body start-indent="body-start()">
544
+ <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
545
+ <fo:basic-link internal-destination="{@id}">
546
+ <xsl:call-template name="setAltText">
547
+ <xsl:with-param name="value" select="text()"/>
548
+ </xsl:call-template>
549
+ <xsl:variable name="sectionTitle">
550
+ <xsl:apply-templates select="title"/>
551
+ </xsl:variable>
552
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($sectionTitle))"/>
553
+ <xsl:text> </xsl:text>
554
+ <fo:inline keep-together.within-line="always">
555
+ <fo:leader leader-pattern="dots"/>
556
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
557
+ </fo:inline>
558
+ </fo:basic-link>
559
+ </fo:block>
560
+ </fo:list-item-body>
561
+ </fo:list-item>
562
+ </fo:list-block>
563
+ </xsl:when>
564
+ <xsl:otherwise>
565
+ <xsl:variable name="margin-left">
566
+ <xsl:choose>
567
+ <xsl:when test="number(@level) != 'NaN'"><xsl:value-of select="(@level - 1) * 8"/></xsl:when>
568
+ <xsl:otherwise>8</xsl:otherwise>
569
+ </xsl:choose>
570
+ </xsl:variable>
571
+ <fo:block text-align-last="justify" margin-left="{$margin-left}mm">
572
+ <fo:basic-link internal-destination="{@id}">
573
+ <xsl:call-template name="setAltText">
574
+ <xsl:with-param name="value" select="text()"/>
575
+ </xsl:call-template>
576
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@section))"/>
577
+ <xsl:text> </xsl:text>
578
+ <xsl:apply-templates select="title"/>
579
+ <xsl:text> </xsl:text>
580
+ <fo:inline keep-together.within-line="always">
581
+ <fo:leader leader-pattern="dots"/>
582
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
583
+ </fo:inline>
584
+ </fo:basic-link>
585
+ </fo:block>
586
+ </xsl:otherwise>
587
+ </xsl:choose>
588
+
589
+ </fo:block>
590
+ </xsl:for-each>
591
+ </fo:block>
592
+ </fo:block-container>
593
+
594
+ <!-- List of Tables -->
595
+ <xsl:if test="$contents//tables/table">
596
+ <xsl:call-template name="insertListOf_Title">
597
+ <xsl:with-param name="title" select="$title-list-tables"/>
598
+ </xsl:call-template>
599
+ <fo:block-container line-height="130%">
600
+ <xsl:for-each select="$contents//tables/table">
601
+ <xsl:call-template name="insertListOf_Item"/>
602
+ </xsl:for-each>
603
+ </fo:block-container>
604
+ </xsl:if>
605
+
606
+ <!-- List of Figures -->
607
+ <xsl:if test="$contents//figures/figure">
608
+ <xsl:call-template name="insertListOf_Title">
609
+ <xsl:with-param name="title" select="$title-list-figures"/>
610
+ </xsl:call-template>
611
+ <fo:block-container line-height="130%">
612
+ <xsl:for-each select="$contents//figures/figure">
613
+ <xsl:call-template name="insertListOf_Item"/>
614
+ </xsl:for-each>
615
+ </fo:block-container>
616
+ </xsl:if>
617
+
618
+ <!-- List of Recommendations -->
619
+ <xsl:if test="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]">
620
+ <xsl:call-template name="insertListOf_Title">
621
+ <xsl:with-param name="title" select="$title-list-recommendations"/>
622
+ </xsl:call-template>
623
+ <fo:block-container line-height="130%">
624
+ <xsl:for-each select="xalan:nodeset($toc_recommendations)/*[normalize-space(@id) != '']">
625
+ <fo:block text-align-last="justify" margin-top="6pt" role="TOCI">
626
+ <fo:basic-link internal-destination="{@id}">
627
+ <xsl:call-template name="setAltText">
628
+ <xsl:with-param name="value" select="@alt-text"/>
629
+ </xsl:call-template>
630
+ <xsl:copy-of select="title/node()"/>
631
+ <xsl:text> </xsl:text>
632
+ <fo:inline keep-together.within-line="always">
633
+ <fo:leader leader-pattern="dots"/>
634
+ <fo:page-number-citation ref-id="{@id}"/>
635
+ </fo:inline>
636
+ </fo:basic-link>
637
+ </fo:block>
638
+ </xsl:for-each>
639
+ </fo:block-container>
640
+ </xsl:if>
641
+ </xsl:if>
642
+ </fo:block>
643
+
644
+ <fo:block break-after="page"/>
645
+
646
+ </xsl:template>
647
+
648
+ <xsl:template match="ogc:preface/ogc:clause[@type = 'toc']/ogc:title" priority="3">
649
+ <xsl:variable name="title-toc">
650
+ <xsl:apply-templates/>
651
+ <!-- <xsl:call-template name="getTitle">
652
+ <xsl:with-param name="name" select="'title-toc'"/>
653
+ </xsl:call-template> -->
654
+ </xsl:variable>
655
+
656
+ <fo:block-container margin-left="-18mm">
657
+ <fo:block-container margin-left="0mm">
658
+ <fo:block margin-bottom="40pt">
659
+ <fo:block font-size="33pt" margin-bottom="4pt" role="H1">
660
+ <xsl:call-template name="addLetterSpacing">
661
+ <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($title-toc))"/>
662
+ <xsl:with-param name="letter-spacing" select="1.1"/>
663
+ </xsl:call-template>
664
+ </fo:block>
665
+ <fo:block-container width="22.5mm" border-bottom="2pt solid {$color_design}">
666
+ <fo:block margin-top="4pt"> </fo:block>
667
+ </fo:block-container>
668
+ </fo:block>
669
+ </fo:block-container>
670
+ </fo:block-container>
671
+ </xsl:template>
672
+
659
673
  <!-- Lato font doesn't contain 'thin space' glyph -->
660
674
  <xsl:template match="text()" priority="1">
661
675
  <xsl:value-of select="translate(., $thin_space, ' ')"/>
@@ -739,7 +753,7 @@
739
753
  <!-- ============================= -->
740
754
 
741
755
  <!-- element with title -->
742
- <xsl:template match="*[ogc:title]" mode="contents">
756
+ <xsl:template match="*[ogc:title][not(@type = 'toc')]" mode="contents">
743
757
  <xsl:variable name="level">
744
758
  <xsl:call-template name="getLevel">
745
759
  <xsl:with-param name="depth" select="ogc:title/@depth"/>
@@ -1883,6 +1897,10 @@
1883
1897
 
1884
1898
  </xsl:attribute-set>
1885
1899
 
1900
+ <xsl:template name="refine_link-style">
1901
+
1902
+ </xsl:template> <!-- refine_link-style -->
1903
+
1886
1904
  <xsl:attribute-set name="sourcecode-container-style">
1887
1905
 
1888
1906
  </xsl:attribute-set>
@@ -1898,6 +1916,14 @@
1898
1916
 
1899
1917
  </xsl:attribute-set>
1900
1918
 
1919
+ <xsl:template name="refine_sourcecode-style">
1920
+
1921
+ <xsl:if test="parent::*[local-name() = 'example']">
1922
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
1923
+ </xsl:if>
1924
+
1925
+ </xsl:template> <!-- refine_sourcecode-style -->
1926
+
1901
1927
  <xsl:attribute-set name="pre-style">
1902
1928
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1903
1929
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -2020,6 +2046,10 @@
2020
2046
 
2021
2047
  </xsl:attribute-set> <!-- example-style -->
2022
2048
 
2049
+ <xsl:template name="refine_example-style">
2050
+
2051
+ </xsl:template> <!-- refine_example-style -->
2052
+
2023
2053
  <xsl:attribute-set name="example-body-style">
2024
2054
 
2025
2055
  </xsl:attribute-set> <!-- example-body-style -->
@@ -2036,6 +2066,10 @@
2036
2066
 
2037
2067
  </xsl:attribute-set> <!-- example-p-style -->
2038
2068
 
2069
+ <xsl:template name="refine_example-p-style">
2070
+
2071
+ </xsl:template> <!-- refine_example-p-style -->
2072
+
2039
2073
  <xsl:attribute-set name="termexample-name-style">
2040
2074
 
2041
2075
  <xsl:attribute name="padding-right">10mm</xsl:attribute>
@@ -2063,12 +2097,29 @@
2063
2097
 
2064
2098
  </xsl:attribute-set> <!-- table-container-style -->
2065
2099
 
2100
+ <xsl:template name="refine_table-container-style">
2101
+ <xsl:param name="margin-side"/>
2102
+
2103
+ <!-- <xsl:if test="ancestor::*[local-name()='sections']"> -->
2104
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
2105
+ <!-- </xsl:if> -->
2106
+
2107
+ <!-- end table block-container attributes -->
2108
+ </xsl:template> <!-- refine_table-container-style -->
2109
+
2066
2110
  <xsl:attribute-set name="table-style">
2067
2111
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
2068
2112
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
2069
2113
 
2070
2114
  </xsl:attribute-set><!-- table-style -->
2071
2115
 
2116
+ <xsl:template name="refine_table-style">
2117
+ <xsl:param name="margin-side"/>
2118
+
2119
+ <xsl:call-template name="setBordersTableArray"/>
2120
+
2121
+ </xsl:template> <!-- refine_table-style -->
2122
+
2072
2123
  <xsl:attribute-set name="table-name-style">
2073
2124
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2074
2125
 
@@ -2080,6 +2131,11 @@
2080
2131
 
2081
2132
  </xsl:attribute-set> <!-- table-name-style -->
2082
2133
 
2134
+ <xsl:template name="refine_table-name-style">
2135
+ <xsl:param name="continued"/>
2136
+
2137
+ </xsl:template> <!-- refine_table-name-style -->
2138
+
2083
2139
  <xsl:attribute-set name="table-row-style">
2084
2140
  <xsl:attribute name="min-height">4mm</xsl:attribute>
2085
2141
 
@@ -2095,14 +2151,38 @@
2095
2151
 
2096
2152
  </xsl:attribute-set>
2097
2153
 
2154
+ <xsl:template name="refine_table-header-row-style">
2155
+
2156
+ <xsl:call-template name="setBordersTableArray"/>
2157
+
2158
+ </xsl:template> <!-- refine_table-header-row-style -->
2159
+
2098
2160
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
2099
2161
 
2100
2162
  </xsl:attribute-set>
2101
2163
 
2164
+ <xsl:template name="refine_table-footer-row-style">
2165
+
2166
+ </xsl:template> <!-- refine_table-footer-row-style -->
2167
+
2102
2168
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
2103
2169
 
2104
2170
  </xsl:attribute-set>
2105
2171
 
2172
+ <xsl:template name="refine_table-body-row-style">
2173
+
2174
+ <xsl:call-template name="setBordersTableArray"/>
2175
+
2176
+ <xsl:variable name="number"><xsl:number/></xsl:variable>
2177
+ <xsl:attribute name="background-color">
2178
+ <xsl:choose>
2179
+ <xsl:when test="$number mod 2 = 0">rgb(252, 246, 222)</xsl:when>
2180
+ <xsl:otherwise>rgb(254, 252, 245)</xsl:otherwise>
2181
+ </xsl:choose>
2182
+ </xsl:attribute>
2183
+
2184
+ </xsl:template> <!-- refine_table-body-row-style -->
2185
+
2106
2186
  <xsl:attribute-set name="table-header-cell-style">
2107
2187
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2108
2188
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2115,6 +2195,24 @@
2115
2195
 
2116
2196
  </xsl:attribute-set> <!-- table-header-cell-style -->
2117
2197
 
2198
+ <xsl:template name="refine_table-header-cell-style">
2199
+
2200
+ <xsl:call-template name="setBordersTableArray"/>
2201
+
2202
+ <xsl:if test="starts-with(ancestor::*[local-name() = 'table'][1]/@type, 'recommend') and normalize-space(@align) = ''">
2203
+ <xsl:call-template name="setTextAlignment">
2204
+ <xsl:with-param name="default">left</xsl:with-param>
2205
+ </xsl:call-template>
2206
+ </xsl:if>
2207
+
2208
+ <xsl:if test="$lang = 'ar'">
2209
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2210
+ </xsl:if>
2211
+
2212
+ <xsl:call-template name="setTableCellAttributes"/>
2213
+
2214
+ </xsl:template> <!-- refine_table-header-cell-style -->
2215
+
2118
2216
  <xsl:attribute-set name="table-cell-style">
2119
2217
  <xsl:attribute name="display-align">center</xsl:attribute>
2120
2218
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2126,6 +2224,18 @@
2126
2224
 
2127
2225
  </xsl:attribute-set> <!-- table-cell-style -->
2128
2226
 
2227
+ <xsl:template name="refine_table-cell-style">
2228
+
2229
+ <xsl:if test="$lang = 'ar'">
2230
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2231
+ </xsl:if>
2232
+
2233
+ <!-- bsi -->
2234
+
2235
+ <xsl:call-template name="setBordersTableArray"/>
2236
+
2237
+ </xsl:template> <!-- refine_table-cell-style -->
2238
+
2129
2239
  <xsl:attribute-set name="table-footer-cell-style">
2130
2240
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
2131
2241
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2136,12 +2246,20 @@
2136
2246
 
2137
2247
  </xsl:attribute-set> <!-- table-footer-cell-style -->
2138
2248
 
2249
+ <xsl:template name="refine_table-footer-cell-style">
2250
+
2251
+ </xsl:template> <!-- refine_table-footer-cell-style -->
2252
+
2139
2253
  <xsl:attribute-set name="table-note-style">
2140
2254
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2141
2255
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2142
2256
 
2143
2257
  </xsl:attribute-set><!-- table-note-style -->
2144
2258
 
2259
+ <xsl:template name="refine_table-note-style">
2260
+
2261
+ </xsl:template> <!-- refine_table-note-style -->
2262
+
2145
2263
  <xsl:attribute-set name="table-fn-style">
2146
2264
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2147
2265
 
@@ -2205,6 +2323,15 @@
2205
2323
 
2206
2324
  </xsl:attribute-set>
2207
2325
 
2326
+ <xsl:template name="refine_dt-cell-style">
2327
+
2328
+ <xsl:if test="not(ancestor::ogc:sourcecode)">
2329
+ <!-- <xsl:attribute name="border-left">1pt solid <xsl:value-of select="$color_design"/></xsl:attribute> -->
2330
+ <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dt"/></xsl:attribute>
2331
+ </xsl:if>
2332
+
2333
+ </xsl:template> <!-- refine_dt-cell-style -->
2334
+
2208
2335
  <xsl:attribute-set name="dt-block-style">
2209
2336
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
2210
2337
 
@@ -2212,6 +2339,17 @@
2212
2339
 
2213
2340
  </xsl:attribute-set>
2214
2341
 
2342
+ <xsl:template name="refine_dt-block-style">
2343
+
2344
+ <xsl:if test="ancestor::ogc:sourcecode">
2345
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
2346
+ </xsl:if>
2347
+ <xsl:if test="not(following-sibling::ogc:dt)"> <!-- last dt -->
2348
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
2349
+ </xsl:if>
2350
+
2351
+ </xsl:template> <!-- refine_dt-block-style -->
2352
+
2215
2353
  <xsl:attribute-set name="dl-name-style">
2216
2354
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2217
2355
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -2228,6 +2366,14 @@
2228
2366
 
2229
2367
  </xsl:attribute-set>
2230
2368
 
2369
+ <xsl:template name="refine_dd-cell-style">
2370
+
2371
+ <xsl:if test="not(ancestor::ogc:sourcecode)">
2372
+ <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dd"/></xsl:attribute>
2373
+ </xsl:if>
2374
+
2375
+ </xsl:template> <!-- refine_dd-cell-style -->
2376
+
2231
2377
  <!-- ========================== -->
2232
2378
  <!-- END Definition's list styles -->
2233
2379
  <!-- ========================== -->
@@ -2257,6 +2403,12 @@
2257
2403
 
2258
2404
  </xsl:attribute-set>
2259
2405
 
2406
+ <xsl:template name="refine_eref-style">
2407
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
2408
+ <xsl:variable name="text" select="normalize-space()"/>
2409
+
2410
+ </xsl:template> <!-- refine_eref-style -->
2411
+
2260
2412
  <xsl:attribute-set name="note-style">
2261
2413
 
2262
2414
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -2264,6 +2416,14 @@
2264
2416
 
2265
2417
  </xsl:attribute-set>
2266
2418
 
2419
+ <xsl:template name="refine_note-style">
2420
+
2421
+ <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)">
2422
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2423
+ </xsl:if>
2424
+
2425
+ </xsl:template>
2426
+
2267
2427
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
2268
2428
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
2269
2429
 
@@ -2274,11 +2434,19 @@
2274
2434
 
2275
2435
  </xsl:attribute-set>
2276
2436
 
2437
+ <xsl:template name="refine_note-name-style">
2438
+
2439
+ </xsl:template> <!-- refine_note-name-style -->
2440
+
2277
2441
  <xsl:attribute-set name="table-note-name-style">
2278
2442
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
2279
2443
 
2280
2444
  </xsl:attribute-set>
2281
2445
 
2446
+ <xsl:template name="refine_table-note-name-style">
2447
+
2448
+ </xsl:template> <!-- refine_table-note-name-style -->
2449
+
2282
2450
  <xsl:attribute-set name="note-p-style">
2283
2451
 
2284
2452
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -2293,6 +2461,10 @@
2293
2461
 
2294
2462
  </xsl:attribute-set>
2295
2463
 
2464
+ <xsl:template name="refine_termnote-style">
2465
+
2466
+ </xsl:template> <!-- refine_termnote-style -->
2467
+
2296
2468
  <xsl:attribute-set name="termnote-name-style">
2297
2469
 
2298
2470
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -2300,6 +2472,10 @@
2300
2472
 
2301
2473
  </xsl:attribute-set>
2302
2474
 
2475
+ <xsl:template name="refine_termnote-name-style">
2476
+
2477
+ </xsl:template>
2478
+
2303
2479
  <xsl:attribute-set name="termnote-p-style">
2304
2480
 
2305
2481
  <xsl:attribute name="space-before">4pt</xsl:attribute>
@@ -2315,6 +2491,10 @@
2315
2491
 
2316
2492
  </xsl:attribute-set>
2317
2493
 
2494
+ <xsl:template name="refine_quote-style">
2495
+
2496
+ </xsl:template>
2497
+
2318
2498
  <xsl:attribute-set name="quote-source-style">
2319
2499
  <xsl:attribute name="text-align">right</xsl:attribute>
2320
2500
 
@@ -2329,6 +2509,10 @@
2329
2509
 
2330
2510
  </xsl:attribute-set>
2331
2511
 
2512
+ <xsl:template name="refine_termsource-style">
2513
+
2514
+ </xsl:template> <!-- refine_termsource-style -->
2515
+
2332
2516
  <xsl:attribute-set name="termsource-text-style">
2333
2517
 
2334
2518
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -2371,6 +2555,10 @@
2371
2555
 
2372
2556
  </xsl:attribute-set>
2373
2557
 
2558
+ <xsl:template name="refine_figure-name-style">
2559
+
2560
+ </xsl:template> <!-- refine_figure-name-style -->
2561
+
2374
2562
  <xsl:attribute-set name="figure-source-style">
2375
2563
 
2376
2564
  </xsl:attribute-set>
@@ -2389,6 +2577,10 @@
2389
2577
 
2390
2578
  </xsl:attribute-set> <!-- formula-stem-block-style -->
2391
2579
 
2580
+ <xsl:template name="refine_formula-stem-block-style">
2581
+
2582
+ </xsl:template> <!-- refine_formula-stem-block-style -->
2583
+
2392
2584
  <xsl:attribute-set name="formula-stem-number-style">
2393
2585
  <xsl:attribute name="text-align">right</xsl:attribute>
2394
2586
 
@@ -2403,6 +2595,10 @@
2403
2595
 
2404
2596
  </xsl:attribute-set>
2405
2597
 
2598
+ <xsl:template name="refine_image-style">
2599
+
2600
+ </xsl:template>
2601
+
2406
2602
  <xsl:attribute-set name="figure-pseudocode-p-style">
2407
2603
 
2408
2604
  </xsl:attribute-set>
@@ -2495,6 +2691,10 @@
2495
2691
 
2496
2692
  </xsl:attribute-set>
2497
2693
 
2694
+ <xsl:template name="refine_mathml-style">
2695
+
2696
+ </xsl:template>
2697
+
2498
2698
  <xsl:attribute-set name="list-style">
2499
2699
 
2500
2700
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
@@ -2503,6 +2703,10 @@
2503
2703
 
2504
2704
  </xsl:attribute-set> <!-- list-style -->
2505
2705
 
2706
+ <xsl:template name="refine_list-style">
2707
+
2708
+ </xsl:template> <!-- refine_list-style -->
2709
+
2506
2710
  <xsl:attribute-set name="list-name-style">
2507
2711
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2508
2712
 
@@ -2515,16 +2719,36 @@
2515
2719
 
2516
2720
  </xsl:attribute-set>
2517
2721
 
2722
+ <xsl:template name="refine_list-item-style">
2723
+
2724
+ </xsl:template> <!-- refine_list-item-style -->
2725
+
2518
2726
  <xsl:attribute-set name="list-item-label-style">
2519
2727
 
2520
2728
  </xsl:attribute-set>
2521
2729
 
2730
+ <xsl:template name="refine_list-item-label-style">
2731
+
2732
+ </xsl:template> <!-- refine_list-item-label-style -->
2733
+
2522
2734
  <xsl:attribute-set name="list-item-body-style">
2523
2735
 
2524
2736
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
2525
2737
 
2526
2738
  </xsl:attribute-set>
2527
2739
 
2740
+ <xsl:template name="refine_list-item-body-style">
2741
+
2742
+ <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
2743
+ <xsl:if test="ancestor::ogc:table[not(@class)]">
2744
+ <xsl:attribute name="margin-bottom">1mm</xsl:attribute>
2745
+ </xsl:if>
2746
+ <xsl:if test="not(following-sibling::*) and not(../following-sibling::*)">
2747
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2748
+ </xsl:if>
2749
+
2750
+ </xsl:template> <!-- refine_list-item-body-style -->
2751
+
2528
2752
  <xsl:attribute-set name="toc-style">
2529
2753
  <xsl:attribute name="line-height">135%</xsl:attribute>
2530
2754
  </xsl:attribute-set>
@@ -2537,6 +2761,10 @@
2537
2761
 
2538
2762
  </xsl:attribute-set>
2539
2763
 
2764
+ <xsl:template name="refine_fn-reference-style">
2765
+
2766
+ </xsl:template> <!-- refine_fn-reference-style -->
2767
+
2540
2768
  <xsl:attribute-set name="fn-style">
2541
2769
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2542
2770
  </xsl:attribute-set>
@@ -2563,6 +2791,10 @@
2563
2791
 
2564
2792
  </xsl:attribute-set>
2565
2793
 
2794
+ <xsl:template name="refine_fn-body-style">
2795
+
2796
+ </xsl:template> <!-- refine_fn-body-style -->
2797
+
2566
2798
  <xsl:attribute-set name="fn-body-num-style">
2567
2799
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
2568
2800
 
@@ -2571,6 +2803,10 @@
2571
2803
 
2572
2804
  </xsl:attribute-set> <!-- fn-body-num-style -->
2573
2805
 
2806
+ <xsl:template name="refine_fn-body-num-style">
2807
+
2808
+ </xsl:template> <!-- refine_fn-body-num-style -->
2809
+
2574
2810
  <!-- admonition -->
2575
2811
  <xsl:attribute-set name="admonition-style">
2576
2812
 
@@ -3241,11 +3477,9 @@
3241
3477
 
3242
3478
  <fo:block-container xsl:use-attribute-sets="table-container-style">
3243
3479
 
3244
- <!-- <xsl:if test="ancestor::*[local-name()='sections']"> -->
3245
- <xsl:attribute name="font-size">9pt</xsl:attribute>
3246
- <!-- </xsl:if> -->
3247
-
3248
- <!-- end table block-container attributes -->
3480
+ <xsl:call-template name="refine_table-container-style">
3481
+ <xsl:with-param name="margin-side" select="$margin-side"/>
3482
+ </xsl:call-template>
3249
3483
 
3250
3484
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
3251
3485
 
@@ -3272,7 +3506,9 @@
3272
3506
 
3273
3507
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
3274
3508
 
3275
- <xsl:call-template name="setBordersTableArray"/>
3509
+ <xsl:call-template name="refine_table-style">
3510
+ <xsl:with-param name="margin-side" select="$margin-side"/>
3511
+ </xsl:call-template>
3276
3512
 
3277
3513
  </xsl:element>
3278
3514
  </xsl:variable>
@@ -3338,7 +3574,7 @@
3338
3574
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3339
3575
  </xsl:when>
3340
3576
  <xsl:otherwise>
3341
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
3577
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'p') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
3342
3578
  </xsl:otherwise>
3343
3579
  </xsl:choose>
3344
3580
 
@@ -3425,6 +3661,10 @@
3425
3661
 
3426
3662
  <fo:block xsl:use-attribute-sets="table-name-style">
3427
3663
 
3664
+ <xsl:call-template name="refine_table-name-style">
3665
+ <xsl:with-param name="continued" select="$continued"/>
3666
+ </xsl:call-template>
3667
+
3428
3668
  <xsl:choose>
3429
3669
  <xsl:when test="$continued = 'true'">
3430
3670
 
@@ -3807,6 +4047,8 @@
3807
4047
  <fo:table-row>
3808
4048
  <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
3809
4049
 
4050
+ <xsl:call-template name="refine_table-header-title-style"/>
4051
+
3810
4052
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
3811
4053
  <xsl:with-param name="continued">true</xsl:with-param>
3812
4054
  </xsl:apply-templates>
@@ -3819,6 +4061,10 @@
3819
4061
  </fo:table-row>
3820
4062
  </xsl:template> <!-- table-header-title -->
3821
4063
 
4064
+ <xsl:template name="refine_table-header-title-style">
4065
+
4066
+ </xsl:template> <!-- refine_table-header-title-style -->
4067
+
3822
4068
  <xsl:template match="*[local-name()='thead']" mode="process_tbody">
3823
4069
  <fo:table-body>
3824
4070
  <xsl:apply-templates/>
@@ -3843,7 +4089,7 @@
3843
4089
  <xsl:param name="colwidths"/>
3844
4090
  <xsl:param name="colgroup"/>
3845
4091
 
3846
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
4092
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
3847
4093
 
3848
4094
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3849
4095
 
@@ -3903,6 +4149,8 @@
3903
4149
  <fo:table-row>
3904
4150
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
3905
4151
 
4152
+ <xsl:call-template name="refine_table-footer-cell-style"/>
4153
+
3906
4154
  <xsl:call-template name="setBordersTableArray"/>
3907
4155
 
3908
4156
  <!-- fn will be processed inside 'note' processing -->
@@ -3911,6 +4159,7 @@
3911
4159
 
3912
4160
  <!-- except gb and bsi -->
3913
4161
 
4162
+ <xsl:apply-templates select="../*[local-name()='p']"/>
3914
4163
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3915
4164
  <xsl:apply-templates select="../*[local-name()='note']"/>
3916
4165
  <xsl:apply-templates select="../*[local-name()='source']"/>
@@ -4042,7 +4291,7 @@
4042
4291
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
4043
4292
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
4044
4293
 
4045
- <xsl:call-template name="setBordersTableArray"/>
4294
+ <xsl:call-template name="refine_table-header-row-style"/>
4046
4295
 
4047
4296
  <xsl:call-template name="setTableRowAttributes"/>
4048
4297
 
@@ -4076,6 +4325,8 @@
4076
4325
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
4077
4326
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
4078
4327
 
4328
+ <xsl:call-template name="refine_table-footer-row-style"/>
4329
+
4079
4330
  <xsl:call-template name="setTableRowAttributes"/>
4080
4331
  <xsl:apply-templates/>
4081
4332
  </fo:table-row>
@@ -4089,17 +4340,10 @@
4089
4340
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4090
4341
  </xsl:if>
4091
4342
 
4092
- <xsl:call-template name="setBordersTableArray"/>
4093
-
4094
- <xsl:variable name="number"><xsl:number/></xsl:variable>
4095
- <xsl:attribute name="background-color">
4096
- <xsl:choose>
4097
- <xsl:when test="$number mod 2 = 0">rgb(252, 246, 222)</xsl:when>
4098
- <xsl:otherwise>rgb(254, 252, 245)</xsl:otherwise>
4099
- </xsl:choose>
4100
- </xsl:attribute>
4343
+ <xsl:call-template name="refine_table-body-row-style"/>
4101
4344
 
4102
4345
  <xsl:call-template name="setTableRowAttributes"/>
4346
+
4103
4347
  <xsl:apply-templates/>
4104
4348
  </fo:table-row>
4105
4349
  </xsl:template>
@@ -4118,19 +4362,7 @@
4118
4362
  <xsl:with-param name="default">center</xsl:with-param>
4119
4363
  </xsl:call-template>
4120
4364
 
4121
- <xsl:call-template name="setBordersTableArray"/>
4122
-
4123
- <xsl:if test="starts-with(ancestor::*[local-name() = 'table'][1]/@type, 'recommend') and normalize-space(@align) = ''">
4124
- <xsl:call-template name="setTextAlignment">
4125
- <xsl:with-param name="default">left</xsl:with-param>
4126
- </xsl:call-template>
4127
- </xsl:if>
4128
-
4129
- <xsl:if test="$lang = 'ar'">
4130
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
4131
- </xsl:if>
4132
-
4133
- <xsl:call-template name="setTableCellAttributes"/>
4365
+ <xsl:call-template name="refine_table-header-cell-style"/>
4134
4366
 
4135
4367
  <fo:block>
4136
4368
  <xsl:apply-templates/>
@@ -4172,13 +4404,7 @@
4172
4404
  <xsl:with-param name="default">left</xsl:with-param>
4173
4405
  </xsl:call-template>
4174
4406
 
4175
- <xsl:if test="$lang = 'ar'">
4176
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
4177
- </xsl:if>
4178
-
4179
- <!-- bsi -->
4180
-
4181
- <xsl:call-template name="setBordersTableArray"/>
4407
+ <xsl:call-template name="refine_table-cell-style"/>
4182
4408
 
4183
4409
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
4184
4410
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -4209,9 +4435,13 @@
4209
4435
 
4210
4436
  <fo:block xsl:use-attribute-sets="table-note-style">
4211
4437
 
4438
+ <xsl:call-template name="refine_table-note-style"/>
4439
+
4212
4440
  <!-- Table's note name (NOTE, for example) -->
4213
4441
  <fo:inline xsl:use-attribute-sets="table-note-name-style">
4214
4442
 
4443
+ <xsl:call-template name="refine_table-note-name-style"/>
4444
+
4215
4445
  <xsl:apply-templates select="*[local-name() = 'name']"/>
4216
4446
 
4217
4447
  </fo:inline>
@@ -4239,6 +4469,14 @@
4239
4469
  <!-- list of footnotes to calculate actual footnotes number -->
4240
4470
  <xsl:variable name="p_fn_">
4241
4471
  <xsl:call-template name="get_fn_list"/>
4472
+ <!-- <xsl:choose>
4473
+ <xsl:when test="$namespace = 'jis'">
4474
+ <xsl:call-template name="get_fn_list_for_element"/>
4475
+ </xsl:when>
4476
+ <xsl:otherwise>
4477
+ <xsl:call-template name="get_fn_list"/>
4478
+ </xsl:otherwise>
4479
+ </xsl:choose> -->
4242
4480
  </xsl:variable>
4243
4481
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
4244
4482
 
@@ -4263,7 +4501,14 @@
4263
4501
 
4264
4502
  </xsl:variable>
4265
4503
 
4266
- <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
4504
+ <xsl:variable name="ref_id">
4505
+ <xsl:choose>
4506
+ <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
4507
+ <xsl:otherwise>
4508
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
4509
+ </xsl:otherwise>
4510
+ </xsl:choose>
4511
+ </xsl:variable>
4267
4512
  <xsl:variable name="footnote_inline">
4268
4513
  <fo:inline>
4269
4514
 
@@ -4286,9 +4531,13 @@
4286
4531
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
4287
4532
  </xsl:if>
4288
4533
 
4289
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4290
- <xsl:value-of select="$current_fn_number_text"/>
4291
- </fo:basic-link>
4534
+ <xsl:call-template name="insert_basic_link">
4535
+ <xsl:with-param name="element">
4536
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4537
+ <xsl:copy-of select="$current_fn_number_text"/>
4538
+ </fo:basic-link>
4539
+ </xsl:with-param>
4540
+ </xsl:call-template>
4292
4541
  </fo:inline>
4293
4542
  </xsl:variable>
4294
4543
 
@@ -4305,8 +4554,12 @@
4305
4554
 
4306
4555
  <fo:block xsl:use-attribute-sets="fn-body-style">
4307
4556
 
4557
+ <xsl:call-template name="refine_fn-body-style"/>
4558
+
4308
4559
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
4309
4560
 
4561
+ <xsl:call-template name="refine_fn-body-num-style"/>
4562
+
4310
4563
  <xsl:value-of select="$current_fn_number_text"/>
4311
4564
  </fo:inline>
4312
4565
  <xsl:apply-templates/>
@@ -4358,6 +4611,28 @@
4358
4611
  </xsl:choose>
4359
4612
  </xsl:template>
4360
4613
 
4614
+ <xsl:template name="get_fn_list_for_element">
4615
+ <xsl:choose>
4616
+ <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
4617
+ <fn gen_id="{generate-id(.)}">
4618
+ <xsl:copy-of select="@*"/>
4619
+ <xsl:copy-of select="node()"/>
4620
+ </fn>
4621
+ </xsl:when>
4622
+ <xsl:otherwise>
4623
+ <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
4624
+ <xsl:variable name="element_id" select="@id"/>
4625
+ <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4626
+ <!-- copy unique fn -->
4627
+ <fn gen_id="{generate-id(.)}">
4628
+ <xsl:copy-of select="@*"/>
4629
+ <xsl:copy-of select="node()"/>
4630
+ </fn>
4631
+ </xsl:for-each>
4632
+ </xsl:for-each>
4633
+ </xsl:otherwise>
4634
+ </xsl:choose>
4635
+ </xsl:template>
4361
4636
  <!-- ============================ -->
4362
4637
  <!-- table's footnotes rendering -->
4363
4638
  <!-- ============================ -->
@@ -4538,6 +4813,8 @@
4538
4813
  <xsl:template match="*[local-name()='fn']">
4539
4814
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
4540
4815
 
4816
+ <xsl:call-template name="refine_fn-reference-style"/>
4817
+
4541
4818
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4542
4819
 
4543
4820
  <xsl:attribute name="internal-destination">
@@ -4632,14 +4909,18 @@
4632
4909
  <xsl:apply-templates select="preceding-sibling::*[1][local-name() = 'p' and @keep-with-next = 'true']/node()"/>
4633
4910
  <xsl:text> </xsl:text>
4634
4911
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
4635
- <xsl:text/>
4636
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
4912
+ <xsl:if test="*[local-name()='dd']/node()[normalize-space() != ''][1][self::text()]">
4913
+ <xsl:text> </xsl:text>
4914
+ </xsl:if>
4915
+ <xsl:apply-templates select="*[local-name()='dd']/node()" mode="inline"/>
4637
4916
  </fo:block>
4638
4917
 
4639
4918
  </xsl:when> <!-- END: only one component -->
4640
4919
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
4641
4920
  <fo:block margin-bottom="12pt" text-align="left">
4642
4921
 
4922
+ <xsl:call-template name="refine_dl_formula_where_style"/>
4923
+
4643
4924
  <!-- <xsl:variable name="title-where">
4644
4925
  <xsl:call-template name="getLocalizedString">
4645
4926
  <xsl:with-param name="key">where</xsl:with-param>
@@ -4653,6 +4934,8 @@
4653
4934
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
4654
4935
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
4655
4936
 
4937
+ <xsl:call-template name="refine_figure_key_style"/>
4938
+
4656
4939
  <xsl:variable name="title-key">
4657
4940
  <xsl:call-template name="getLocalizedString">
4658
4941
  <xsl:with-param name="key">key</xsl:with-param>
@@ -4667,12 +4950,16 @@
4667
4950
  <xsl:if test="$onlyOneComponent = 'false'">
4668
4951
  <fo:block>
4669
4952
 
4953
+ <xsl:call-template name="refine_multicomponent_style"/>
4954
+
4670
4955
  <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
4671
4956
  <xsl:attribute name="margin-top">0</xsl:attribute>
4672
4957
  </xsl:if>
4673
4958
 
4674
4959
  <fo:block>
4675
4960
 
4961
+ <xsl:call-template name="refine_multicomponent_block_style"/>
4962
+
4676
4963
  <xsl:apply-templates select="*[local-name() = 'name']">
4677
4964
  <xsl:with-param name="process">true</xsl:with-param>
4678
4965
  </xsl:apply-templates>
@@ -4830,6 +5117,24 @@
4830
5117
 
4831
5118
  </xsl:template> <!-- END: dl -->
4832
5119
 
5120
+ <xsl:template name="refine_dl_formula_where_style">
5121
+
5122
+ </xsl:template> <!-- refine_dl_formula_where_style -->
5123
+
5124
+ <xsl:template name="refine_figure_key_style">
5125
+
5126
+ </xsl:template> <!-- refine_figure_key_style -->
5127
+
5128
+ <xsl:template name="refine_multicomponent_style">
5129
+ <xsl:variable name="parent" select="local-name(..)"/>
5130
+
5131
+ </xsl:template> <!-- refine_multicomponent_style -->
5132
+
5133
+ <xsl:template name="refine_multicomponent_block_style">
5134
+ <xsl:variable name="parent" select="local-name(..)"/>
5135
+
5136
+ </xsl:template> <!-- refine_multicomponent_block_style -->
5137
+
4833
5138
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
4834
5139
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
4835
5140
 
@@ -5056,10 +5361,7 @@
5056
5361
 
5057
5362
  </xsl:if>
5058
5363
 
5059
- <xsl:if test="not(ancestor::ogc:sourcecode)">
5060
- <!-- <xsl:attribute name="border-left">1pt solid <xsl:value-of select="$color_design"/></xsl:attribute> -->
5061
- <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dt"/></xsl:attribute>
5062
- </xsl:if>
5364
+ <xsl:call-template name="refine_dt-cell-style"/>
5063
5365
 
5064
5366
  <fo:block xsl:use-attribute-sets="dt-block-style">
5065
5367
  <xsl:copy-of select="@id"/>
@@ -5068,12 +5370,7 @@
5068
5370
  <xsl:attribute name="margin-top">0</xsl:attribute>
5069
5371
  </xsl:if>
5070
5372
 
5071
- <xsl:if test="ancestor::ogc:sourcecode">
5072
- <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
5073
- </xsl:if>
5074
- <xsl:if test="not(following-sibling::ogc:dt)"> <!-- last dt -->
5075
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
5076
- </xsl:if>
5373
+ <xsl:call-template name="refine_dt-block-style"/>
5077
5374
 
5078
5375
  <xsl:apply-templates>
5079
5376
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -5094,9 +5391,7 @@
5094
5391
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
5095
5392
  </xsl:if>
5096
5393
 
5097
- <xsl:if test="not(ancestor::ogc:sourcecode)">
5098
- <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dd"/></xsl:attribute>
5099
- </xsl:if>
5394
+ <xsl:call-template name="refine_dd-cell-style"/>
5100
5395
 
5101
5396
  <fo:block>
5102
5397
 
@@ -5143,8 +5438,18 @@
5143
5438
  </xsl:if>
5144
5439
  </xsl:template>
5145
5440
 
5146
- <xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
5147
- <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
5441
+ <xsl:template match="*[local-name()='dd']/*" mode="inline">
5442
+ <xsl:variable name="is_inline_element_after_where">
5443
+ <xsl:if test="(local-name() = 'p') and not(preceding-sibling::node()[normalize-space() != ''])">true</xsl:if>
5444
+ </xsl:variable>
5445
+ <xsl:choose>
5446
+ <xsl:when test="$is_inline_element_after_where = 'true'">
5447
+ <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
5448
+ </xsl:when>
5449
+ <xsl:otherwise>
5450
+ <xsl:apply-templates select="."/>
5451
+ </xsl:otherwise>
5452
+ </xsl:choose>
5148
5453
  </xsl:template>
5149
5454
 
5150
5455
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
@@ -5238,12 +5543,18 @@
5238
5543
  <xsl:param name="split_keep-within-line"/>
5239
5544
  <fo:inline font-weight="bold">
5240
5545
 
5546
+ <xsl:call-template name="refine_strong_style"/>
5547
+
5241
5548
  <xsl:apply-templates>
5242
5549
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
5243
5550
  </xsl:apply-templates>
5244
5551
  </fo:inline>
5245
5552
  </xsl:template>
5246
5553
 
5554
+ <xsl:template name="refine_strong_style">
5555
+
5556
+ </xsl:template>
5557
+
5247
5558
  <xsl:template match="*[local-name()='padding']">
5248
5559
  <fo:inline padding-right="{@value}"> </fo:inline>
5249
5560
  </xsl:template>
@@ -6390,6 +6701,11 @@
6390
6701
 
6391
6702
  <fo:inline xsl:use-attribute-sets="mathml-style">
6392
6703
 
6704
+ <!-- DEBUG -->
6705
+ <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> -->
6706
+
6707
+ <xsl:call-template name="refine_mathml-style"/>
6708
+
6393
6709
  <xsl:if test="$isGenerateTableIF = 'true' and ancestor::*[local-name() = 'td' or local-name() = 'th' or local-name() = 'dl'] and not(following-sibling::node()[not(self::comment())][normalize-space() != ''])"> <!-- math in table cell, and math is last element -->
6394
6710
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
6395
6711
  </xsl:if>
@@ -6494,6 +6810,8 @@
6494
6810
 
6495
6811
  <fo:instream-foreign-object fox:alt-text="Math">
6496
6812
 
6813
+ <xsl:call-template name="refine_mathml_insteam_object_style"/>
6814
+
6497
6815
  <!-- put MathML in Actual Text -->
6498
6816
  <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
6499
6817
  <xsl:attribute name="fox:actual-text">
@@ -6514,6 +6832,10 @@
6514
6832
  </fo:instream-foreign-object>
6515
6833
  </xsl:template>
6516
6834
 
6835
+ <xsl:template name="refine_mathml_insteam_object_style">
6836
+
6837
+ </xsl:template> <!-- refine_mathml_insteam_object_style -->
6838
+
6517
6839
  <xsl:template match="mathml:*" mode="mathml_actual_text">
6518
6840
  <!-- <xsl:text>a+b</xsl:text> -->
6519
6841
  <xsl:text>&lt;</xsl:text>
@@ -6577,6 +6899,79 @@
6577
6899
  <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
6578
6900
  </xsl:template>
6579
6901
 
6902
+ <!-- special case for:
6903
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
6904
+ <mstyle displaystyle="true">
6905
+ <msup>
6906
+ <mi color="#00000000">C</mi>
6907
+ <mtext>R</mtext>
6908
+ </msup>
6909
+ <msubsup>
6910
+ <mtext>C</mtext>
6911
+ <mi>n</mi>
6912
+ <mi>k</mi>
6913
+ </msubsup>
6914
+ </mstyle>
6915
+ </math>
6916
+ -->
6917
+ <xsl:template match="mathml:msup/mathml:mi[. = '‌' or . = ''][not(preceding-sibling::*)][following-sibling::mathml:mtext]" mode="mathml">
6918
+ <xsl:copy>
6919
+ <xsl:copy-of select="@*"/>
6920
+ <xsl:variable name="next_mtext" select="ancestor::mathml:msup/following-sibling::*[1][self::mathml:msubsup or self::mathml:msub or self::mathml:msup]/mathml:mtext"/>
6921
+ <xsl:if test="string-length($next_mtext) != ''">
6922
+ <xsl:attribute name="color">#00000000</xsl:attribute>
6923
+ </xsl:if>
6924
+ <xsl:apply-templates/>
6925
+ <xsl:value-of select="$next_mtext"/>
6926
+ </xsl:copy>
6927
+ </xsl:template>
6928
+
6929
+ <!-- special case for:
6930
+ <msup>
6931
+ <mtext/>
6932
+ <mn>1</mn>
6933
+ </msup>
6934
+ convert to (add mspace after mtext and enclose them into mrow):
6935
+ <msup>
6936
+ <mrow>
6937
+ <mtext/>
6938
+ <mspace height="1.47ex"/>
6939
+ </mrow>
6940
+ <mn>1</mn>
6941
+ </msup>
6942
+ -->
6943
+ <xsl:template match="mathml:msup/mathml:mtext[not(preceding-sibling::*)]" mode="mathml">
6944
+ <mathml:mrow>
6945
+ <xsl:copy-of select="."/>
6946
+ <mathml:mspace height="1.47ex"/>
6947
+ </mathml:mrow>
6948
+ </xsl:template>
6949
+
6950
+ <!-- add space around vertical line -->
6951
+ <xsl:template match="mathml:mo[normalize-space(text()) = '|']" mode="mathml">
6952
+ <xsl:copy>
6953
+ <xsl:apply-templates select="@*" mode="mathml"/>
6954
+ <xsl:if test="not(@lspace)">
6955
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
6956
+ </xsl:if>
6957
+ <xsl:if test="not(@rspace)">
6958
+ <xsl:attribute name="rspace">0.4em</xsl:attribute>
6959
+ </xsl:if>
6960
+ <xsl:apply-templates mode="mathml"/>
6961
+ </xsl:copy>
6962
+ </xsl:template>
6963
+
6964
+ <!-- decrease fontsize for 'Circled Times' char -->
6965
+ <xsl:template match="mathml:mo[normalize-space(text()) = '⊗']" mode="mathml">
6966
+ <xsl:copy>
6967
+ <xsl:apply-templates select="@*" mode="mathml"/>
6968
+ <xsl:if test="not(@fontsize)">
6969
+ <xsl:attribute name="fontsize">55%</xsl:attribute>
6970
+ </xsl:if>
6971
+ <xsl:apply-templates mode="mathml"/>
6972
+ </xsl:copy>
6973
+ </xsl:template>
6974
+
6580
6975
  <!-- Examples:
6581
6976
  <stem type="AsciiMath">x = 1</stem>
6582
6977
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -6585,6 +6980,8 @@
6585
6980
  <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
6586
6981
  <fo:inline xsl:use-attribute-sets="mathml-style">
6587
6982
 
6983
+ <xsl:call-template name="refine_mathml-style"/>
6984
+
6588
6985
  <xsl:choose>
6589
6986
  <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
6590
6987
  <xsl:otherwise>
@@ -6629,24 +7026,30 @@
6629
7026
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6630
7027
  </xsl:if>
6631
7028
 
7029
+ <xsl:call-template name="refine_link-style"/>
7030
+
6632
7031
  <xsl:choose>
6633
7032
  <xsl:when test="$target_text = ''">
6634
7033
  <xsl:apply-templates/>
6635
7034
  </xsl:when>
6636
7035
  <xsl:otherwise>
6637
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
6638
- <xsl:choose>
6639
- <xsl:when test="normalize-space(.) = ''">
6640
- <xsl:call-template name="add-zero-spaces-link-java">
6641
- <xsl:with-param name="text" select="$target_text"/>
6642
- </xsl:call-template>
6643
- </xsl:when>
6644
- <xsl:otherwise>
6645
- <!-- output text from <link>text</link> -->
6646
- <xsl:apply-templates/>
6647
- </xsl:otherwise>
6648
- </xsl:choose>
6649
- </fo:basic-link>
7036
+ <xsl:call-template name="insert_basic_link">
7037
+ <xsl:with-param name="element">
7038
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
7039
+ <xsl:choose>
7040
+ <xsl:when test="normalize-space(.) = ''">
7041
+ <xsl:call-template name="add-zero-spaces-link-java">
7042
+ <xsl:with-param name="text" select="$target_text"/>
7043
+ </xsl:call-template>
7044
+ </xsl:when>
7045
+ <xsl:otherwise>
7046
+ <!-- output text from <link>text</link> -->
7047
+ <xsl:apply-templates/>
7048
+ </xsl:otherwise>
7049
+ </xsl:choose>
7050
+ </fo:basic-link>
7051
+ </xsl:with-param>
7052
+ </xsl:call-template>
6650
7053
  </xsl:otherwise>
6651
7054
  </xsl:choose>
6652
7055
  </fo:inline>
@@ -6713,12 +7116,19 @@
6713
7116
  </xsl:template>
6714
7117
 
6715
7118
  <xsl:template match="*[local-name() = 'xref']">
6716
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6717
- <xsl:if test="parent::*[local-name() = 'add']">
6718
- <xsl:call-template name="append_add-style"/>
6719
- </xsl:if>
6720
- <xsl:apply-templates/>
6721
- </fo:basic-link>
7119
+ <xsl:call-template name="insert_basic_link">
7120
+ <xsl:with-param name="element">
7121
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
7122
+ <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://'))">
7123
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7124
+ </xsl:if>
7125
+ <xsl:if test="parent::*[local-name() = 'add']">
7126
+ <xsl:call-template name="append_add-style"/>
7127
+ </xsl:if>
7128
+ <xsl:apply-templates/>
7129
+ </fo:basic-link>
7130
+ </xsl:with-param>
7131
+ </xsl:call-template>
6722
7132
  </xsl:template>
6723
7133
 
6724
7134
  <!-- ====== -->
@@ -6773,6 +7183,8 @@
6773
7183
  <fo:table-cell display-align="center">
6774
7184
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
6775
7185
 
7186
+ <xsl:call-template name="refine_formula-stem-block-style"/>
7187
+
6776
7188
  <xsl:apply-templates/>
6777
7189
  </fo:block>
6778
7190
  </fo:table-cell>
@@ -6814,16 +7226,18 @@
6814
7226
 
6815
7227
  <xsl:call-template name="setBlockSpanAll"/>
6816
7228
 
6817
- <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)">
6818
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
6819
- </xsl:if>
7229
+ <xsl:call-template name="refine_note-style"/>
6820
7230
 
6821
7231
  <fo:block-container margin-left="0mm" margin-right="0mm">
6822
7232
 
6823
7233
  <fo:block>
6824
7234
 
7235
+ <xsl:call-template name="refine_note_block_style"/>
7236
+
6825
7237
  <fo:inline xsl:use-attribute-sets="note-name-style">
6826
7238
 
7239
+ <xsl:call-template name="refine_note-name-style"/>
7240
+
6827
7241
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6828
7242
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6829
7243
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -6849,6 +7263,10 @@
6849
7263
 
6850
7264
  </xsl:template>
6851
7265
 
7266
+ <xsl:template name="refine_note_block_style">
7267
+
7268
+ </xsl:template>
7269
+
6852
7270
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
6853
7271
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6854
7272
  <xsl:choose>
@@ -6870,12 +7288,16 @@
6870
7288
 
6871
7289
  <xsl:call-template name="setBlockSpanAll"/>
6872
7290
 
7291
+ <xsl:call-template name="refine_termnote-style"/>
7292
+
6873
7293
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
6874
7294
 
6875
7295
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
6876
7296
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
6877
7297
  </xsl:if>
6878
7298
 
7299
+ <xsl:call-template name="refine_termnote-name-style"/>
7300
+
6879
7301
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6880
7302
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6881
7303
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -7049,6 +7471,8 @@
7049
7471
  <xsl:otherwise>
7050
7472
  <fo:block xsl:use-attribute-sets="image-style">
7051
7473
 
7474
+ <xsl:call-template name="refine_image-style"/>
7475
+
7052
7476
  <xsl:variable name="src">
7053
7477
  <xsl:call-template name="image_src"/>
7054
7478
  </xsl:variable>
@@ -7107,7 +7531,7 @@
7107
7531
  <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
7108
7532
  </xsl:when>
7109
7533
  <xsl:when test="not(starts-with(@src, 'data:'))">
7110
- <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
7534
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7111
7535
  </xsl:when>
7112
7536
  <xsl:otherwise>
7113
7537
  <xsl:value-of select="@src"/>
@@ -7129,7 +7553,7 @@
7129
7553
  </xsl:when>
7130
7554
  <xsl:when test="not(starts-with(@src, 'data:'))">
7131
7555
  <xsl:variable name="src">
7132
- <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
7556
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7133
7557
  </xsl:variable>
7134
7558
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
7135
7559
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -7515,15 +7939,19 @@
7515
7939
  <xsl:param name="dest"/>
7516
7940
  <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
7517
7941
  <fo:block font-size="1pt">
7518
- <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
7519
- <fo:inline-container inline-progression-dimension="100%">
7520
- <fo:block-container height="{$height - 1}px" width="100%">
7521
- <!-- DEBUG <xsl:if test="local-name()='polygon'">
7522
- <xsl:attribute name="background-color">magenta</xsl:attribute>
7523
- </xsl:if> -->
7524
- <fo:block> </fo:block></fo:block-container>
7525
- </fo:inline-container>
7526
- </fo:basic-link>
7942
+ <xsl:call-template name="insert_basic_link">
7943
+ <xsl:with-param name="element">
7944
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
7945
+ <fo:inline-container inline-progression-dimension="100%">
7946
+ <fo:block-container height="{$height - 1}px" width="100%">
7947
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
7948
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
7949
+ </xsl:if> -->
7950
+ <fo:block> </fo:block></fo:block-container>
7951
+ </fo:inline-container>
7952
+ </fo:basic-link>
7953
+ </xsl:with-param>
7954
+ </xsl:call-template>
7527
7955
  </fo:block>
7528
7956
  </fo:block-container>
7529
7957
  </xsl:template>
@@ -7912,6 +8340,8 @@
7912
8340
  <xsl:if test="normalize-space() != ''">
7913
8341
  <fo:block xsl:use-attribute-sets="figure-name-style">
7914
8342
 
8343
+ <xsl:call-template name="refine_figure-name-style"/>
8344
+
7915
8345
  <xsl:apply-templates/>
7916
8346
  </fo:block>
7917
8347
  </xsl:if>
@@ -8184,9 +8614,7 @@
8184
8614
  </xsl:attribute>
8185
8615
  </xsl:for-each>
8186
8616
 
8187
- <xsl:if test="parent::*[local-name() = 'example']">
8188
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8189
- </xsl:if>
8617
+ <xsl:call-template name="refine_sourcecode-style"/>
8190
8618
 
8191
8619
  <!-- remove margin between rows in the table with sourcecode line numbers -->
8192
8620
  <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
@@ -8918,6 +9346,8 @@
8918
9346
 
8919
9347
  <xsl:call-template name="setBlockSpanAll"/>
8920
9348
 
9349
+ <xsl:call-template name="refine_example-style"/>
9350
+
8921
9351
  <xsl:variable name="fo_element">
8922
9352
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
8923
9353
  inline
@@ -9045,6 +9475,8 @@
9045
9475
  </xsl:if>
9046
9476
  <fo:block xsl:use-attribute-sets="example-p-style">
9047
9477
 
9478
+ <xsl:call-template name="refine_example-p-style"/>
9479
+
9048
9480
  <xsl:apply-templates/>
9049
9481
  </fo:block>
9050
9482
  </fo:block-container>
@@ -9061,6 +9493,7 @@
9061
9493
  </xsl:otherwise>
9062
9494
  </xsl:choose>
9063
9495
  </xsl:template> <!-- example/p -->
9496
+
9064
9497
  <!-- ====== -->
9065
9498
  <!-- ====== -->
9066
9499
 
@@ -9072,6 +9505,8 @@
9072
9505
  <xsl:template match="*[local-name() = 'termsource']" name="termsource">
9073
9506
  <fo:block xsl:use-attribute-sets="termsource-style">
9074
9507
 
9508
+ <xsl:call-template name="refine_termsource-style"/>
9509
+
9075
9510
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
9076
9511
  <xsl:variable name="termsource_text">
9077
9512
  <xsl:apply-templates/>
@@ -9124,14 +9559,18 @@
9124
9559
  </xsl:template>
9125
9560
 
9126
9561
  <xsl:template match="*[local-name() = 'origin']">
9127
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9128
- <xsl:if test="normalize-space(@citeas) = ''">
9129
- <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
9130
- </xsl:if>
9131
- <fo:inline xsl:use-attribute-sets="origin-style">
9132
- <xsl:apply-templates/>
9133
- </fo:inline>
9134
- </fo:basic-link>
9562
+ <xsl:call-template name="insert_basic_link">
9563
+ <xsl:with-param name="element">
9564
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9565
+ <xsl:if test="normalize-space(@citeas) = ''">
9566
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
9567
+ </xsl:if>
9568
+ <fo:inline xsl:use-attribute-sets="origin-style">
9569
+ <xsl:apply-templates/>
9570
+ </fo:inline>
9571
+ </fo:basic-link>
9572
+ </xsl:with-param>
9573
+ </xsl:call-template>
9135
9574
  </xsl:template>
9136
9575
 
9137
9576
  <!-- not using, see https://github.com/glossarist/iev-document/issues/23 -->
@@ -9183,6 +9622,8 @@
9183
9622
  <fo:block-container margin-left="0mm">
9184
9623
  <fo:block-container xsl:use-attribute-sets="quote-style">
9185
9624
 
9625
+ <xsl:call-template name="refine_quote-style"/>
9626
+
9186
9627
  <fo:block-container margin-left="0mm" margin-right="0mm">
9187
9628
  <fo:block role="BlockQuote">
9188
9629
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
@@ -9205,9 +9646,13 @@
9205
9646
  <xsl:if test="../*[local-name() = 'author']">
9206
9647
  <xsl:text>, </xsl:text>
9207
9648
  </xsl:if>
9208
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9209
- <xsl:apply-templates/>
9210
- </fo:basic-link>
9649
+ <xsl:call-template name="insert_basic_link">
9650
+ <xsl:with-param name="element">
9651
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9652
+ <xsl:apply-templates/>
9653
+ </fo:basic-link>
9654
+ </xsl:with-param>
9655
+ </xsl:call-template>
9211
9656
  </xsl:template>
9212
9657
 
9213
9658
  <xsl:template match="*[local-name() = 'author']">
@@ -9253,28 +9698,33 @@
9253
9698
 
9254
9699
  </xsl:if>
9255
9700
 
9256
- <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
9257
- <xsl:variable name="text" select="normalize-space()"/>
9701
+ <xsl:call-template name="refine_eref-style"/>
9258
9702
 
9259
- <fo:basic-link fox:alt-text="{@citeas}">
9260
- <xsl:if test="normalize-space(@citeas) = ''">
9261
- <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
9262
- </xsl:if>
9263
- <xsl:if test="@type = 'inline'">
9703
+ <xsl:call-template name="insert_basic_link">
9704
+ <xsl:with-param name="element">
9705
+ <fo:basic-link fox:alt-text="{@citeas}">
9706
+ <xsl:if test="normalize-space(@citeas) = ''">
9707
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
9708
+ </xsl:if>
9709
+ <xsl:if test="@type = 'inline'">
9264
9710
 
9265
- </xsl:if>
9711
+ <xsl:call-template name="refine_basic_link_style"/>
9266
9712
 
9267
- <xsl:choose>
9268
- <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
9269
- <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
9270
- </xsl:when>
9271
- <xsl:otherwise>
9272
- <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
9273
- </xsl:otherwise>
9274
- </xsl:choose>
9713
+ </xsl:if>
9275
9714
 
9276
- <xsl:apply-templates/>
9277
- </fo:basic-link>
9715
+ <xsl:choose>
9716
+ <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
9717
+ <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
9718
+ </xsl:when>
9719
+ <xsl:otherwise>
9720
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
9721
+ </xsl:otherwise>
9722
+ </xsl:choose>
9723
+
9724
+ <xsl:apply-templates/>
9725
+ </fo:basic-link>
9726
+ </xsl:with-param>
9727
+ </xsl:call-template>
9278
9728
 
9279
9729
  </fo:inline>
9280
9730
  </xsl:when>
@@ -9292,6 +9742,11 @@
9292
9742
  </xsl:otherwise>
9293
9743
  </xsl:choose>
9294
9744
  </xsl:template>
9745
+
9746
+ <xsl:template name="refine_basic_link_style">
9747
+
9748
+ </xsl:template> <!-- refine_basic_link_style -->
9749
+
9295
9750
  <!-- ====== -->
9296
9751
  <!-- END eref -->
9297
9752
  <!-- ====== -->
@@ -9435,16 +9890,22 @@
9435
9890
  <fo:block>
9436
9891
  <xsl:call-template name="setId"/>
9437
9892
 
9438
- <xsl:variable name="pos"><xsl:number count="ogc:sections/ogc:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms -->
9439
- <xsl:if test="$pos &gt;= 2">
9440
- <xsl:attribute name="space-before">18pt</xsl:attribute>
9441
- </xsl:if>
9893
+ <xsl:call-template name="sections_element_style"/>
9442
9894
 
9443
9895
  <xsl:apply-templates/>
9444
9896
  </fo:block>
9445
9897
 
9446
9898
  </xsl:template>
9447
9899
 
9900
+ <xsl:template name="sections_element_style">
9901
+
9902
+ <xsl:variable name="pos"><xsl:number count="ogc:sections/ogc:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms -->
9903
+ <xsl:if test="$pos &gt;= 2">
9904
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
9905
+ </xsl:if>
9906
+
9907
+ </xsl:template> <!-- sections_element_style -->
9908
+
9448
9909
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
9449
9910
  <fo:block break-after="page"/>
9450
9911
  <fo:block>
@@ -9459,10 +9920,16 @@
9459
9920
 
9460
9921
  <xsl:call-template name="setBlockSpanAll"/>
9461
9922
 
9923
+ <xsl:call-template name="refine_clause_style"/>
9924
+
9462
9925
  <xsl:apply-templates/>
9463
9926
  </fo:block>
9464
9927
  </xsl:template>
9465
9928
 
9929
+ <xsl:template name="refine_clause_style">
9930
+
9931
+ </xsl:template> <!-- refine_clause_style -->
9932
+
9466
9933
  <xsl:template match="*[local-name() = 'definitions']">
9467
9934
  <fo:block id="{@id}">
9468
9935
  <xsl:apply-templates/>
@@ -9475,10 +9942,16 @@
9475
9942
 
9476
9943
  <xsl:call-template name="setBlockSpanAll"/>
9477
9944
 
9945
+ <xsl:call-template name="refine_annex_style"/>
9946
+
9478
9947
  </fo:block>
9479
9948
  <xsl:apply-templates/>
9480
9949
  </xsl:template>
9481
9950
 
9951
+ <xsl:template name="refine_annex_style">
9952
+
9953
+ </xsl:template>
9954
+
9482
9955
  <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
9483
9956
  <!-- comment 2019-11-29 -->
9484
9957
  <!-- <fo:block font-weight="bold">Review:</fo:block>
@@ -9515,7 +9988,10 @@
9515
9988
  <xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
9516
9989
 
9517
9990
  <xsl:template name="setULLabel">
9518
- <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
9991
+ <xsl:variable name="list_level__">
9992
+ <xsl:value-of select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
9993
+ </xsl:variable>
9994
+ <xsl:variable name="list_level_" select="number($list_level__)"/>
9519
9995
  <xsl:variable name="list_level">
9520
9996
  <xsl:choose>
9521
9997
  <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
@@ -9640,6 +10116,8 @@
9640
10116
  </xsl:choose>
9641
10117
  </xsl:attribute>
9642
10118
 
10119
+ <xsl:call-template name="refine_list_container_style"/>
10120
+
9643
10121
  <fo:block-container margin-left="0mm">
9644
10122
  <fo:block>
9645
10123
  <xsl:apply-templates select="." mode="list"/>
@@ -9648,13 +10126,19 @@
9648
10126
  </fo:block-container>
9649
10127
  </xsl:when>
9650
10128
  <xsl:otherwise>
9651
- <fo:block>
9652
- <xsl:apply-templates select="." mode="list"/>
9653
- </fo:block>
10129
+
10130
+ <fo:block>
10131
+ <xsl:apply-templates select="." mode="list"/>
10132
+ </fo:block>
10133
+
9654
10134
  </xsl:otherwise>
9655
10135
  </xsl:choose>
9656
10136
  </xsl:template>
9657
10137
 
10138
+ <xsl:template name="refine_list_container_style">
10139
+
10140
+ </xsl:template> <!-- refine_list_container_style -->
10141
+
9658
10142
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
9659
10143
 
9660
10144
  <xsl:apply-templates select="*[local-name() = 'name']">
@@ -9665,7 +10149,7 @@
9665
10149
 
9666
10150
  <xsl:variable name="provisional_distance_between_starts_">
9667
10151
  <attributes xsl:use-attribute-sets="list-style">
9668
-
10152
+ <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/>
9669
10153
  </attributes>
9670
10154
  </xsl:variable>
9671
10155
  <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/>
@@ -9701,6 +10185,8 @@
9701
10185
  <addon><xsl:value-of select="$addon"/></addon> -->
9702
10186
  </xsl:if>
9703
10187
 
10188
+ <xsl:call-template name="refine_list-style"/>
10189
+
9704
10190
  <xsl:if test="*[local-name() = 'name']">
9705
10191
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
9706
10192
  </xsl:if>
@@ -9713,6 +10199,10 @@
9713
10199
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
9714
10200
  </xsl:template>
9715
10201
 
10202
+ <xsl:template name="refine_list-style_provisional-distance-between-starts">
10203
+
10204
+ </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
10205
+
9716
10206
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
9717
10207
  <xsl:param name="process">false</xsl:param>
9718
10208
  <xsl:if test="$process = 'true'">
@@ -9726,27 +10216,26 @@
9726
10216
  <fo:list-item xsl:use-attribute-sets="list-item-style">
9727
10217
  <xsl:copy-of select="@id"/>
9728
10218
 
10219
+ <xsl:call-template name="refine_list-item-style"/>
10220
+
9729
10221
  <fo:list-item-label end-indent="label-end()">
9730
10222
  <fo:block xsl:use-attribute-sets="list-item-label-style">
9731
10223
 
10224
+ <xsl:call-template name="refine_list-item-label-style"/>
10225
+
9732
10226
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
9733
10227
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
9734
10228
  <xsl:call-template name="append_add-style"/>
9735
10229
  </xsl:if>
9736
10230
 
9737
- <xsl:call-template name="getListItemFormat"/>
10231
+ <xsl:call-template name="getListItemFormat"/>
10232
+
9738
10233
  </fo:block>
9739
10234
  </fo:list-item-label>
9740
10235
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
9741
10236
  <fo:block>
9742
10237
 
9743
- <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
9744
- <xsl:if test="ancestor::ogc:table[not(@class)]">
9745
- <xsl:attribute name="margin-bottom">1mm</xsl:attribute>
9746
- </xsl:if>
9747
- <xsl:if test="not(following-sibling::*) and not(../following-sibling::*)">
9748
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
9749
- </xsl:if>
10238
+ <xsl:call-template name="refine_list-item-body-style"/>
9750
10239
 
9751
10240
  <xsl:apply-templates/>
9752
10241
 
@@ -10065,6 +10554,7 @@
10065
10554
 
10066
10555
  <fo:block id="{@id}">
10067
10556
  <xsl:apply-templates/>
10557
+
10068
10558
  </fo:block>
10069
10559
  </xsl:template>
10070
10560
 
@@ -10084,6 +10574,7 @@
10084
10574
 
10085
10575
  <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
10086
10576
  <xsl:apply-templates/>
10577
+
10087
10578
  </fo:block>
10088
10579
 
10089
10580
  </xsl:template> <!-- references -->
@@ -10342,24 +10833,32 @@
10342
10833
  <xsl:for-each select="*[local-name() = 'tab']">
10343
10834
  <xsl:variable name="current_id" select="generate-id()"/>
10344
10835
  <fo:table-cell>
10345
- <fo:block>
10346
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
10347
- <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
10348
- <xsl:choose>
10349
- <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
10350
- <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
10351
- </xsl:choose>
10352
- </xsl:for-each>
10353
- </fo:basic-link>
10836
+ <fo:block line-height-shift-adjustment="disregard-shifts">
10837
+ <xsl:call-template name="insert_basic_link">
10838
+ <xsl:with-param name="element">
10839
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
10840
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
10841
+ <xsl:choose>
10842
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
10843
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
10844
+ </xsl:choose>
10845
+ </xsl:for-each>
10846
+ </fo:basic-link>
10847
+ </xsl:with-param>
10848
+ </xsl:call-template>
10354
10849
  </fo:block>
10355
10850
  </fo:table-cell>
10356
10851
  </xsl:for-each>
10357
10852
  <!-- last column - for page numbers -->
10358
10853
  <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
10359
10854
  <fo:block>
10360
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
10361
- <fo:page-number-citation ref-id="{$target}"/>
10362
- </fo:basic-link>
10855
+ <xsl:call-template name="insert_basic_link">
10856
+ <xsl:with-param name="element">
10857
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
10858
+ <fo:page-number-citation ref-id="{$target}"/>
10859
+ </fo:basic-link>
10860
+ </xsl:with-param>
10861
+ </xsl:call-template>
10363
10862
  </fo:block>
10364
10863
  </fo:table-cell>
10365
10864
  </xsl:template>
@@ -10401,6 +10900,27 @@
10401
10900
  <!-- End Table of Contents (ToC) processing -->
10402
10901
  <!-- =================== -->
10403
10902
 
10903
+ <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
10904
+ <xsl:template name="insert_basic_link">
10905
+ <xsl:param name="element"/>
10906
+ <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
10907
+ <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
10908
+ <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
10909
+ <xsl:choose>
10910
+ <xsl:when test="$external-destination = 'true' or $internal-destination = 'true'">
10911
+ <xsl:copy-of select="$element_node"/>
10912
+ </xsl:when>
10913
+ <xsl:otherwise>
10914
+ <fo:inline>
10915
+ <xsl:for-each select="$element_node/fo:basic-link/@*[local-name() != 'external-destination' and local-name() != 'internal-destination' and local-name() != 'alt-text']">
10916
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
10917
+ </xsl:for-each>
10918
+ <xsl:copy-of select="$element_node/fo:basic-link/node()"/>
10919
+ </fo:inline>
10920
+ </xsl:otherwise>
10921
+ </xsl:choose>
10922
+ </xsl:template>
10923
+
10404
10924
  <xsl:template match="*[local-name() = 'variant-title']"/> <!-- [@type = 'sub'] -->
10405
10925
  <xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
10406
10926
  <fo:inline padding-right="5mm"> </fo:inline>
@@ -10633,6 +11153,9 @@
10633
11153
  </xsl:copy>
10634
11154
  </xsl:template>
10635
11155
 
11156
+ <!-- prevent empty thead processing in XSL-FO, remove it -->
11157
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'thead'][count(*) = 0]" mode="update_xml_step1"/>
11158
+
10636
11159
  <xsl:template name="add_id">
10637
11160
  <xsl:if test="not(@id)">
10638
11161
  <!-- add @id - first element with @id plus '_element_name' -->
@@ -10917,6 +11440,14 @@
10917
11440
  <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" mode="linear_xml" name="linear_xml_fn">
10918
11441
  <xsl:variable name="p_fn_">
10919
11442
  <xsl:call-template name="get_fn_list"/>
11443
+ <!-- <xsl:choose>
11444
+ <xsl:when test="$namespace = 'jis'">
11445
+ <xsl:call-template name="get_fn_list_for_element"/>
11446
+ </xsl:when>
11447
+ <xsl:otherwise>
11448
+ <xsl:call-template name="get_fn_list"/>
11449
+ </xsl:otherwise>
11450
+ </xsl:choose> -->
10920
11451
  </xsl:variable>
10921
11452
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
10922
11453
  <xsl:variable name="gen_id" select="generate-id(.)"/>
@@ -10931,8 +11462,14 @@
10931
11462
  <xsl:attribute name="current_fn_number">
10932
11463
  <xsl:value-of select="$current_fn_number"/>
10933
11464
  </xsl:attribute>
11465
+ <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
10934
11466
  <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
10935
- <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
11467
+
11468
+ <xsl:value-of select="$skip_footnote_body_"/>
11469
+
11470
+ </xsl:attribute>
11471
+ <xsl:attribute name="ref_id">
11472
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
10936
11473
  </xsl:attribute>
10937
11474
  <xsl:apply-templates select="node()" mode="linear_xml"/>
10938
11475
  </xsl:copy>