metanorma-ogc 2.3.9 → 2.3.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -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) != '']">
453
-
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>
428
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
429
+ <xsl:sort select="@displayorder" data-type="number"/>
464
430
 
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
  <!-- ========================== -->
@@ -2250,7 +2396,6 @@
2250
2396
  </xsl:attribute-set>
2251
2397
 
2252
2398
  <xsl:attribute-set name="xref-style">
2253
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
2254
2399
 
2255
2400
  </xsl:attribute-set>
2256
2401
 
@@ -2258,6 +2403,12 @@
2258
2403
 
2259
2404
  </xsl:attribute-set>
2260
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
+
2261
2412
  <xsl:attribute-set name="note-style">
2262
2413
 
2263
2414
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -2265,6 +2416,14 @@
2265
2416
 
2266
2417
  </xsl:attribute-set>
2267
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
+
2268
2427
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
2269
2428
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
2270
2429
 
@@ -2275,11 +2434,19 @@
2275
2434
 
2276
2435
  </xsl:attribute-set>
2277
2436
 
2437
+ <xsl:template name="refine_note-name-style">
2438
+
2439
+ </xsl:template> <!-- refine_note-name-style -->
2440
+
2278
2441
  <xsl:attribute-set name="table-note-name-style">
2279
2442
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
2280
2443
 
2281
2444
  </xsl:attribute-set>
2282
2445
 
2446
+ <xsl:template name="refine_table-note-name-style">
2447
+
2448
+ </xsl:template> <!-- refine_table-note-name-style -->
2449
+
2283
2450
  <xsl:attribute-set name="note-p-style">
2284
2451
 
2285
2452
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -2294,6 +2461,10 @@
2294
2461
 
2295
2462
  </xsl:attribute-set>
2296
2463
 
2464
+ <xsl:template name="refine_termnote-style">
2465
+
2466
+ </xsl:template> <!-- refine_termnote-style -->
2467
+
2297
2468
  <xsl:attribute-set name="termnote-name-style">
2298
2469
 
2299
2470
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -2301,6 +2472,10 @@
2301
2472
 
2302
2473
  </xsl:attribute-set>
2303
2474
 
2475
+ <xsl:template name="refine_termnote-name-style">
2476
+
2477
+ </xsl:template>
2478
+
2304
2479
  <xsl:attribute-set name="termnote-p-style">
2305
2480
 
2306
2481
  <xsl:attribute name="space-before">4pt</xsl:attribute>
@@ -2316,6 +2491,10 @@
2316
2491
 
2317
2492
  </xsl:attribute-set>
2318
2493
 
2494
+ <xsl:template name="refine_quote-style">
2495
+
2496
+ </xsl:template>
2497
+
2319
2498
  <xsl:attribute-set name="quote-source-style">
2320
2499
  <xsl:attribute name="text-align">right</xsl:attribute>
2321
2500
 
@@ -2330,6 +2509,10 @@
2330
2509
 
2331
2510
  </xsl:attribute-set>
2332
2511
 
2512
+ <xsl:template name="refine_termsource-style">
2513
+
2514
+ </xsl:template> <!-- refine_termsource-style -->
2515
+
2333
2516
  <xsl:attribute-set name="termsource-text-style">
2334
2517
 
2335
2518
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -2372,6 +2555,10 @@
2372
2555
 
2373
2556
  </xsl:attribute-set>
2374
2557
 
2558
+ <xsl:template name="refine_figure-name-style">
2559
+
2560
+ </xsl:template> <!-- refine_figure-name-style -->
2561
+
2375
2562
  <xsl:attribute-set name="figure-source-style">
2376
2563
 
2377
2564
  </xsl:attribute-set>
@@ -2390,6 +2577,10 @@
2390
2577
 
2391
2578
  </xsl:attribute-set> <!-- formula-stem-block-style -->
2392
2579
 
2580
+ <xsl:template name="refine_formula-stem-block-style">
2581
+
2582
+ </xsl:template> <!-- refine_formula-stem-block-style -->
2583
+
2393
2584
  <xsl:attribute-set name="formula-stem-number-style">
2394
2585
  <xsl:attribute name="text-align">right</xsl:attribute>
2395
2586
 
@@ -2404,6 +2595,10 @@
2404
2595
 
2405
2596
  </xsl:attribute-set>
2406
2597
 
2598
+ <xsl:template name="refine_image-style">
2599
+
2600
+ </xsl:template>
2601
+
2407
2602
  <xsl:attribute-set name="figure-pseudocode-p-style">
2408
2603
 
2409
2604
  </xsl:attribute-set>
@@ -2496,6 +2691,10 @@
2496
2691
 
2497
2692
  </xsl:attribute-set>
2498
2693
 
2694
+ <xsl:template name="refine_mathml-style">
2695
+
2696
+ </xsl:template>
2697
+
2499
2698
  <xsl:attribute-set name="list-style">
2500
2699
 
2501
2700
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
@@ -2504,6 +2703,10 @@
2504
2703
 
2505
2704
  </xsl:attribute-set> <!-- list-style -->
2506
2705
 
2706
+ <xsl:template name="refine_list-style">
2707
+
2708
+ </xsl:template> <!-- refine_list-style -->
2709
+
2507
2710
  <xsl:attribute-set name="list-name-style">
2508
2711
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2509
2712
 
@@ -2516,16 +2719,36 @@
2516
2719
 
2517
2720
  </xsl:attribute-set>
2518
2721
 
2722
+ <xsl:template name="refine_list-item-style">
2723
+
2724
+ </xsl:template> <!-- refine_list-item-style -->
2725
+
2519
2726
  <xsl:attribute-set name="list-item-label-style">
2520
2727
 
2521
2728
  </xsl:attribute-set>
2522
2729
 
2730
+ <xsl:template name="refine_list-item-label-style">
2731
+
2732
+ </xsl:template> <!-- refine_list-item-label-style -->
2733
+
2523
2734
  <xsl:attribute-set name="list-item-body-style">
2524
2735
 
2525
2736
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
2526
2737
 
2527
2738
  </xsl:attribute-set>
2528
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
+
2529
2752
  <xsl:attribute-set name="toc-style">
2530
2753
  <xsl:attribute name="line-height">135%</xsl:attribute>
2531
2754
  </xsl:attribute-set>
@@ -2538,6 +2761,10 @@
2538
2761
 
2539
2762
  </xsl:attribute-set>
2540
2763
 
2764
+ <xsl:template name="refine_fn-reference-style">
2765
+
2766
+ </xsl:template> <!-- refine_fn-reference-style -->
2767
+
2541
2768
  <xsl:attribute-set name="fn-style">
2542
2769
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2543
2770
  </xsl:attribute-set>
@@ -2564,6 +2791,10 @@
2564
2791
 
2565
2792
  </xsl:attribute-set>
2566
2793
 
2794
+ <xsl:template name="refine_fn-body-style">
2795
+
2796
+ </xsl:template> <!-- refine_fn-body-style -->
2797
+
2567
2798
  <xsl:attribute-set name="fn-body-num-style">
2568
2799
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
2569
2800
 
@@ -2572,6 +2803,10 @@
2572
2803
 
2573
2804
  </xsl:attribute-set> <!-- fn-body-num-style -->
2574
2805
 
2806
+ <xsl:template name="refine_fn-body-num-style">
2807
+
2808
+ </xsl:template> <!-- refine_fn-body-num-style -->
2809
+
2575
2810
  <!-- admonition -->
2576
2811
  <xsl:attribute-set name="admonition-style">
2577
2812
 
@@ -3242,11 +3477,9 @@
3242
3477
 
3243
3478
  <fo:block-container xsl:use-attribute-sets="table-container-style">
3244
3479
 
3245
- <!-- <xsl:if test="ancestor::*[local-name()='sections']"> -->
3246
- <xsl:attribute name="font-size">9pt</xsl:attribute>
3247
- <!-- </xsl:if> -->
3248
-
3249
- <!-- 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>
3250
3483
 
3251
3484
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
3252
3485
 
@@ -3273,7 +3506,9 @@
3273
3506
 
3274
3507
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
3275
3508
 
3276
- <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>
3277
3512
 
3278
3513
  </xsl:element>
3279
3514
  </xsl:variable>
@@ -3339,7 +3574,7 @@
3339
3574
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3340
3575
  </xsl:when>
3341
3576
  <xsl:otherwise>
3342
- <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 -->
3343
3578
  </xsl:otherwise>
3344
3579
  </xsl:choose>
3345
3580
 
@@ -3426,6 +3661,10 @@
3426
3661
 
3427
3662
  <fo:block xsl:use-attribute-sets="table-name-style">
3428
3663
 
3664
+ <xsl:call-template name="refine_table-name-style">
3665
+ <xsl:with-param name="continued" select="$continued"/>
3666
+ </xsl:call-template>
3667
+
3429
3668
  <xsl:choose>
3430
3669
  <xsl:when test="$continued = 'true'">
3431
3670
 
@@ -3808,6 +4047,8 @@
3808
4047
  <fo:table-row>
3809
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">
3810
4049
 
4050
+ <xsl:call-template name="refine_table-header-title-style"/>
4051
+
3811
4052
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
3812
4053
  <xsl:with-param name="continued">true</xsl:with-param>
3813
4054
  </xsl:apply-templates>
@@ -3820,6 +4061,10 @@
3820
4061
  </fo:table-row>
3821
4062
  </xsl:template> <!-- table-header-title -->
3822
4063
 
4064
+ <xsl:template name="refine_table-header-title-style">
4065
+
4066
+ </xsl:template> <!-- refine_table-header-title-style -->
4067
+
3823
4068
  <xsl:template match="*[local-name()='thead']" mode="process_tbody">
3824
4069
  <fo:table-body>
3825
4070
  <xsl:apply-templates/>
@@ -3844,7 +4089,7 @@
3844
4089
  <xsl:param name="colwidths"/>
3845
4090
  <xsl:param name="colgroup"/>
3846
4091
 
3847
- <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']"/>
3848
4093
 
3849
4094
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3850
4095
 
@@ -3904,6 +4149,8 @@
3904
4149
  <fo:table-row>
3905
4150
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
3906
4151
 
4152
+ <xsl:call-template name="refine_table-footer-cell-style"/>
4153
+
3907
4154
  <xsl:call-template name="setBordersTableArray"/>
3908
4155
 
3909
4156
  <!-- fn will be processed inside 'note' processing -->
@@ -3912,6 +4159,7 @@
3912
4159
 
3913
4160
  <!-- except gb and bsi -->
3914
4161
 
4162
+ <xsl:apply-templates select="../*[local-name()='p']"/>
3915
4163
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3916
4164
  <xsl:apply-templates select="../*[local-name()='note']"/>
3917
4165
  <xsl:apply-templates select="../*[local-name()='source']"/>
@@ -4043,7 +4291,7 @@
4043
4291
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
4044
4292
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
4045
4293
 
4046
- <xsl:call-template name="setBordersTableArray"/>
4294
+ <xsl:call-template name="refine_table-header-row-style"/>
4047
4295
 
4048
4296
  <xsl:call-template name="setTableRowAttributes"/>
4049
4297
 
@@ -4077,6 +4325,8 @@
4077
4325
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
4078
4326
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
4079
4327
 
4328
+ <xsl:call-template name="refine_table-footer-row-style"/>
4329
+
4080
4330
  <xsl:call-template name="setTableRowAttributes"/>
4081
4331
  <xsl:apply-templates/>
4082
4332
  </fo:table-row>
@@ -4090,17 +4340,10 @@
4090
4340
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4091
4341
  </xsl:if>
4092
4342
 
4093
- <xsl:call-template name="setBordersTableArray"/>
4094
-
4095
- <xsl:variable name="number"><xsl:number/></xsl:variable>
4096
- <xsl:attribute name="background-color">
4097
- <xsl:choose>
4098
- <xsl:when test="$number mod 2 = 0">rgb(252, 246, 222)</xsl:when>
4099
- <xsl:otherwise>rgb(254, 252, 245)</xsl:otherwise>
4100
- </xsl:choose>
4101
- </xsl:attribute>
4343
+ <xsl:call-template name="refine_table-body-row-style"/>
4102
4344
 
4103
4345
  <xsl:call-template name="setTableRowAttributes"/>
4346
+
4104
4347
  <xsl:apply-templates/>
4105
4348
  </fo:table-row>
4106
4349
  </xsl:template>
@@ -4119,19 +4362,7 @@
4119
4362
  <xsl:with-param name="default">center</xsl:with-param>
4120
4363
  </xsl:call-template>
4121
4364
 
4122
- <xsl:call-template name="setBordersTableArray"/>
4123
-
4124
- <xsl:if test="starts-with(ancestor::*[local-name() = 'table'][1]/@type, 'recommend') and normalize-space(@align) = ''">
4125
- <xsl:call-template name="setTextAlignment">
4126
- <xsl:with-param name="default">left</xsl:with-param>
4127
- </xsl:call-template>
4128
- </xsl:if>
4129
-
4130
- <xsl:if test="$lang = 'ar'">
4131
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
4132
- </xsl:if>
4133
-
4134
- <xsl:call-template name="setTableCellAttributes"/>
4365
+ <xsl:call-template name="refine_table-header-cell-style"/>
4135
4366
 
4136
4367
  <fo:block>
4137
4368
  <xsl:apply-templates/>
@@ -4173,13 +4404,7 @@
4173
4404
  <xsl:with-param name="default">left</xsl:with-param>
4174
4405
  </xsl:call-template>
4175
4406
 
4176
- <xsl:if test="$lang = 'ar'">
4177
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
4178
- </xsl:if>
4179
-
4180
- <!-- bsi -->
4181
-
4182
- <xsl:call-template name="setBordersTableArray"/>
4407
+ <xsl:call-template name="refine_table-cell-style"/>
4183
4408
 
4184
4409
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
4185
4410
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -4210,9 +4435,13 @@
4210
4435
 
4211
4436
  <fo:block xsl:use-attribute-sets="table-note-style">
4212
4437
 
4438
+ <xsl:call-template name="refine_table-note-style"/>
4439
+
4213
4440
  <!-- Table's note name (NOTE, for example) -->
4214
4441
  <fo:inline xsl:use-attribute-sets="table-note-name-style">
4215
4442
 
4443
+ <xsl:call-template name="refine_table-note-name-style"/>
4444
+
4216
4445
  <xsl:apply-templates select="*[local-name() = 'name']"/>
4217
4446
 
4218
4447
  </fo:inline>
@@ -4240,6 +4469,14 @@
4240
4469
  <!-- list of footnotes to calculate actual footnotes number -->
4241
4470
  <xsl:variable name="p_fn_">
4242
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> -->
4243
4480
  </xsl:variable>
4244
4481
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
4245
4482
 
@@ -4264,7 +4501,14 @@
4264
4501
 
4265
4502
  </xsl:variable>
4266
4503
 
4267
- <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>
4268
4512
  <xsl:variable name="footnote_inline">
4269
4513
  <fo:inline>
4270
4514
 
@@ -4290,7 +4534,7 @@
4290
4534
  <xsl:call-template name="insert_basic_link">
4291
4535
  <xsl:with-param name="element">
4292
4536
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4293
- <xsl:value-of select="$current_fn_number_text"/>
4537
+ <xsl:copy-of select="$current_fn_number_text"/>
4294
4538
  </fo:basic-link>
4295
4539
  </xsl:with-param>
4296
4540
  </xsl:call-template>
@@ -4310,8 +4554,12 @@
4310
4554
 
4311
4555
  <fo:block xsl:use-attribute-sets="fn-body-style">
4312
4556
 
4557
+ <xsl:call-template name="refine_fn-body-style"/>
4558
+
4313
4559
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
4314
4560
 
4561
+ <xsl:call-template name="refine_fn-body-num-style"/>
4562
+
4315
4563
  <xsl:value-of select="$current_fn_number_text"/>
4316
4564
  </fo:inline>
4317
4565
  <xsl:apply-templates/>
@@ -4363,6 +4611,28 @@
4363
4611
  </xsl:choose>
4364
4612
  </xsl:template>
4365
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>
4366
4636
  <!-- ============================ -->
4367
4637
  <!-- table's footnotes rendering -->
4368
4638
  <!-- ============================ -->
@@ -4543,6 +4813,8 @@
4543
4813
  <xsl:template match="*[local-name()='fn']">
4544
4814
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
4545
4815
 
4816
+ <xsl:call-template name="refine_fn-reference-style"/>
4817
+
4546
4818
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4547
4819
 
4548
4820
  <xsl:attribute name="internal-destination">
@@ -4647,6 +4919,8 @@
4647
4919
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
4648
4920
  <fo:block margin-bottom="12pt" text-align="left">
4649
4921
 
4922
+ <xsl:call-template name="refine_dl_formula_where_style"/>
4923
+
4650
4924
  <!-- <xsl:variable name="title-where">
4651
4925
  <xsl:call-template name="getLocalizedString">
4652
4926
  <xsl:with-param name="key">where</xsl:with-param>
@@ -4660,6 +4934,8 @@
4660
4934
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
4661
4935
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
4662
4936
 
4937
+ <xsl:call-template name="refine_figure_key_style"/>
4938
+
4663
4939
  <xsl:variable name="title-key">
4664
4940
  <xsl:call-template name="getLocalizedString">
4665
4941
  <xsl:with-param name="key">key</xsl:with-param>
@@ -4674,12 +4950,16 @@
4674
4950
  <xsl:if test="$onlyOneComponent = 'false'">
4675
4951
  <fo:block>
4676
4952
 
4953
+ <xsl:call-template name="refine_multicomponent_style"/>
4954
+
4677
4955
  <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
4678
4956
  <xsl:attribute name="margin-top">0</xsl:attribute>
4679
4957
  </xsl:if>
4680
4958
 
4681
4959
  <fo:block>
4682
4960
 
4961
+ <xsl:call-template name="refine_multicomponent_block_style"/>
4962
+
4683
4963
  <xsl:apply-templates select="*[local-name() = 'name']">
4684
4964
  <xsl:with-param name="process">true</xsl:with-param>
4685
4965
  </xsl:apply-templates>
@@ -4837,6 +5117,24 @@
4837
5117
 
4838
5118
  </xsl:template> <!-- END: dl -->
4839
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
+
4840
5138
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
4841
5139
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
4842
5140
 
@@ -5063,10 +5361,7 @@
5063
5361
 
5064
5362
  </xsl:if>
5065
5363
 
5066
- <xsl:if test="not(ancestor::ogc:sourcecode)">
5067
- <!-- <xsl:attribute name="border-left">1pt solid <xsl:value-of select="$color_design"/></xsl:attribute> -->
5068
- <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dt"/></xsl:attribute>
5069
- </xsl:if>
5364
+ <xsl:call-template name="refine_dt-cell-style"/>
5070
5365
 
5071
5366
  <fo:block xsl:use-attribute-sets="dt-block-style">
5072
5367
  <xsl:copy-of select="@id"/>
@@ -5075,12 +5370,7 @@
5075
5370
  <xsl:attribute name="margin-top">0</xsl:attribute>
5076
5371
  </xsl:if>
5077
5372
 
5078
- <xsl:if test="ancestor::ogc:sourcecode">
5079
- <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
5080
- </xsl:if>
5081
- <xsl:if test="not(following-sibling::ogc:dt)"> <!-- last dt -->
5082
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
5083
- </xsl:if>
5373
+ <xsl:call-template name="refine_dt-block-style"/>
5084
5374
 
5085
5375
  <xsl:apply-templates>
5086
5376
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -5101,9 +5391,7 @@
5101
5391
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
5102
5392
  </xsl:if>
5103
5393
 
5104
- <xsl:if test="not(ancestor::ogc:sourcecode)">
5105
- <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dd"/></xsl:attribute>
5106
- </xsl:if>
5394
+ <xsl:call-template name="refine_dd-cell-style"/>
5107
5395
 
5108
5396
  <fo:block>
5109
5397
 
@@ -5255,12 +5543,18 @@
5255
5543
  <xsl:param name="split_keep-within-line"/>
5256
5544
  <fo:inline font-weight="bold">
5257
5545
 
5546
+ <xsl:call-template name="refine_strong_style"/>
5547
+
5258
5548
  <xsl:apply-templates>
5259
5549
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
5260
5550
  </xsl:apply-templates>
5261
5551
  </fo:inline>
5262
5552
  </xsl:template>
5263
5553
 
5554
+ <xsl:template name="refine_strong_style">
5555
+
5556
+ </xsl:template>
5557
+
5264
5558
  <xsl:template match="*[local-name()='padding']">
5265
5559
  <fo:inline padding-right="{@value}"> </fo:inline>
5266
5560
  </xsl:template>
@@ -6407,6 +6701,11 @@
6407
6701
 
6408
6702
  <fo:inline xsl:use-attribute-sets="mathml-style">
6409
6703
 
6704
+ <!-- DEBUG -->
6705
+ <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> -->
6706
+
6707
+ <xsl:call-template name="refine_mathml-style"/>
6708
+
6410
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 -->
6411
6710
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
6412
6711
  </xsl:if>
@@ -6511,6 +6810,8 @@
6511
6810
 
6512
6811
  <fo:instream-foreign-object fox:alt-text="Math">
6513
6812
 
6813
+ <xsl:call-template name="refine_mathml_insteam_object_style"/>
6814
+
6514
6815
  <!-- put MathML in Actual Text -->
6515
6816
  <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
6516
6817
  <xsl:attribute name="fox:actual-text">
@@ -6531,6 +6832,10 @@
6531
6832
  </fo:instream-foreign-object>
6532
6833
  </xsl:template>
6533
6834
 
6835
+ <xsl:template name="refine_mathml_insteam_object_style">
6836
+
6837
+ </xsl:template> <!-- refine_mathml_insteam_object_style -->
6838
+
6534
6839
  <xsl:template match="mathml:*" mode="mathml_actual_text">
6535
6840
  <!-- <xsl:text>a+b</xsl:text> -->
6536
6841
  <xsl:text>&lt;</xsl:text>
@@ -6675,6 +6980,8 @@
6675
6980
  <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
6676
6981
  <fo:inline xsl:use-attribute-sets="mathml-style">
6677
6982
 
6983
+ <xsl:call-template name="refine_mathml-style"/>
6984
+
6678
6985
  <xsl:choose>
6679
6986
  <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
6680
6987
  <xsl:otherwise>
@@ -6719,6 +7026,8 @@
6719
7026
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6720
7027
  </xsl:if>
6721
7028
 
7029
+ <xsl:call-template name="refine_link-style"/>
7030
+
6722
7031
  <xsl:choose>
6723
7032
  <xsl:when test="$target_text = ''">
6724
7033
  <xsl:apply-templates/>
@@ -6810,6 +7119,9 @@
6810
7119
  <xsl:call-template name="insert_basic_link">
6811
7120
  <xsl:with-param name="element">
6812
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>
6813
7125
  <xsl:if test="parent::*[local-name() = 'add']">
6814
7126
  <xsl:call-template name="append_add-style"/>
6815
7127
  </xsl:if>
@@ -6871,6 +7183,8 @@
6871
7183
  <fo:table-cell display-align="center">
6872
7184
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
6873
7185
 
7186
+ <xsl:call-template name="refine_formula-stem-block-style"/>
7187
+
6874
7188
  <xsl:apply-templates/>
6875
7189
  </fo:block>
6876
7190
  </fo:table-cell>
@@ -6912,16 +7226,18 @@
6912
7226
 
6913
7227
  <xsl:call-template name="setBlockSpanAll"/>
6914
7228
 
6915
- <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)">
6916
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
6917
- </xsl:if>
7229
+ <xsl:call-template name="refine_note-style"/>
6918
7230
 
6919
7231
  <fo:block-container margin-left="0mm" margin-right="0mm">
6920
7232
 
6921
7233
  <fo:block>
6922
7234
 
7235
+ <xsl:call-template name="refine_note_block_style"/>
7236
+
6923
7237
  <fo:inline xsl:use-attribute-sets="note-name-style">
6924
7238
 
7239
+ <xsl:call-template name="refine_note-name-style"/>
7240
+
6925
7241
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6926
7242
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6927
7243
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -6947,6 +7263,10 @@
6947
7263
 
6948
7264
  </xsl:template>
6949
7265
 
7266
+ <xsl:template name="refine_note_block_style">
7267
+
7268
+ </xsl:template>
7269
+
6950
7270
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
6951
7271
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6952
7272
  <xsl:choose>
@@ -6968,12 +7288,16 @@
6968
7288
 
6969
7289
  <xsl:call-template name="setBlockSpanAll"/>
6970
7290
 
7291
+ <xsl:call-template name="refine_termnote-style"/>
7292
+
6971
7293
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
6972
7294
 
6973
7295
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
6974
7296
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
6975
7297
  </xsl:if>
6976
7298
 
7299
+ <xsl:call-template name="refine_termnote-name-style"/>
7300
+
6977
7301
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6978
7302
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6979
7303
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -7147,6 +7471,8 @@
7147
7471
  <xsl:otherwise>
7148
7472
  <fo:block xsl:use-attribute-sets="image-style">
7149
7473
 
7474
+ <xsl:call-template name="refine_image-style"/>
7475
+
7150
7476
  <xsl:variable name="src">
7151
7477
  <xsl:call-template name="image_src"/>
7152
7478
  </xsl:variable>
@@ -8014,6 +8340,8 @@
8014
8340
  <xsl:if test="normalize-space() != ''">
8015
8341
  <fo:block xsl:use-attribute-sets="figure-name-style">
8016
8342
 
8343
+ <xsl:call-template name="refine_figure-name-style"/>
8344
+
8017
8345
  <xsl:apply-templates/>
8018
8346
  </fo:block>
8019
8347
  </xsl:if>
@@ -8286,9 +8614,7 @@
8286
8614
  </xsl:attribute>
8287
8615
  </xsl:for-each>
8288
8616
 
8289
- <xsl:if test="parent::*[local-name() = 'example']">
8290
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8291
- </xsl:if>
8617
+ <xsl:call-template name="refine_sourcecode-style"/>
8292
8618
 
8293
8619
  <!-- remove margin between rows in the table with sourcecode line numbers -->
8294
8620
  <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
@@ -9020,6 +9346,8 @@
9020
9346
 
9021
9347
  <xsl:call-template name="setBlockSpanAll"/>
9022
9348
 
9349
+ <xsl:call-template name="refine_example-style"/>
9350
+
9023
9351
  <xsl:variable name="fo_element">
9024
9352
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
9025
9353
  inline
@@ -9147,6 +9475,8 @@
9147
9475
  </xsl:if>
9148
9476
  <fo:block xsl:use-attribute-sets="example-p-style">
9149
9477
 
9478
+ <xsl:call-template name="refine_example-p-style"/>
9479
+
9150
9480
  <xsl:apply-templates/>
9151
9481
  </fo:block>
9152
9482
  </fo:block-container>
@@ -9163,6 +9493,7 @@
9163
9493
  </xsl:otherwise>
9164
9494
  </xsl:choose>
9165
9495
  </xsl:template> <!-- example/p -->
9496
+
9166
9497
  <!-- ====== -->
9167
9498
  <!-- ====== -->
9168
9499
 
@@ -9174,6 +9505,8 @@
9174
9505
  <xsl:template match="*[local-name() = 'termsource']" name="termsource">
9175
9506
  <fo:block xsl:use-attribute-sets="termsource-style">
9176
9507
 
9508
+ <xsl:call-template name="refine_termsource-style"/>
9509
+
9177
9510
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
9178
9511
  <xsl:variable name="termsource_text">
9179
9512
  <xsl:apply-templates/>
@@ -9289,6 +9622,8 @@
9289
9622
  <fo:block-container margin-left="0mm">
9290
9623
  <fo:block-container xsl:use-attribute-sets="quote-style">
9291
9624
 
9625
+ <xsl:call-template name="refine_quote-style"/>
9626
+
9292
9627
  <fo:block-container margin-left="0mm" margin-right="0mm">
9293
9628
  <fo:block role="BlockQuote">
9294
9629
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
@@ -9363,8 +9698,7 @@
9363
9698
 
9364
9699
  </xsl:if>
9365
9700
 
9366
- <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
9367
- <xsl:variable name="text" select="normalize-space()"/>
9701
+ <xsl:call-template name="refine_eref-style"/>
9368
9702
 
9369
9703
  <xsl:call-template name="insert_basic_link">
9370
9704
  <xsl:with-param name="element">
@@ -9374,6 +9708,8 @@
9374
9708
  </xsl:if>
9375
9709
  <xsl:if test="@type = 'inline'">
9376
9710
 
9711
+ <xsl:call-template name="refine_basic_link_style"/>
9712
+
9377
9713
  </xsl:if>
9378
9714
 
9379
9715
  <xsl:choose>
@@ -9406,6 +9742,11 @@
9406
9742
  </xsl:otherwise>
9407
9743
  </xsl:choose>
9408
9744
  </xsl:template>
9745
+
9746
+ <xsl:template name="refine_basic_link_style">
9747
+
9748
+ </xsl:template> <!-- refine_basic_link_style -->
9749
+
9409
9750
  <!-- ====== -->
9410
9751
  <!-- END eref -->
9411
9752
  <!-- ====== -->
@@ -9549,16 +9890,22 @@
9549
9890
  <fo:block>
9550
9891
  <xsl:call-template name="setId"/>
9551
9892
 
9552
- <xsl:variable name="pos"><xsl:number count="ogc:sections/ogc:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms -->
9553
- <xsl:if test="$pos &gt;= 2">
9554
- <xsl:attribute name="space-before">18pt</xsl:attribute>
9555
- </xsl:if>
9893
+ <xsl:call-template name="sections_element_style"/>
9556
9894
 
9557
9895
  <xsl:apply-templates/>
9558
9896
  </fo:block>
9559
9897
 
9560
9898
  </xsl:template>
9561
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
+
9562
9909
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
9563
9910
  <fo:block break-after="page"/>
9564
9911
  <fo:block>
@@ -9573,10 +9920,16 @@
9573
9920
 
9574
9921
  <xsl:call-template name="setBlockSpanAll"/>
9575
9922
 
9923
+ <xsl:call-template name="refine_clause_style"/>
9924
+
9576
9925
  <xsl:apply-templates/>
9577
9926
  </fo:block>
9578
9927
  </xsl:template>
9579
9928
 
9929
+ <xsl:template name="refine_clause_style">
9930
+
9931
+ </xsl:template> <!-- refine_clause_style -->
9932
+
9580
9933
  <xsl:template match="*[local-name() = 'definitions']">
9581
9934
  <fo:block id="{@id}">
9582
9935
  <xsl:apply-templates/>
@@ -9589,10 +9942,16 @@
9589
9942
 
9590
9943
  <xsl:call-template name="setBlockSpanAll"/>
9591
9944
 
9945
+ <xsl:call-template name="refine_annex_style"/>
9946
+
9592
9947
  </fo:block>
9593
9948
  <xsl:apply-templates/>
9594
9949
  </xsl:template>
9595
9950
 
9951
+ <xsl:template name="refine_annex_style">
9952
+
9953
+ </xsl:template>
9954
+
9596
9955
  <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
9597
9956
  <!-- comment 2019-11-29 -->
9598
9957
  <!-- <fo:block font-weight="bold">Review:</fo:block>
@@ -9757,6 +10116,8 @@
9757
10116
  </xsl:choose>
9758
10117
  </xsl:attribute>
9759
10118
 
10119
+ <xsl:call-template name="refine_list_container_style"/>
10120
+
9760
10121
  <fo:block-container margin-left="0mm">
9761
10122
  <fo:block>
9762
10123
  <xsl:apply-templates select="." mode="list"/>
@@ -9774,6 +10135,10 @@
9774
10135
  </xsl:choose>
9775
10136
  </xsl:template>
9776
10137
 
10138
+ <xsl:template name="refine_list_container_style">
10139
+
10140
+ </xsl:template> <!-- refine_list_container_style -->
10141
+
9777
10142
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
9778
10143
 
9779
10144
  <xsl:apply-templates select="*[local-name() = 'name']">
@@ -9784,7 +10149,7 @@
9784
10149
 
9785
10150
  <xsl:variable name="provisional_distance_between_starts_">
9786
10151
  <attributes xsl:use-attribute-sets="list-style">
9787
-
10152
+ <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/>
9788
10153
  </attributes>
9789
10154
  </xsl:variable>
9790
10155
  <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/>
@@ -9820,6 +10185,8 @@
9820
10185
  <addon><xsl:value-of select="$addon"/></addon> -->
9821
10186
  </xsl:if>
9822
10187
 
10188
+ <xsl:call-template name="refine_list-style"/>
10189
+
9823
10190
  <xsl:if test="*[local-name() = 'name']">
9824
10191
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
9825
10192
  </xsl:if>
@@ -9832,6 +10199,10 @@
9832
10199
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
9833
10200
  </xsl:template>
9834
10201
 
10202
+ <xsl:template name="refine_list-style_provisional-distance-between-starts">
10203
+
10204
+ </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
10205
+
9835
10206
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
9836
10207
  <xsl:param name="process">false</xsl:param>
9837
10208
  <xsl:if test="$process = 'true'">
@@ -9845,27 +10216,26 @@
9845
10216
  <fo:list-item xsl:use-attribute-sets="list-item-style">
9846
10217
  <xsl:copy-of select="@id"/>
9847
10218
 
10219
+ <xsl:call-template name="refine_list-item-style"/>
10220
+
9848
10221
  <fo:list-item-label end-indent="label-end()">
9849
10222
  <fo:block xsl:use-attribute-sets="list-item-label-style">
9850
10223
 
10224
+ <xsl:call-template name="refine_list-item-label-style"/>
10225
+
9851
10226
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
9852
10227
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
9853
10228
  <xsl:call-template name="append_add-style"/>
9854
10229
  </xsl:if>
9855
10230
 
9856
- <xsl:call-template name="getListItemFormat"/>
10231
+ <xsl:call-template name="getListItemFormat"/>
10232
+
9857
10233
  </fo:block>
9858
10234
  </fo:list-item-label>
9859
10235
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
9860
10236
  <fo:block>
9861
10237
 
9862
- <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
9863
- <xsl:if test="ancestor::ogc:table[not(@class)]">
9864
- <xsl:attribute name="margin-bottom">1mm</xsl:attribute>
9865
- </xsl:if>
9866
- <xsl:if test="not(following-sibling::*) and not(../following-sibling::*)">
9867
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
9868
- </xsl:if>
10238
+ <xsl:call-template name="refine_list-item-body-style"/>
9869
10239
 
9870
10240
  <xsl:apply-templates/>
9871
10241
 
@@ -10184,6 +10554,7 @@
10184
10554
 
10185
10555
  <fo:block id="{@id}">
10186
10556
  <xsl:apply-templates/>
10557
+
10187
10558
  </fo:block>
10188
10559
  </xsl:template>
10189
10560
 
@@ -10203,6 +10574,7 @@
10203
10574
 
10204
10575
  <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
10205
10576
  <xsl:apply-templates/>
10577
+
10206
10578
  </fo:block>
10207
10579
 
10208
10580
  </xsl:template> <!-- references -->
@@ -10781,6 +11153,9 @@
10781
11153
  </xsl:copy>
10782
11154
  </xsl:template>
10783
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
+
10784
11159
  <xsl:template name="add_id">
10785
11160
  <xsl:if test="not(@id)">
10786
11161
  <!-- add @id - first element with @id plus '_element_name' -->
@@ -11065,6 +11440,14 @@
11065
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">
11066
11441
  <xsl:variable name="p_fn_">
11067
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> -->
11068
11451
  </xsl:variable>
11069
11452
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
11070
11453
  <xsl:variable name="gen_id" select="generate-id(.)"/>
@@ -11079,8 +11462,14 @@
11079
11462
  <xsl:attribute name="current_fn_number">
11080
11463
  <xsl:value-of select="$current_fn_number"/>
11081
11464
  </xsl:attribute>
11465
+ <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
11082
11466
  <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
11083
- <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)"/>
11084
11473
  </xsl:attribute>
11085
11474
  <xsl:apply-templates select="node()" mode="linear_xml"/>
11086
11475
  </xsl:copy>