metanorma-itu 2.7.0 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -132,13 +132,13 @@
132
132
  <fo:region-start region-name="left-region" extent="19.2mm"/>
133
133
  <fo:region-end region-name="right-region" extent="19.2mm"/>
134
134
  </fo:simple-page-master>
135
- <fo:page-sequence-master master-name="document-preface">
135
+ <fo:page-sequence-master master-name="preface">
136
136
  <fo:repeatable-page-master-alternatives>
137
137
  <fo:conditional-page-master-reference odd-or-even="even" master-reference="even-preface"/>
138
138
  <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd-preface"/>
139
139
  </fo:repeatable-page-master-alternatives>
140
140
  </fo:page-sequence-master>
141
- <fo:page-sequence-master master-name="document-preface-landscape">
141
+ <fo:page-sequence-master master-name="preface-landscape">
142
142
  <fo:repeatable-page-master-alternatives>
143
143
  <fo:conditional-page-master-reference odd-or-even="even" master-reference="even-preface-landscape"/>
144
144
  <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd-preface-landscape"/>
@@ -321,7 +321,6 @@
321
321
  </xsl:variable>
322
322
 
323
323
  <xsl:variable name="i18n_keywords"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">keywords</xsl:with-param><xsl:with-param name="bibdata_updated" select="/*/mn:bibdata"/></xsl:call-template></xsl:variable>
324
- <xsl:variable name="i18n_page"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">Page.sg</xsl:with-param><xsl:with-param name="bibdata_updated" select="/*/mn:bibdata"/></xsl:call-template></xsl:variable>
325
324
 
326
325
  <xsl:call-template name="cover-page">
327
326
  <xsl:with-param name="num" select="$num"/>
@@ -345,7 +344,7 @@
345
344
 
346
345
  <xsl:for-each select=".//mn:page_sequence[parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
347
346
 
348
- <fo:page-sequence master-reference="document-preface" format="i" force-page-count="no-force">
347
+ <fo:page-sequence master-reference="preface" format="i" force-page-count="no-force">
349
348
 
350
349
  <xsl:if test="$doctype = 'resolution'">
351
350
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -356,7 +355,7 @@
356
355
  </xsl:if>
357
356
 
358
357
  <xsl:attribute name="master-reference">
359
- <xsl:text>document-preface</xsl:text>
358
+ <xsl:text>preface</xsl:text>
360
359
  <xsl:call-template name="getPageSequenceOrientation"/>
361
360
  </xsl:attribute>
362
361
 
@@ -1827,20 +1826,20 @@
1827
1826
 
1828
1827
  <xsl:template name="insertListOf_Title">
1829
1828
  <xsl:param name="title"/>
1830
- <fo:block space-before="36pt" text-align="center" font-weight="bold" keep-with-next="always">
1829
+ <fo:block xsl:use-attribute-sets="toc-listof-title-style">
1831
1830
  <xsl:value-of select="$title"/>
1832
1831
  </fo:block>
1833
1832
  </xsl:template>
1834
1833
 
1835
1834
  <xsl:template name="insertListOf_Item">
1836
- <fo:block text-align-last="justify" margin-top="6pt" role="TOCI">
1835
+ <fo:block xsl:use-attribute-sets="toc-listof-item-style">
1837
1836
  <fo:basic-link internal-destination="{@id}">
1838
1837
  <xsl:call-template name="setAltText">
1839
1838
  <xsl:with-param name="value" select="@alt-text"/>
1840
1839
  </xsl:call-template>
1841
1840
  <xsl:apply-templates select="." mode="contents"/>
1842
1841
  <fo:inline keep-together.within-line="always">
1843
- <fo:leader leader-pattern="dots"/>
1842
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
1844
1843
  <fo:page-number-citation ref-id="{@id}"/>
1845
1844
  </fo:inline>
1846
1845
  </fo:basic-link>
@@ -1864,14 +1863,11 @@
1864
1863
  <xsl:if test="count(*) = 1 and mn:fmt-title"> <!-- if there isn't user ToC -->
1865
1864
 
1866
1865
  <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:item[@display = 'true']">
1867
- <fo:block role="TOCI">
1868
- <xsl:if test="@level = 1">
1869
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
1870
- </xsl:if>
1871
- <xsl:if test="@level &gt;= 2">
1872
- <xsl:attribute name="margin-top">4pt</xsl:attribute>
1873
- <!-- <xsl:attribute name="margin-left">12mm</xsl:attribute> -->
1874
- </xsl:if>
1866
+
1867
+ <fo:block xsl:use-attribute-sets="toc-item-style">
1868
+
1869
+ <xsl:call-template name="refine_toc-item-style"/>
1870
+
1875
1871
  <fo:list-block provisional-label-separation="3mm">
1876
1872
  <xsl:attribute name="provisional-distance-between-starts">
1877
1873
  <xsl:choose>
@@ -1885,7 +1881,7 @@
1885
1881
  </xsl:choose>
1886
1882
  </xsl:if>
1887
1883
  <xsl:if test="@level &gt;= 2"><xsl:value-of select="(@level - 1) * 26"/>mm</xsl:if>
1888
- </xsl:when> <!-- -->
1884
+ </xsl:when>
1889
1885
  <xsl:otherwise>0mm</xsl:otherwise>
1890
1886
  </xsl:choose>
1891
1887
  </xsl:attribute>
@@ -1905,7 +1901,7 @@
1905
1901
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{mnx:title}">
1906
1902
  <xsl:apply-templates select="mnx:title"/>
1907
1903
  <fo:inline keep-together.within-line="always">
1908
- <fo:leader leader-pattern="dots"/>
1904
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
1909
1905
  <fo:page-number-citation ref-id="{@id}"/>
1910
1906
  </fo:inline>
1911
1907
  </fo:basic-link>
@@ -1919,34 +1915,30 @@
1919
1915
  <xsl:variable name="i18n_page"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">Page.sg</xsl:with-param><xsl:with-param name="bibdata_updated" select="/*/mn:bibdata"/></xsl:call-template></xsl:variable>
1920
1916
 
1921
1917
  <!-- List of Tables -->
1922
- <xsl:if test="$contents//mnx:tables/mnx:table">
1923
- <xsl:call-template name="insertListOf_Title">
1924
- <xsl:with-param name="title" select="$title-list-tables"/>
1925
- </xsl:call-template>
1926
- <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
1927
- <xsl:value-of select="$i18n_page"/>
1928
- </fo:block>
1929
- <fo:block-container>
1930
- <xsl:for-each select="$contents//mnx:tables/mnx:table">
1931
- <xsl:call-template name="insertListOf_Item"/>
1932
- </xsl:for-each>
1933
- </fo:block-container>
1934
- </xsl:if>
1918
+ <xsl:for-each select="$contents//mnx:tables/mnx:table">
1919
+ <xsl:if test="position() = 1">
1920
+ <xsl:call-template name="insertListOf_Title">
1921
+ <xsl:with-param name="title" select="$title-list-tables"/>
1922
+ </xsl:call-template>
1923
+ <fo:block xsl:use-attribute-sets="toc-title-page-style">
1924
+ <xsl:value-of select="$i18n_page"/>
1925
+ </fo:block>
1926
+ </xsl:if>
1927
+ <xsl:call-template name="insertListOf_Item"/>
1928
+ </xsl:for-each>
1935
1929
 
1936
1930
  <!-- List of Figures -->
1937
- <xsl:if test="$contents//mnx:figures/mnx:figure">
1938
- <xsl:call-template name="insertListOf_Title">
1939
- <xsl:with-param name="title" select="$title-list-figures"/>
1940
- </xsl:call-template>
1941
- <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
1942
- <xsl:value-of select="$i18n_page"/>
1943
- </fo:block>
1944
- <fo:block-container>
1945
- <xsl:for-each select="$contents//mnx:figures/mnx:figure">
1946
- <xsl:call-template name="insertListOf_Item"/>
1947
- </xsl:for-each>
1948
- </fo:block-container>
1949
- </xsl:if>
1931
+ <xsl:for-each select="$contents//mnx:figures/mnx:figure">
1932
+ <xsl:if test="position() = 1">
1933
+ <xsl:call-template name="insertListOf_Title">
1934
+ <xsl:with-param name="title" select="$title-list-figures"/>
1935
+ </xsl:call-template>
1936
+ <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
1937
+ <xsl:value-of select="$i18n_page"/>
1938
+ </fo:block>
1939
+ </xsl:if>
1940
+ <xsl:call-template name="insertListOf_Item"/>
1941
+ </xsl:for-each>
1950
1942
 
1951
1943
  </xsl:if>
1952
1944
  </fo:block>
@@ -1956,15 +1948,11 @@
1956
1948
  </xsl:template>
1957
1949
 
1958
1950
  <xsl:template match="mn:preface//mn:clause[@type = 'toc']/mn:fmt-title" priority="4">
1959
- <fo:block margin-top="6pt" text-align="center" font-weight="bold" role="H1">
1960
- <!-- <xsl:call-template name="getLocalizedString">
1961
- <xsl:with-param name="key">table_of_contents</xsl:with-param>
1962
- </xsl:call-template> -->
1951
+ <fo:block xsl:use-attribute-sets="toc-title-style">
1963
1952
  <xsl:apply-templates/>
1964
1953
  </fo:block>
1965
- <fo:block margin-top="6pt" text-align="end" font-weight="bold">
1966
- <xsl:variable name="i18n_page"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">Page.sg</xsl:with-param><xsl:with-param name="bibdata_updated" select="/*/mn:bibdata"/></xsl:call-template></xsl:variable>
1967
- <xsl:value-of select="$i18n_page"/>
1954
+ <fo:block xsl:use-attribute-sets="toc-title-page-style">
1955
+ <xsl:call-template name="getLocalizedString"><xsl:with-param name="key">Page.sg</xsl:with-param><xsl:with-param name="bibdata_updated" select="/*/mn:bibdata"/></xsl:call-template>
1968
1956
  </fo:block>
1969
1957
  </xsl:template>
1970
1958
 
@@ -8120,6 +8108,16 @@
8120
8108
  </xsl:variable>
8121
8109
  <xsl:variable name="quot">"</xsl:variable>
8122
8110
  <xsl:variable name="styles_">
8111
+ <!-- PDF: Borderless tables https://github.com/metanorma/metanorma-jis/issues/344 -->
8112
+ <xsl:if test="@plain = 'true' or ancestor::mn:table/@plain = 'true'">
8113
+ <style name="border-top">none</style>
8114
+ <style name="border-right">none</style>
8115
+ <style name="border-left">none</style>
8116
+ <style name="border-bottom">none</style>
8117
+ <style name="color">inherit</style>
8118
+ <style name="background-color">transparent</style>
8119
+ </xsl:if>
8120
+
8123
8121
  <xsl:for-each select="xalan:nodeset($styles__)/mnx:item">
8124
8122
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
8125
8123
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
@@ -10152,7 +10150,10 @@
10152
10150
 
10153
10151
  <xsl:call-template name="setNamedDestination"/>
10154
10152
 
10155
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
10153
+ <fo:block-container xsl:use-attribute-sets="note-style" role="SKIP">
10154
+ <xsl:if test="not(parent::mn:references)">
10155
+ <xsl:copy-of select="@id"/>
10156
+ </xsl:if>
10156
10157
 
10157
10158
  <xsl:call-template name="setBlockSpanAll"/>
10158
10159
 
@@ -12848,8 +12849,8 @@
12848
12849
  </xsl:template> <!-- bibitem -->
12849
12850
 
12850
12851
  <!-- Bibliography (non-normative references) -->
12851
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
12852
- <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
12852
+ <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem | mn:references[not(@normative='true')]/mn:note" name="bibitem_non_normative" priority="2">
12853
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[not(self::mn:note)][1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
12853
12854
  <xsl:choose>
12854
12855
  <xsl:when test="$skip = 'true'"><!-- skip bibitem --></xsl:when>
12855
12856
  <xsl:otherwise>
@@ -12887,7 +12888,7 @@
12887
12888
  </fo:list-item>
12888
12889
  </xsl:otherwise>
12889
12890
  </xsl:choose>
12890
- <xsl:apply-templates select="following-sibling::*[1][self::mn:bibitem]">
12891
+ <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
12891
12892
  <xsl:with-param name="skip">false</xsl:with-param>
12892
12893
  </xsl:apply-templates>
12893
12894
  </xsl:template>
@@ -12955,8 +12956,25 @@
12955
12956
  </xsl:choose>
12956
12957
  <!-- end ITU bibitem processing -->
12957
12958
 
12959
+ <xsl:call-template name="processBibliographyNote"/>
12958
12960
  </xsl:template> <!-- processBibitem (bibitem) -->
12959
12961
 
12962
+ <xsl:template name="processBibliographyNote">
12963
+ <xsl:if test="self::mn:note">
12964
+ <xsl:variable name="note_node">
12965
+ <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
12966
+ <xsl:copy> <!-- skip @id -->
12967
+ <xsl:copy-of select="node()"/>
12968
+ </xsl:copy>
12969
+ </xsl:element>
12970
+ </xsl:variable>
12971
+ <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
12972
+ <xsl:call-template name="note"/>
12973
+ </xsl:for-each> -->
12974
+ <xsl:call-template name="note"/>
12975
+ </xsl:if>
12976
+ </xsl:template>
12977
+
12960
12978
  <xsl:template match="mn:title" mode="title">
12961
12979
  <fo:inline><xsl:apply-templates/></fo:inline>
12962
12980
  </xsl:template>
@@ -13502,6 +13520,70 @@
13502
13520
  <!-- End Form's elements processing -->
13503
13521
  <!-- =================== -->
13504
13522
 
13523
+ <xsl:attribute-set name="toc-style">
13524
+ </xsl:attribute-set>
13525
+
13526
+ <xsl:template name="refine_toc-style">
13527
+ </xsl:template>
13528
+
13529
+ <xsl:attribute-set name="toc-title-style">
13530
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
13531
+ <xsl:attribute name="text-align">center</xsl:attribute>
13532
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
13533
+ <xsl:attribute name="role">H1</xsl:attribute>
13534
+ </xsl:attribute-set>
13535
+
13536
+ <xsl:attribute-set name="toc-title-page-style">
13537
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
13538
+ <xsl:attribute name="text-align">end</xsl:attribute>
13539
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
13540
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
13541
+ </xsl:attribute-set> <!-- toc-title-page-style -->
13542
+
13543
+ <xsl:attribute-set name="toc-item-block-style">
13544
+ </xsl:attribute-set>
13545
+
13546
+ <xsl:template name="refine_toc-item-block-style">
13547
+ </xsl:template>
13548
+
13549
+ <xsl:attribute-set name="toc-item-style">
13550
+ <xsl:attribute name="role">TOCI</xsl:attribute>
13551
+ </xsl:attribute-set> <!-- END: toc-item-style -->
13552
+
13553
+ <xsl:template name="refine_toc-item-style">
13554
+ <xsl:if test="@level = 1">
13555
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
13556
+ </xsl:if>
13557
+ <xsl:if test="@level &gt;= 2">
13558
+ <xsl:attribute name="margin-top">4pt</xsl:attribute>
13559
+ <!-- <xsl:attribute name="margin-left">12mm</xsl:attribute> -->
13560
+ </xsl:if>
13561
+ </xsl:template> <!-- END: refine_toc-item-style -->
13562
+
13563
+ <xsl:attribute-set name="toc-leader-style">
13564
+ <xsl:attribute name="leader-pattern">dots</xsl:attribute>
13565
+ </xsl:attribute-set> <!-- END: toc-leader-style -->
13566
+
13567
+ <xsl:attribute-set name="toc-pagenumber-style">
13568
+ </xsl:attribute-set>
13569
+
13570
+ <!-- List of Figures, Tables -->
13571
+ <xsl:attribute-set name="toc-listof-title-style">
13572
+ <xsl:attribute name="space-before">36pt</xsl:attribute>
13573
+ <xsl:attribute name="text-align">center</xsl:attribute>
13574
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
13575
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
13576
+ </xsl:attribute-set>
13577
+
13578
+ <xsl:attribute-set name="toc-listof-item-block-style">
13579
+ </xsl:attribute-set>
13580
+
13581
+ <xsl:attribute-set name="toc-listof-item-style">
13582
+ <xsl:attribute name="role">TOCI</xsl:attribute>
13583
+ <xsl:attribute name="text-align-last">justify</xsl:attribute>
13584
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
13585
+ </xsl:attribute-set>
13586
+
13505
13587
  <xsl:template name="processPrefaceSectionsDefault_Contents">
13506
13588
  <xsl:variable name="nodes_preface_">
13507
13589
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -132,13 +132,13 @@
132
132
  <fo:region-start region-name="left-region" extent="19.2mm"/>
133
133
  <fo:region-end region-name="right-region" extent="19.2mm"/>
134
134
  </fo:simple-page-master>
135
- <fo:page-sequence-master master-name="document-preface">
135
+ <fo:page-sequence-master master-name="preface">
136
136
  <fo:repeatable-page-master-alternatives>
137
137
  <fo:conditional-page-master-reference odd-or-even="even" master-reference="even-preface"/>
138
138
  <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd-preface"/>
139
139
  </fo:repeatable-page-master-alternatives>
140
140
  </fo:page-sequence-master>
141
- <fo:page-sequence-master master-name="document-preface-landscape">
141
+ <fo:page-sequence-master master-name="preface-landscape">
142
142
  <fo:repeatable-page-master-alternatives>
143
143
  <fo:conditional-page-master-reference odd-or-even="even" master-reference="even-preface-landscape"/>
144
144
  <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd-preface-landscape"/>
@@ -321,7 +321,6 @@
321
321
  </xsl:variable>
322
322
 
323
323
  <xsl:variable name="i18n_keywords"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">keywords</xsl:with-param><xsl:with-param name="bibdata_updated" select="/*/mn:bibdata"/></xsl:call-template></xsl:variable>
324
- <xsl:variable name="i18n_page"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">Page.sg</xsl:with-param><xsl:with-param name="bibdata_updated" select="/*/mn:bibdata"/></xsl:call-template></xsl:variable>
325
324
 
326
325
  <xsl:call-template name="cover-page">
327
326
  <xsl:with-param name="num" select="$num"/>
@@ -345,7 +344,7 @@
345
344
 
346
345
  <xsl:for-each select=".//mn:page_sequence[parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
347
346
 
348
- <fo:page-sequence master-reference="document-preface" format="i" force-page-count="no-force">
347
+ <fo:page-sequence master-reference="preface" format="i" force-page-count="no-force">
349
348
 
350
349
  <xsl:if test="$doctype = 'resolution'">
351
350
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -356,7 +355,7 @@
356
355
  </xsl:if>
357
356
 
358
357
  <xsl:attribute name="master-reference">
359
- <xsl:text>document-preface</xsl:text>
358
+ <xsl:text>preface</xsl:text>
360
359
  <xsl:call-template name="getPageSequenceOrientation"/>
361
360
  </xsl:attribute>
362
361
 
@@ -1827,20 +1826,20 @@
1827
1826
 
1828
1827
  <xsl:template name="insertListOf_Title">
1829
1828
  <xsl:param name="title"/>
1830
- <fo:block space-before="36pt" text-align="center" font-weight="bold" keep-with-next="always">
1829
+ <fo:block xsl:use-attribute-sets="toc-listof-title-style">
1831
1830
  <xsl:value-of select="$title"/>
1832
1831
  </fo:block>
1833
1832
  </xsl:template>
1834
1833
 
1835
1834
  <xsl:template name="insertListOf_Item">
1836
- <fo:block text-align-last="justify" margin-top="6pt" role="TOCI">
1835
+ <fo:block xsl:use-attribute-sets="toc-listof-item-style">
1837
1836
  <fo:basic-link internal-destination="{@id}">
1838
1837
  <xsl:call-template name="setAltText">
1839
1838
  <xsl:with-param name="value" select="@alt-text"/>
1840
1839
  </xsl:call-template>
1841
1840
  <xsl:apply-templates select="." mode="contents"/>
1842
1841
  <fo:inline keep-together.within-line="always">
1843
- <fo:leader leader-pattern="dots"/>
1842
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
1844
1843
  <fo:page-number-citation ref-id="{@id}"/>
1845
1844
  </fo:inline>
1846
1845
  </fo:basic-link>
@@ -1864,14 +1863,11 @@
1864
1863
  <xsl:if test="count(*) = 1 and mn:fmt-title"> <!-- if there isn't user ToC -->
1865
1864
 
1866
1865
  <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:item[@display = 'true']">
1867
- <fo:block role="TOCI">
1868
- <xsl:if test="@level = 1">
1869
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
1870
- </xsl:if>
1871
- <xsl:if test="@level &gt;= 2">
1872
- <xsl:attribute name="margin-top">4pt</xsl:attribute>
1873
- <!-- <xsl:attribute name="margin-left">12mm</xsl:attribute> -->
1874
- </xsl:if>
1866
+
1867
+ <fo:block xsl:use-attribute-sets="toc-item-style">
1868
+
1869
+ <xsl:call-template name="refine_toc-item-style"/>
1870
+
1875
1871
  <fo:list-block provisional-label-separation="3mm">
1876
1872
  <xsl:attribute name="provisional-distance-between-starts">
1877
1873
  <xsl:choose>
@@ -1885,7 +1881,7 @@
1885
1881
  </xsl:choose>
1886
1882
  </xsl:if>
1887
1883
  <xsl:if test="@level &gt;= 2"><xsl:value-of select="(@level - 1) * 26"/>mm</xsl:if>
1888
- </xsl:when> <!-- -->
1884
+ </xsl:when>
1889
1885
  <xsl:otherwise>0mm</xsl:otherwise>
1890
1886
  </xsl:choose>
1891
1887
  </xsl:attribute>
@@ -1905,7 +1901,7 @@
1905
1901
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{mnx:title}">
1906
1902
  <xsl:apply-templates select="mnx:title"/>
1907
1903
  <fo:inline keep-together.within-line="always">
1908
- <fo:leader leader-pattern="dots"/>
1904
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
1909
1905
  <fo:page-number-citation ref-id="{@id}"/>
1910
1906
  </fo:inline>
1911
1907
  </fo:basic-link>
@@ -1919,34 +1915,30 @@
1919
1915
  <xsl:variable name="i18n_page"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">Page.sg</xsl:with-param><xsl:with-param name="bibdata_updated" select="/*/mn:bibdata"/></xsl:call-template></xsl:variable>
1920
1916
 
1921
1917
  <!-- List of Tables -->
1922
- <xsl:if test="$contents//mnx:tables/mnx:table">
1923
- <xsl:call-template name="insertListOf_Title">
1924
- <xsl:with-param name="title" select="$title-list-tables"/>
1925
- </xsl:call-template>
1926
- <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
1927
- <xsl:value-of select="$i18n_page"/>
1928
- </fo:block>
1929
- <fo:block-container>
1930
- <xsl:for-each select="$contents//mnx:tables/mnx:table">
1931
- <xsl:call-template name="insertListOf_Item"/>
1932
- </xsl:for-each>
1933
- </fo:block-container>
1934
- </xsl:if>
1918
+ <xsl:for-each select="$contents//mnx:tables/mnx:table">
1919
+ <xsl:if test="position() = 1">
1920
+ <xsl:call-template name="insertListOf_Title">
1921
+ <xsl:with-param name="title" select="$title-list-tables"/>
1922
+ </xsl:call-template>
1923
+ <fo:block xsl:use-attribute-sets="toc-title-page-style">
1924
+ <xsl:value-of select="$i18n_page"/>
1925
+ </fo:block>
1926
+ </xsl:if>
1927
+ <xsl:call-template name="insertListOf_Item"/>
1928
+ </xsl:for-each>
1935
1929
 
1936
1930
  <!-- List of Figures -->
1937
- <xsl:if test="$contents//mnx:figures/mnx:figure">
1938
- <xsl:call-template name="insertListOf_Title">
1939
- <xsl:with-param name="title" select="$title-list-figures"/>
1940
- </xsl:call-template>
1941
- <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
1942
- <xsl:value-of select="$i18n_page"/>
1943
- </fo:block>
1944
- <fo:block-container>
1945
- <xsl:for-each select="$contents//mnx:figures/mnx:figure">
1946
- <xsl:call-template name="insertListOf_Item"/>
1947
- </xsl:for-each>
1948
- </fo:block-container>
1949
- </xsl:if>
1931
+ <xsl:for-each select="$contents//mnx:figures/mnx:figure">
1932
+ <xsl:if test="position() = 1">
1933
+ <xsl:call-template name="insertListOf_Title">
1934
+ <xsl:with-param name="title" select="$title-list-figures"/>
1935
+ </xsl:call-template>
1936
+ <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
1937
+ <xsl:value-of select="$i18n_page"/>
1938
+ </fo:block>
1939
+ </xsl:if>
1940
+ <xsl:call-template name="insertListOf_Item"/>
1941
+ </xsl:for-each>
1950
1942
 
1951
1943
  </xsl:if>
1952
1944
  </fo:block>
@@ -1956,15 +1948,11 @@
1956
1948
  </xsl:template>
1957
1949
 
1958
1950
  <xsl:template match="mn:preface//mn:clause[@type = 'toc']/mn:fmt-title" priority="4">
1959
- <fo:block margin-top="6pt" text-align="center" font-weight="bold" role="H1">
1960
- <!-- <xsl:call-template name="getLocalizedString">
1961
- <xsl:with-param name="key">table_of_contents</xsl:with-param>
1962
- </xsl:call-template> -->
1951
+ <fo:block xsl:use-attribute-sets="toc-title-style">
1963
1952
  <xsl:apply-templates/>
1964
1953
  </fo:block>
1965
- <fo:block margin-top="6pt" text-align="end" font-weight="bold">
1966
- <xsl:variable name="i18n_page"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">Page.sg</xsl:with-param><xsl:with-param name="bibdata_updated" select="/*/mn:bibdata"/></xsl:call-template></xsl:variable>
1967
- <xsl:value-of select="$i18n_page"/>
1954
+ <fo:block xsl:use-attribute-sets="toc-title-page-style">
1955
+ <xsl:call-template name="getLocalizedString"><xsl:with-param name="key">Page.sg</xsl:with-param><xsl:with-param name="bibdata_updated" select="/*/mn:bibdata"/></xsl:call-template>
1968
1956
  </fo:block>
1969
1957
  </xsl:template>
1970
1958
 
@@ -8120,6 +8108,16 @@
8120
8108
  </xsl:variable>
8121
8109
  <xsl:variable name="quot">"</xsl:variable>
8122
8110
  <xsl:variable name="styles_">
8111
+ <!-- PDF: Borderless tables https://github.com/metanorma/metanorma-jis/issues/344 -->
8112
+ <xsl:if test="@plain = 'true' or ancestor::mn:table/@plain = 'true'">
8113
+ <style name="border-top">none</style>
8114
+ <style name="border-right">none</style>
8115
+ <style name="border-left">none</style>
8116
+ <style name="border-bottom">none</style>
8117
+ <style name="color">inherit</style>
8118
+ <style name="background-color">transparent</style>
8119
+ </xsl:if>
8120
+
8123
8121
  <xsl:for-each select="xalan:nodeset($styles__)/mnx:item">
8124
8122
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
8125
8123
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
@@ -10152,7 +10150,10 @@
10152
10150
 
10153
10151
  <xsl:call-template name="setNamedDestination"/>
10154
10152
 
10155
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
10153
+ <fo:block-container xsl:use-attribute-sets="note-style" role="SKIP">
10154
+ <xsl:if test="not(parent::mn:references)">
10155
+ <xsl:copy-of select="@id"/>
10156
+ </xsl:if>
10156
10157
 
10157
10158
  <xsl:call-template name="setBlockSpanAll"/>
10158
10159
 
@@ -12848,8 +12849,8 @@
12848
12849
  </xsl:template> <!-- bibitem -->
12849
12850
 
12850
12851
  <!-- Bibliography (non-normative references) -->
12851
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
12852
- <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
12852
+ <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem | mn:references[not(@normative='true')]/mn:note" name="bibitem_non_normative" priority="2">
12853
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[not(self::mn:note)][1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
12853
12854
  <xsl:choose>
12854
12855
  <xsl:when test="$skip = 'true'"><!-- skip bibitem --></xsl:when>
12855
12856
  <xsl:otherwise>
@@ -12887,7 +12888,7 @@
12887
12888
  </fo:list-item>
12888
12889
  </xsl:otherwise>
12889
12890
  </xsl:choose>
12890
- <xsl:apply-templates select="following-sibling::*[1][self::mn:bibitem]">
12891
+ <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
12891
12892
  <xsl:with-param name="skip">false</xsl:with-param>
12892
12893
  </xsl:apply-templates>
12893
12894
  </xsl:template>
@@ -12955,8 +12956,25 @@
12955
12956
  </xsl:choose>
12956
12957
  <!-- end ITU bibitem processing -->
12957
12958
 
12959
+ <xsl:call-template name="processBibliographyNote"/>
12958
12960
  </xsl:template> <!-- processBibitem (bibitem) -->
12959
12961
 
12962
+ <xsl:template name="processBibliographyNote">
12963
+ <xsl:if test="self::mn:note">
12964
+ <xsl:variable name="note_node">
12965
+ <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
12966
+ <xsl:copy> <!-- skip @id -->
12967
+ <xsl:copy-of select="node()"/>
12968
+ </xsl:copy>
12969
+ </xsl:element>
12970
+ </xsl:variable>
12971
+ <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
12972
+ <xsl:call-template name="note"/>
12973
+ </xsl:for-each> -->
12974
+ <xsl:call-template name="note"/>
12975
+ </xsl:if>
12976
+ </xsl:template>
12977
+
12960
12978
  <xsl:template match="mn:title" mode="title">
12961
12979
  <fo:inline><xsl:apply-templates/></fo:inline>
12962
12980
  </xsl:template>
@@ -13502,6 +13520,70 @@
13502
13520
  <!-- End Form's elements processing -->
13503
13521
  <!-- =================== -->
13504
13522
 
13523
+ <xsl:attribute-set name="toc-style">
13524
+ </xsl:attribute-set>
13525
+
13526
+ <xsl:template name="refine_toc-style">
13527
+ </xsl:template>
13528
+
13529
+ <xsl:attribute-set name="toc-title-style">
13530
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
13531
+ <xsl:attribute name="text-align">center</xsl:attribute>
13532
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
13533
+ <xsl:attribute name="role">H1</xsl:attribute>
13534
+ </xsl:attribute-set>
13535
+
13536
+ <xsl:attribute-set name="toc-title-page-style">
13537
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
13538
+ <xsl:attribute name="text-align">end</xsl:attribute>
13539
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
13540
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
13541
+ </xsl:attribute-set> <!-- toc-title-page-style -->
13542
+
13543
+ <xsl:attribute-set name="toc-item-block-style">
13544
+ </xsl:attribute-set>
13545
+
13546
+ <xsl:template name="refine_toc-item-block-style">
13547
+ </xsl:template>
13548
+
13549
+ <xsl:attribute-set name="toc-item-style">
13550
+ <xsl:attribute name="role">TOCI</xsl:attribute>
13551
+ </xsl:attribute-set> <!-- END: toc-item-style -->
13552
+
13553
+ <xsl:template name="refine_toc-item-style">
13554
+ <xsl:if test="@level = 1">
13555
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
13556
+ </xsl:if>
13557
+ <xsl:if test="@level &gt;= 2">
13558
+ <xsl:attribute name="margin-top">4pt</xsl:attribute>
13559
+ <!-- <xsl:attribute name="margin-left">12mm</xsl:attribute> -->
13560
+ </xsl:if>
13561
+ </xsl:template> <!-- END: refine_toc-item-style -->
13562
+
13563
+ <xsl:attribute-set name="toc-leader-style">
13564
+ <xsl:attribute name="leader-pattern">dots</xsl:attribute>
13565
+ </xsl:attribute-set> <!-- END: toc-leader-style -->
13566
+
13567
+ <xsl:attribute-set name="toc-pagenumber-style">
13568
+ </xsl:attribute-set>
13569
+
13570
+ <!-- List of Figures, Tables -->
13571
+ <xsl:attribute-set name="toc-listof-title-style">
13572
+ <xsl:attribute name="space-before">36pt</xsl:attribute>
13573
+ <xsl:attribute name="text-align">center</xsl:attribute>
13574
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
13575
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
13576
+ </xsl:attribute-set>
13577
+
13578
+ <xsl:attribute-set name="toc-listof-item-block-style">
13579
+ </xsl:attribute-set>
13580
+
13581
+ <xsl:attribute-set name="toc-listof-item-style">
13582
+ <xsl:attribute name="role">TOCI</xsl:attribute>
13583
+ <xsl:attribute name="text-align-last">justify</xsl:attribute>
13584
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
13585
+ </xsl:attribute-set>
13586
+
13505
13587
  <xsl:template name="processPrefaceSectionsDefault_Contents">
13506
13588
  <xsl:variable name="nodes_preface_">
13507
13589
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">