metanorma-bipm 2.8.1 → 2.8.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c19d03a9129bf06e2f40d1f3ad9f04329a7998fa93a0e0d1d7c1cf868ce757b1
4
- data.tar.gz: '04639d86b292cdca3e6bff19e6a483f61d8cd06716da5076226e55b7cca38213'
3
+ metadata.gz: df9e2b04bd0a1ad71e2b9040ed090f45cc03b33766ca1b7cbb4f40769e36ddbe
4
+ data.tar.gz: c7f43a242d288a8a0ccc2de19c7213ba4c690f51fa8a30f4085bc37a670b1e5f
5
5
  SHA512:
6
- metadata.gz: b0c76364721912ff29ac04abecb60b76f9f8585a52ddbfe5d9e6bcf4e1ac849e9c40207cf83f504273d59838fe3c89090aff8f88ee3edec2016f2d081bf7ed7c
7
- data.tar.gz: 5701338ac4a163f068c1304ff70c770c8b37ecdd618d046504e2edf1dd1eb4bca37c37712e7083cd1b5af836cfd822bb5e42803237dc7006502bd0da241b3f98
6
+ metadata.gz: b3a7803fbcddb7397f65635d865a517313235908e916670945b068029cbc5739d4ac204e9010200869ae438e2511d38e7f586bc68c03dc3c687acec915ed96c7
7
+ data.tar.gz: b6395263ecf0c791cbe61816ce0813ed3abc1eeaf5604cec6835c0622c2fd284420e737655c7bce98d849b414b2025bf113285d5c87d8a3d782805aa740df44d
@@ -1134,7 +1134,9 @@
1134
1134
  </fo:page-sequence>
1135
1135
 
1136
1136
  <xsl:if test="mn:preface/*[not(self::mn:note or self::mn:admonition)]">
1137
- <fo:page-sequence master-reference="document" force-page-count="no-force">
1137
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-preface">
1138
+ <xsl:call-template name="refine_page-sequence-preface"/>
1139
+
1138
1140
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1139
1141
 
1140
1142
  <xsl:variable name="header-title">
@@ -1163,7 +1165,9 @@
1163
1165
  <xsl:call-template name="getDocumentId"/>
1164
1166
  </xsl:variable>
1165
1167
 
1166
- <fo:page-sequence master-reference="document" force-page-count="no-force">
1168
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-preface">
1169
+ <xsl:call-template name="refine_page-sequence-preface"/>
1170
+
1167
1171
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1168
1172
 
1169
1173
  <xsl:variable name="title-toc">
@@ -2181,7 +2185,9 @@
2181
2185
  <!-- ============================= -->
2182
2186
 
2183
2187
  <xsl:template match="node()" mode="sections">
2184
- <fo:page-sequence master-reference="document" force-page-count="no-force">
2188
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-main">
2189
+ <xsl:call-template name="refine_page-sequence-main"/>
2190
+
2185
2191
  <xsl:if test="@orientation = 'landscape'">
2186
2192
  <xsl:attribute name="master-reference">document-landscape</xsl:attribute>
2187
2193
  </xsl:if>
@@ -2242,7 +2248,9 @@
2242
2248
  </xsl:template>
2243
2249
 
2244
2250
  <xsl:template name="sections_appendix">
2245
- <fo:page-sequence master-reference="document" force-page-count="no-force">
2251
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-main">
2252
+ <xsl:call-template name="refine_page-sequence-main"/>
2253
+
2246
2254
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
2247
2255
 
2248
2256
  <xsl:variable name="curr_lang" select="/mn:metanorma/mn:bibdata/mn:language[@current = 'true']"/>
@@ -3646,7 +3654,9 @@
3646
3654
  <xsl:param name="isDraft"/>
3647
3655
  <xsl:param name="lang"/>
3648
3656
 
3649
- <fo:page-sequence master-reference="index" force-page-count="no-force">
3657
+ <fo:page-sequence master-reference="index" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-main">
3658
+ <xsl:call-template name="refine_page-sequence-main"/>
3659
+
3650
3660
  <xsl:variable name="header-title">
3651
3661
  <xsl:choose>
3652
3662
  <xsl:when test="./mn:title[1]/mn:tab">
@@ -4032,20 +4042,22 @@
4032
4042
  </xsl:variable>
4033
4043
 
4034
4044
  <xsl:attribute-set name="page-sequence-preface">
4035
- <xsl:attribute name="format">i</xsl:attribute>
4036
- </xsl:attribute-set>
4045
+ </xsl:attribute-set> <!-- page-sequence-preface -->
4037
4046
 
4038
4047
  <xsl:template name="refine_page-sequence-preface">
4039
4048
  <xsl:param name="layoutVersion"/>
4040
- </xsl:template>
4049
+ <xsl:param name="doctype"/>
4050
+ <xsl:param name="num"/>
4051
+ <xsl:param name="skip_force_page_count">false</xsl:param>
4052
+ </xsl:template> <!-- refine_page-sequence-preface -->
4041
4053
 
4042
4054
  <xsl:attribute-set name="page-sequence-main">
4043
-
4044
- </xsl:attribute-set>
4055
+ </xsl:attribute-set> <!-- page-sequence-main -->
4045
4056
 
4046
4057
  <xsl:template name="refine_page-sequence-main">
4047
4058
  <xsl:param name="layoutVersion"/>
4048
- </xsl:template>
4059
+ <xsl:param name="doctype"/>
4060
+ </xsl:template> <!-- refine_page-sequence-main -->
4049
4061
 
4050
4062
  <xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable>
4051
4063
  <xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable>
@@ -14929,6 +14941,7 @@
14929
14941
  </xsl:attribute-set>
14930
14942
 
14931
14943
  <xsl:template name="refine_toc-style">
14944
+ <xsl:copy-of select="@id"/>
14932
14945
  </xsl:template>
14933
14946
 
14934
14947
  <xsl:attribute-set name="toc-title-style">
@@ -15038,13 +15051,13 @@
15038
15051
 
15039
15052
  <xsl:template name="processPrefaceSectionsDefault_Contents">
15040
15053
  <xsl:variable name="nodes_preface_">
15041
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
15054
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
15042
15055
  <node id="{@id}"/>
15043
15056
  </xsl:for-each>
15044
15057
  </xsl:variable>
15045
15058
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
15046
15059
 
15047
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
15060
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
15048
15061
  <xsl:sort select="@displayorder" data-type="number"/>
15049
15062
 
15050
15063
  <!-- process Section's title -->
@@ -15057,6 +15070,23 @@
15057
15070
  </xsl:for-each>
15058
15071
  </xsl:template>
15059
15072
 
15073
+ <xsl:template match="*[@type = 'toc'][mn:title or mn:fmt-title]" mode="contents" priority="2">
15074
+ <xsl:variable name="title">
15075
+ <xsl:call-template name="getName"/>
15076
+ </xsl:variable>
15077
+ <xsl:variable name="root">
15078
+ <xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
15079
+ <xsl:if test="ancestor-or-self::mn:annex">annex</xsl:if>
15080
+ </xsl:variable>
15081
+ <mnx:item id="{@id}" level="1" section="" type="toc" root="{$root}" display="false">
15082
+ <mnx:title>
15083
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item">
15084
+ <xsl:with-param name="element" select="$root"/>
15085
+ </xsl:apply-templates>
15086
+ </mnx:title>
15087
+ </mnx:item>
15088
+ </xsl:template>
15089
+
15060
15090
  <xsl:template name="processMainSectionsDefault_Contents">
15061
15091
 
15062
15092
  <xsl:variable name="nodes_sections_">
@@ -16901,16 +16931,17 @@
16901
16931
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
16902
16932
  <xsl:template name="insert_basic_link">
16903
16933
  <xsl:param name="element"/>
16934
+ <xsl:param name="wrapper">true</xsl:param>
16904
16935
  <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
16905
16936
  <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
16906
16937
  <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
16907
16938
  <xsl:choose>
16908
- <xsl:when test="$internal-destination = 'true'">
16939
+ <xsl:when test="$internal-destination = 'true' and $wrapper = 'true'">
16909
16940
  <fo:wrapper role="Reference">
16910
16941
  <xsl:copy-of select="$element_node"/>
16911
16942
  </fo:wrapper>
16912
16943
  </xsl:when>
16913
- <xsl:when test="$external-destination = 'true'">
16944
+ <xsl:when test="$internal-destination = 'true' or $external-destination = 'true'">
16914
16945
  <xsl:copy-of select="$element_node"/>
16915
16946
  </xsl:when>
16916
16947
  <xsl:otherwise>
@@ -1134,7 +1134,9 @@
1134
1134
  </fo:page-sequence>
1135
1135
 
1136
1136
  <xsl:if test="mn:preface/*[not(self::mn:note or self::mn:admonition)]">
1137
- <fo:page-sequence master-reference="document" force-page-count="no-force">
1137
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-preface">
1138
+ <xsl:call-template name="refine_page-sequence-preface"/>
1139
+
1138
1140
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1139
1141
 
1140
1142
  <xsl:variable name="header-title">
@@ -1163,7 +1165,9 @@
1163
1165
  <xsl:call-template name="getDocumentId"/>
1164
1166
  </xsl:variable>
1165
1167
 
1166
- <fo:page-sequence master-reference="document" force-page-count="no-force">
1168
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-preface">
1169
+ <xsl:call-template name="refine_page-sequence-preface"/>
1170
+
1167
1171
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1168
1172
 
1169
1173
  <xsl:variable name="title-toc">
@@ -2181,7 +2185,9 @@
2181
2185
  <!-- ============================= -->
2182
2186
 
2183
2187
  <xsl:template match="node()" mode="sections">
2184
- <fo:page-sequence master-reference="document" force-page-count="no-force">
2188
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-main">
2189
+ <xsl:call-template name="refine_page-sequence-main"/>
2190
+
2185
2191
  <xsl:if test="@orientation = 'landscape'">
2186
2192
  <xsl:attribute name="master-reference">document-landscape</xsl:attribute>
2187
2193
  </xsl:if>
@@ -2242,7 +2248,9 @@
2242
2248
  </xsl:template>
2243
2249
 
2244
2250
  <xsl:template name="sections_appendix">
2245
- <fo:page-sequence master-reference="document" force-page-count="no-force">
2251
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-main">
2252
+ <xsl:call-template name="refine_page-sequence-main"/>
2253
+
2246
2254
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
2247
2255
 
2248
2256
  <xsl:variable name="curr_lang" select="/mn:metanorma/mn:bibdata/mn:language[@current = 'true']"/>
@@ -3646,7 +3654,9 @@
3646
3654
  <xsl:param name="isDraft"/>
3647
3655
  <xsl:param name="lang"/>
3648
3656
 
3649
- <fo:page-sequence master-reference="index" force-page-count="no-force">
3657
+ <fo:page-sequence master-reference="index" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-main">
3658
+ <xsl:call-template name="refine_page-sequence-main"/>
3659
+
3650
3660
  <xsl:variable name="header-title">
3651
3661
  <xsl:choose>
3652
3662
  <xsl:when test="./mn:title[1]/mn:tab">
@@ -4032,20 +4042,22 @@
4032
4042
  </xsl:variable>
4033
4043
 
4034
4044
  <xsl:attribute-set name="page-sequence-preface">
4035
- <xsl:attribute name="format">i</xsl:attribute>
4036
- </xsl:attribute-set>
4045
+ </xsl:attribute-set> <!-- page-sequence-preface -->
4037
4046
 
4038
4047
  <xsl:template name="refine_page-sequence-preface">
4039
4048
  <xsl:param name="layoutVersion"/>
4040
- </xsl:template>
4049
+ <xsl:param name="doctype"/>
4050
+ <xsl:param name="num"/>
4051
+ <xsl:param name="skip_force_page_count">false</xsl:param>
4052
+ </xsl:template> <!-- refine_page-sequence-preface -->
4041
4053
 
4042
4054
  <xsl:attribute-set name="page-sequence-main">
4043
-
4044
- </xsl:attribute-set>
4055
+ </xsl:attribute-set> <!-- page-sequence-main -->
4045
4056
 
4046
4057
  <xsl:template name="refine_page-sequence-main">
4047
4058
  <xsl:param name="layoutVersion"/>
4048
- </xsl:template>
4059
+ <xsl:param name="doctype"/>
4060
+ </xsl:template> <!-- refine_page-sequence-main -->
4049
4061
 
4050
4062
  <xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable>
4051
4063
  <xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable>
@@ -14929,6 +14941,7 @@
14929
14941
  </xsl:attribute-set>
14930
14942
 
14931
14943
  <xsl:template name="refine_toc-style">
14944
+ <xsl:copy-of select="@id"/>
14932
14945
  </xsl:template>
14933
14946
 
14934
14947
  <xsl:attribute-set name="toc-title-style">
@@ -15038,13 +15051,13 @@
15038
15051
 
15039
15052
  <xsl:template name="processPrefaceSectionsDefault_Contents">
15040
15053
  <xsl:variable name="nodes_preface_">
15041
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
15054
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
15042
15055
  <node id="{@id}"/>
15043
15056
  </xsl:for-each>
15044
15057
  </xsl:variable>
15045
15058
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
15046
15059
 
15047
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
15060
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
15048
15061
  <xsl:sort select="@displayorder" data-type="number"/>
15049
15062
 
15050
15063
  <!-- process Section's title -->
@@ -15057,6 +15070,23 @@
15057
15070
  </xsl:for-each>
15058
15071
  </xsl:template>
15059
15072
 
15073
+ <xsl:template match="*[@type = 'toc'][mn:title or mn:fmt-title]" mode="contents" priority="2">
15074
+ <xsl:variable name="title">
15075
+ <xsl:call-template name="getName"/>
15076
+ </xsl:variable>
15077
+ <xsl:variable name="root">
15078
+ <xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
15079
+ <xsl:if test="ancestor-or-self::mn:annex">annex</xsl:if>
15080
+ </xsl:variable>
15081
+ <mnx:item id="{@id}" level="1" section="" type="toc" root="{$root}" display="false">
15082
+ <mnx:title>
15083
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item">
15084
+ <xsl:with-param name="element" select="$root"/>
15085
+ </xsl:apply-templates>
15086
+ </mnx:title>
15087
+ </mnx:item>
15088
+ </xsl:template>
15089
+
15060
15090
  <xsl:template name="processMainSectionsDefault_Contents">
15061
15091
 
15062
15092
  <xsl:variable name="nodes_sections_">
@@ -16901,16 +16931,17 @@
16901
16931
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
16902
16932
  <xsl:template name="insert_basic_link">
16903
16933
  <xsl:param name="element"/>
16934
+ <xsl:param name="wrapper">true</xsl:param>
16904
16935
  <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
16905
16936
  <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
16906
16937
  <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
16907
16938
  <xsl:choose>
16908
- <xsl:when test="$internal-destination = 'true'">
16939
+ <xsl:when test="$internal-destination = 'true' and $wrapper = 'true'">
16909
16940
  <fo:wrapper role="Reference">
16910
16941
  <xsl:copy-of select="$element_node"/>
16911
16942
  </fo:wrapper>
16912
16943
  </xsl:when>
16913
- <xsl:when test="$external-destination = 'true'">
16944
+ <xsl:when test="$internal-destination = 'true' or $external-destination = 'true'">
16914
16945
  <xsl:copy-of select="$element_node"/>
16915
16946
  </xsl:when>
16916
16947
  <xsl:otherwise>
@@ -1134,7 +1134,9 @@
1134
1134
  </fo:page-sequence>
1135
1135
 
1136
1136
  <xsl:if test="mn:preface/*[not(self::mn:note or self::mn:admonition)]">
1137
- <fo:page-sequence master-reference="document" force-page-count="no-force">
1137
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-preface">
1138
+ <xsl:call-template name="refine_page-sequence-preface"/>
1139
+
1138
1140
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1139
1141
 
1140
1142
  <xsl:variable name="header-title">
@@ -1163,7 +1165,9 @@
1163
1165
  <xsl:call-template name="getDocumentId"/>
1164
1166
  </xsl:variable>
1165
1167
 
1166
- <fo:page-sequence master-reference="document" force-page-count="no-force">
1168
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-preface">
1169
+ <xsl:call-template name="refine_page-sequence-preface"/>
1170
+
1167
1171
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1168
1172
 
1169
1173
  <xsl:variable name="title-toc">
@@ -2181,7 +2185,9 @@
2181
2185
  <!-- ============================= -->
2182
2186
 
2183
2187
  <xsl:template match="node()" mode="sections">
2184
- <fo:page-sequence master-reference="document" force-page-count="no-force">
2188
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-main">
2189
+ <xsl:call-template name="refine_page-sequence-main"/>
2190
+
2185
2191
  <xsl:if test="@orientation = 'landscape'">
2186
2192
  <xsl:attribute name="master-reference">document-landscape</xsl:attribute>
2187
2193
  </xsl:if>
@@ -2242,7 +2248,9 @@
2242
2248
  </xsl:template>
2243
2249
 
2244
2250
  <xsl:template name="sections_appendix">
2245
- <fo:page-sequence master-reference="document" force-page-count="no-force">
2251
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-main">
2252
+ <xsl:call-template name="refine_page-sequence-main"/>
2253
+
2246
2254
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
2247
2255
 
2248
2256
  <xsl:variable name="curr_lang" select="/mn:metanorma/mn:bibdata/mn:language[@current = 'true']"/>
@@ -3646,7 +3654,9 @@
3646
3654
  <xsl:param name="isDraft"/>
3647
3655
  <xsl:param name="lang"/>
3648
3656
 
3649
- <fo:page-sequence master-reference="index" force-page-count="no-force">
3657
+ <fo:page-sequence master-reference="index" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-main">
3658
+ <xsl:call-template name="refine_page-sequence-main"/>
3659
+
3650
3660
  <xsl:variable name="header-title">
3651
3661
  <xsl:choose>
3652
3662
  <xsl:when test="./mn:title[1]/mn:tab">
@@ -4032,20 +4042,22 @@
4032
4042
  </xsl:variable>
4033
4043
 
4034
4044
  <xsl:attribute-set name="page-sequence-preface">
4035
- <xsl:attribute name="format">i</xsl:attribute>
4036
- </xsl:attribute-set>
4045
+ </xsl:attribute-set> <!-- page-sequence-preface -->
4037
4046
 
4038
4047
  <xsl:template name="refine_page-sequence-preface">
4039
4048
  <xsl:param name="layoutVersion"/>
4040
- </xsl:template>
4049
+ <xsl:param name="doctype"/>
4050
+ <xsl:param name="num"/>
4051
+ <xsl:param name="skip_force_page_count">false</xsl:param>
4052
+ </xsl:template> <!-- refine_page-sequence-preface -->
4041
4053
 
4042
4054
  <xsl:attribute-set name="page-sequence-main">
4043
-
4044
- </xsl:attribute-set>
4055
+ </xsl:attribute-set> <!-- page-sequence-main -->
4045
4056
 
4046
4057
  <xsl:template name="refine_page-sequence-main">
4047
4058
  <xsl:param name="layoutVersion"/>
4048
- </xsl:template>
4059
+ <xsl:param name="doctype"/>
4060
+ </xsl:template> <!-- refine_page-sequence-main -->
4049
4061
 
4050
4062
  <xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable>
4051
4063
  <xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable>
@@ -14929,6 +14941,7 @@
14929
14941
  </xsl:attribute-set>
14930
14942
 
14931
14943
  <xsl:template name="refine_toc-style">
14944
+ <xsl:copy-of select="@id"/>
14932
14945
  </xsl:template>
14933
14946
 
14934
14947
  <xsl:attribute-set name="toc-title-style">
@@ -15038,13 +15051,13 @@
15038
15051
 
15039
15052
  <xsl:template name="processPrefaceSectionsDefault_Contents">
15040
15053
  <xsl:variable name="nodes_preface_">
15041
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
15054
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
15042
15055
  <node id="{@id}"/>
15043
15056
  </xsl:for-each>
15044
15057
  </xsl:variable>
15045
15058
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
15046
15059
 
15047
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
15060
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
15048
15061
  <xsl:sort select="@displayorder" data-type="number"/>
15049
15062
 
15050
15063
  <!-- process Section's title -->
@@ -15057,6 +15070,23 @@
15057
15070
  </xsl:for-each>
15058
15071
  </xsl:template>
15059
15072
 
15073
+ <xsl:template match="*[@type = 'toc'][mn:title or mn:fmt-title]" mode="contents" priority="2">
15074
+ <xsl:variable name="title">
15075
+ <xsl:call-template name="getName"/>
15076
+ </xsl:variable>
15077
+ <xsl:variable name="root">
15078
+ <xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
15079
+ <xsl:if test="ancestor-or-self::mn:annex">annex</xsl:if>
15080
+ </xsl:variable>
15081
+ <mnx:item id="{@id}" level="1" section="" type="toc" root="{$root}" display="false">
15082
+ <mnx:title>
15083
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item">
15084
+ <xsl:with-param name="element" select="$root"/>
15085
+ </xsl:apply-templates>
15086
+ </mnx:title>
15087
+ </mnx:item>
15088
+ </xsl:template>
15089
+
15060
15090
  <xsl:template name="processMainSectionsDefault_Contents">
15061
15091
 
15062
15092
  <xsl:variable name="nodes_sections_">
@@ -16901,16 +16931,17 @@
16901
16931
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
16902
16932
  <xsl:template name="insert_basic_link">
16903
16933
  <xsl:param name="element"/>
16934
+ <xsl:param name="wrapper">true</xsl:param>
16904
16935
  <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
16905
16936
  <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
16906
16937
  <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
16907
16938
  <xsl:choose>
16908
- <xsl:when test="$internal-destination = 'true'">
16939
+ <xsl:when test="$internal-destination = 'true' and $wrapper = 'true'">
16909
16940
  <fo:wrapper role="Reference">
16910
16941
  <xsl:copy-of select="$element_node"/>
16911
16942
  </fo:wrapper>
16912
16943
  </xsl:when>
16913
- <xsl:when test="$external-destination = 'true'">
16944
+ <xsl:when test="$internal-destination = 'true' or $external-destination = 'true'">
16914
16945
  <xsl:copy-of select="$element_node"/>
16915
16946
  </xsl:when>
16916
16947
  <xsl:otherwise>
@@ -1134,7 +1134,9 @@
1134
1134
  </fo:page-sequence>
1135
1135
 
1136
1136
  <xsl:if test="mn:preface/*[not(self::mn:note or self::mn:admonition)]">
1137
- <fo:page-sequence master-reference="document" force-page-count="no-force">
1137
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-preface">
1138
+ <xsl:call-template name="refine_page-sequence-preface"/>
1139
+
1138
1140
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1139
1141
 
1140
1142
  <xsl:variable name="header-title">
@@ -1163,7 +1165,9 @@
1163
1165
  <xsl:call-template name="getDocumentId"/>
1164
1166
  </xsl:variable>
1165
1167
 
1166
- <fo:page-sequence master-reference="document" force-page-count="no-force">
1168
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-preface">
1169
+ <xsl:call-template name="refine_page-sequence-preface"/>
1170
+
1167
1171
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1168
1172
 
1169
1173
  <xsl:variable name="title-toc">
@@ -2181,7 +2185,9 @@
2181
2185
  <!-- ============================= -->
2182
2186
 
2183
2187
  <xsl:template match="node()" mode="sections">
2184
- <fo:page-sequence master-reference="document" force-page-count="no-force">
2188
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-main">
2189
+ <xsl:call-template name="refine_page-sequence-main"/>
2190
+
2185
2191
  <xsl:if test="@orientation = 'landscape'">
2186
2192
  <xsl:attribute name="master-reference">document-landscape</xsl:attribute>
2187
2193
  </xsl:if>
@@ -2242,7 +2248,9 @@
2242
2248
  </xsl:template>
2243
2249
 
2244
2250
  <xsl:template name="sections_appendix">
2245
- <fo:page-sequence master-reference="document" force-page-count="no-force">
2251
+ <fo:page-sequence master-reference="document" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-main">
2252
+ <xsl:call-template name="refine_page-sequence-main"/>
2253
+
2246
2254
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
2247
2255
 
2248
2256
  <xsl:variable name="curr_lang" select="/mn:metanorma/mn:bibdata/mn:language[@current = 'true']"/>
@@ -3646,7 +3654,9 @@
3646
3654
  <xsl:param name="isDraft"/>
3647
3655
  <xsl:param name="lang"/>
3648
3656
 
3649
- <fo:page-sequence master-reference="index" force-page-count="no-force">
3657
+ <fo:page-sequence master-reference="index" force-page-count="no-force" xsl:use-attribute-sets="page-sequence-main">
3658
+ <xsl:call-template name="refine_page-sequence-main"/>
3659
+
3650
3660
  <xsl:variable name="header-title">
3651
3661
  <xsl:choose>
3652
3662
  <xsl:when test="./mn:title[1]/mn:tab">
@@ -4032,20 +4042,22 @@
4032
4042
  </xsl:variable>
4033
4043
 
4034
4044
  <xsl:attribute-set name="page-sequence-preface">
4035
- <xsl:attribute name="format">i</xsl:attribute>
4036
- </xsl:attribute-set>
4045
+ </xsl:attribute-set> <!-- page-sequence-preface -->
4037
4046
 
4038
4047
  <xsl:template name="refine_page-sequence-preface">
4039
4048
  <xsl:param name="layoutVersion"/>
4040
- </xsl:template>
4049
+ <xsl:param name="doctype"/>
4050
+ <xsl:param name="num"/>
4051
+ <xsl:param name="skip_force_page_count">false</xsl:param>
4052
+ </xsl:template> <!-- refine_page-sequence-preface -->
4041
4053
 
4042
4054
  <xsl:attribute-set name="page-sequence-main">
4043
-
4044
- </xsl:attribute-set>
4055
+ </xsl:attribute-set> <!-- page-sequence-main -->
4045
4056
 
4046
4057
  <xsl:template name="refine_page-sequence-main">
4047
4058
  <xsl:param name="layoutVersion"/>
4048
- </xsl:template>
4059
+ <xsl:param name="doctype"/>
4060
+ </xsl:template> <!-- refine_page-sequence-main -->
4049
4061
 
4050
4062
  <xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable>
4051
4063
  <xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable>
@@ -14929,6 +14941,7 @@
14929
14941
  </xsl:attribute-set>
14930
14942
 
14931
14943
  <xsl:template name="refine_toc-style">
14944
+ <xsl:copy-of select="@id"/>
14932
14945
  </xsl:template>
14933
14946
 
14934
14947
  <xsl:attribute-set name="toc-title-style">
@@ -15038,13 +15051,13 @@
15038
15051
 
15039
15052
  <xsl:template name="processPrefaceSectionsDefault_Contents">
15040
15053
  <xsl:variable name="nodes_preface_">
15041
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
15054
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
15042
15055
  <node id="{@id}"/>
15043
15056
  </xsl:for-each>
15044
15057
  </xsl:variable>
15045
15058
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
15046
15059
 
15047
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
15060
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
15048
15061
  <xsl:sort select="@displayorder" data-type="number"/>
15049
15062
 
15050
15063
  <!-- process Section's title -->
@@ -15057,6 +15070,23 @@
15057
15070
  </xsl:for-each>
15058
15071
  </xsl:template>
15059
15072
 
15073
+ <xsl:template match="*[@type = 'toc'][mn:title or mn:fmt-title]" mode="contents" priority="2">
15074
+ <xsl:variable name="title">
15075
+ <xsl:call-template name="getName"/>
15076
+ </xsl:variable>
15077
+ <xsl:variable name="root">
15078
+ <xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
15079
+ <xsl:if test="ancestor-or-self::mn:annex">annex</xsl:if>
15080
+ </xsl:variable>
15081
+ <mnx:item id="{@id}" level="1" section="" type="toc" root="{$root}" display="false">
15082
+ <mnx:title>
15083
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item">
15084
+ <xsl:with-param name="element" select="$root"/>
15085
+ </xsl:apply-templates>
15086
+ </mnx:title>
15087
+ </mnx:item>
15088
+ </xsl:template>
15089
+
15060
15090
  <xsl:template name="processMainSectionsDefault_Contents">
15061
15091
 
15062
15092
  <xsl:variable name="nodes_sections_">
@@ -16901,16 +16931,17 @@
16901
16931
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
16902
16932
  <xsl:template name="insert_basic_link">
16903
16933
  <xsl:param name="element"/>
16934
+ <xsl:param name="wrapper">true</xsl:param>
16904
16935
  <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
16905
16936
  <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
16906
16937
  <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
16907
16938
  <xsl:choose>
16908
- <xsl:when test="$internal-destination = 'true'">
16939
+ <xsl:when test="$internal-destination = 'true' and $wrapper = 'true'">
16909
16940
  <fo:wrapper role="Reference">
16910
16941
  <xsl:copy-of select="$element_node"/>
16911
16942
  </fo:wrapper>
16912
16943
  </xsl:when>
16913
- <xsl:when test="$external-destination = 'true'">
16944
+ <xsl:when test="$internal-destination = 'true' or $external-destination = 'true'">
16914
16945
  <xsl:copy-of select="$element_node"/>
16915
16946
  </xsl:when>
16916
16947
  <xsl:otherwise>
@@ -319,6 +319,11 @@ svg {
319
319
  display: block; /* ← removes unwanted inline spacing */
320
320
  }
321
321
 
322
+ /* style dfn by override in flavor */
323
+ dfn {
324
+ font-style: inherit;
325
+ }
326
+
322
327
  #standard-band {
323
328
  background-color: #0AC442;
324
329
  }
@@ -270,17 +270,8 @@
270
270
 
271
271
  <xsl:for-each select=".//mn:page_sequence[parent::mn:boilerplate or parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
272
272
 
273
- <xsl:variable name="page_orientation"><xsl:call-template name="getPageSequenceOrientation"/></xsl:variable>
274
-
275
- <fo:page-sequence master-reference="document{$page_orientation}" format="i">
276
-
277
- <xsl:if test="position() = 1">
278
- <xsl:attribute name="initial-page-number">2</xsl:attribute>
279
- </xsl:if>
280
-
281
- <xsl:if test="position() = last()">
282
- <xsl:attribute name="force-page-count">odd</xsl:attribute>
283
- </xsl:if>
273
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-preface">
274
+ <xsl:call-template name="refine_page-sequence-preface"/>
284
275
 
285
276
  <xsl:call-template name="insertHeaderFooter"/>
286
277
 
@@ -299,14 +290,9 @@
299
290
 
300
291
  <xsl:for-each select=".//mn:page_sequence[not(parent::mn:boilerplate or parent::mn:preface)][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
301
292
 
302
- <xsl:variable name="page_orientation"><xsl:call-template name="getPageSequenceOrientation"/></xsl:variable>
303
-
304
293
  <!-- JCGM BODY -->
305
- <fo:page-sequence master-reference="document{$page_orientation}" force-page-count="no-force">
306
-
307
- <xsl:if test="position() = 1">
308
- <xsl:attribute name="initial-page-number">1</xsl:attribute>
309
- </xsl:if>
294
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-main">
295
+ <xsl:call-template name="refine_page-sequence-main"/>
310
296
 
311
297
  <xsl:call-template name="insertHeaderFooter"/>
312
298
 
@@ -325,7 +311,7 @@
325
311
  </xsl:when> <!-- END: count(//mn:metanorma) = 1 -->
326
312
 
327
313
  <xsl:otherwise> <!-- count(//mn:metanorma) != 1 -->
328
- <fo:page-sequence master-reference="document" initial-page-number="1" force-page-count="no-force">
314
+ <fo:page-sequence initial-page-number="1" xsl:use-attribute-sets="page-sequence-main">
329
315
 
330
316
  <xsl:call-template name="insertHeaderFooter"/>
331
317
 
@@ -607,7 +593,7 @@
607
593
  </fo:inline>
608
594
  <xsl:text> </xsl:text>
609
595
  <fo:inline keep-together.within-line="always" font-weight="normal">
610
- <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
596
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
611
597
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
612
598
  </fo:inline>
613
599
  </fo:basic-link>
@@ -1019,7 +1005,7 @@
1019
1005
  </fo:inline>
1020
1006
  <xsl:text> </xsl:text>
1021
1007
  <fo:inline keep-together.within-line="always" font-weight="normal">
1022
- <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
1008
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
1023
1009
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
1024
1010
  </fo:inline>
1025
1011
  </fo:basic-link>
@@ -1205,17 +1191,7 @@
1205
1191
  <xsl:template match="mn:indexsect"/>
1206
1192
  <xsl:template match="mn:indexsect" mode="index">
1207
1193
 
1208
- <fo:page-sequence master-reference="document" force-page-count="no-force">
1209
- <xsl:variable name="header-title">
1210
- <xsl:choose>
1211
- <xsl:when test="./mn:title[1]/mn:tab">
1212
- <xsl:apply-templates select="./mn:title[1]/mn:tab[1]/following-sibling::node()" mode="header"/>
1213
- </xsl:when>
1214
- <xsl:otherwise>
1215
- <xsl:apply-templates select="./mn:title[1]" mode="header"/>
1216
- </xsl:otherwise>
1217
- </xsl:choose>
1218
- </xsl:variable>
1194
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-main">
1219
1195
 
1220
1196
  <xsl:call-template name="insertHeaderFooter"/>
1221
1197
 
@@ -2220,20 +2196,43 @@
2220
2196
  </xsl:variable>
2221
2197
 
2222
2198
  <xsl:attribute-set name="page-sequence-preface">
2199
+ <xsl:attribute name="master-reference">document</xsl:attribute>
2223
2200
  <xsl:attribute name="format">i</xsl:attribute>
2224
- </xsl:attribute-set>
2201
+ </xsl:attribute-set> <!-- page-sequence-preface -->
2225
2202
 
2226
2203
  <xsl:template name="refine_page-sequence-preface">
2227
2204
  <xsl:param name="layoutVersion"/>
2228
- </xsl:template>
2205
+ <xsl:param name="doctype"/>
2206
+ <xsl:param name="num"/>
2207
+ <xsl:param name="skip_force_page_count">false</xsl:param>
2208
+ <xsl:attribute name="master-reference">
2209
+ <xsl:text>document</xsl:text>
2210
+ <xsl:call-template name="getPageSequenceOrientation"/>
2211
+ </xsl:attribute>
2212
+ <xsl:if test="position() = 1">
2213
+ <xsl:attribute name="initial-page-number">2</xsl:attribute>
2214
+ </xsl:if>
2215
+ <xsl:if test="position() = last()">
2216
+ <xsl:attribute name="force-page-count">odd</xsl:attribute>
2217
+ </xsl:if>
2218
+ </xsl:template> <!-- refine_page-sequence-preface -->
2229
2219
 
2230
2220
  <xsl:attribute-set name="page-sequence-main">
2231
-
2232
- </xsl:attribute-set>
2221
+ <xsl:attribute name="master-reference">document</xsl:attribute>
2222
+ <xsl:attribute name="force-page-count">no-force</xsl:attribute>
2223
+ </xsl:attribute-set> <!-- page-sequence-main -->
2233
2224
 
2234
2225
  <xsl:template name="refine_page-sequence-main">
2235
2226
  <xsl:param name="layoutVersion"/>
2236
- </xsl:template>
2227
+ <xsl:param name="doctype"/>
2228
+ <xsl:attribute name="master-reference">
2229
+ <xsl:text>document</xsl:text>
2230
+ <xsl:call-template name="getPageSequenceOrientation"/>
2231
+ </xsl:attribute>
2232
+ <xsl:if test="position() = 1">
2233
+ <xsl:attribute name="initial-page-number">1</xsl:attribute>
2234
+ </xsl:if>
2235
+ </xsl:template> <!-- refine_page-sequence-main -->
2237
2236
 
2238
2237
  <xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable>
2239
2238
  <xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable>
@@ -13088,6 +13087,7 @@
13088
13087
  </xsl:attribute-set>
13089
13088
 
13090
13089
  <xsl:template name="refine_toc-style">
13090
+ <xsl:copy-of select="@id"/>
13091
13091
  </xsl:template>
13092
13092
 
13093
13093
  <xsl:attribute-set name="toc-title-style">
@@ -13160,13 +13160,13 @@
13160
13160
 
13161
13161
  <xsl:template name="processPrefaceSectionsDefault_Contents">
13162
13162
  <xsl:variable name="nodes_preface_">
13163
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
13163
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
13164
13164
  <node id="{@id}"/>
13165
13165
  </xsl:for-each>
13166
13166
  </xsl:variable>
13167
13167
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
13168
13168
 
13169
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
13169
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
13170
13170
  <xsl:sort select="@displayorder" data-type="number"/>
13171
13171
 
13172
13172
  <!-- process Section's title -->
@@ -13179,6 +13179,23 @@
13179
13179
  </xsl:for-each>
13180
13180
  </xsl:template>
13181
13181
 
13182
+ <xsl:template match="*[@type = 'toc'][mn:title or mn:fmt-title]" mode="contents" priority="2">
13183
+ <xsl:variable name="title">
13184
+ <xsl:call-template name="getName"/>
13185
+ </xsl:variable>
13186
+ <xsl:variable name="root">
13187
+ <xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
13188
+ <xsl:if test="ancestor-or-self::mn:annex">annex</xsl:if>
13189
+ </xsl:variable>
13190
+ <mnx:item id="{@id}" level="1" section="" type="toc" root="{$root}" display="false">
13191
+ <mnx:title>
13192
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item">
13193
+ <xsl:with-param name="element" select="$root"/>
13194
+ </xsl:apply-templates>
13195
+ </mnx:title>
13196
+ </mnx:item>
13197
+ </xsl:template>
13198
+
13182
13199
  <xsl:template name="processMainSectionsDefault_Contents">
13183
13200
 
13184
13201
  <xsl:variable name="nodes_sections_">
@@ -14982,16 +14999,17 @@
14982
14999
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
14983
15000
  <xsl:template name="insert_basic_link">
14984
15001
  <xsl:param name="element"/>
15002
+ <xsl:param name="wrapper">true</xsl:param>
14985
15003
  <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
14986
15004
  <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
14987
15005
  <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
14988
15006
  <xsl:choose>
14989
- <xsl:when test="$internal-destination = 'true'">
15007
+ <xsl:when test="$internal-destination = 'true' and $wrapper = 'true'">
14990
15008
  <fo:wrapper role="Reference">
14991
15009
  <xsl:copy-of select="$element_node"/>
14992
15010
  </fo:wrapper>
14993
15011
  </xsl:when>
14994
- <xsl:when test="$external-destination = 'true'">
15012
+ <xsl:when test="$internal-destination = 'true' or $external-destination = 'true'">
14995
15013
  <xsl:copy-of select="$element_node"/>
14996
15014
  </xsl:when>
14997
15015
  <xsl:otherwise>
@@ -1939,10 +1939,10 @@ Detailed in https://www.relaton.org/model/relations/</a:documentation>
1939
1939
  <value>hasAnnotation</value>
1940
1940
  <value>draftOf</value>
1941
1941
  <value>hasDraft</value>
1942
- <value>preliminaryDraftOf</value>
1943
- <value>hasPreliminaryDraft</value>
1944
- <value>revisionDraftOf</value>
1945
- <value>hasRevisionDraft</value>
1942
+ <value>predecessorDraftOf</value>
1943
+ <value>hasPredecessorDraft</value>
1944
+ <value>successorDraftOf</value>
1945
+ <value>hasSuccessorDraft</value>
1946
1946
  <value>editionOf</value>
1947
1947
  <value>hasEdition</value>
1948
1948
  <value>updates</value>
@@ -641,8 +641,85 @@ This is done if the footnote reference is already presented in some other form,
641
641
  </ref>
642
642
  </zeroOrMore>
643
643
  </define>
644
+ <define name="altsource">
645
+ <a:documentation>Alternative file to use as media</a:documentation>
646
+ <element name="altsource">
647
+ <ref name="MediaAttributes"/>
648
+ <optional>
649
+ <attribute name="tag">
650
+ <a:documentation>Comma-delimited tag to indicate when the alternate file is to be used,
651
+ at minimum allows contain `html`, `doc`, `pdf` as the main target formats of Metanorma,
652
+ and `default` for the fallback. The presence of an altsource tagged `default` is required</a:documentation>
653
+ </attribute>
654
+ </optional>
655
+ <optional>
656
+ <attribute name="media">
657
+ <a:documentation>CSS media query to indicate when the alternate file is to be used</a:documentation>
658
+ </attribute>
659
+ </optional>
660
+ </element>
661
+ </define>
662
+ <define name="image">
663
+ <a:documentation>Container for image content</a:documentation>
664
+ <choice>
665
+ <element name="image">
666
+ <ref name="RequiredId"/>
667
+ <ref name="ImageAttributes">
668
+ <a:documentation>When specified along with altsource, ImageAttributes give the default image to be rendered</a:documentation>
669
+ </ref>
670
+ <ref name="ImageBody"/>
671
+ </element>
672
+ <element name="svg">
673
+ <a:documentation>Add svg mark up to image</a:documentation>
674
+ <oneOrMore>
675
+ <choice>
676
+ <text/>
677
+ <ref name="AnyElement"/>
678
+ </choice>
679
+ </oneOrMore>
680
+ </element>
681
+ </choice>
682
+ </define>
683
+ <define name="ImageAttributes">
684
+ <optional>
685
+ <ref name="MediaAttributes">
686
+ <a:documentation>If the image contains altsource, the media attributes are given on each of the altsource elements instead of the root node</a:documentation>
687
+ </ref>
688
+ </optional>
689
+ <ref name="MediaAccessibilityAttributes"/>
690
+ <optional>
691
+ <attribute name="width">
692
+ <a:documentation>Height of image</a:documentation>
693
+ <ref name="ImageSize"/>
694
+ </attribute>
695
+ </optional>
696
+ <optional>
697
+ <attribute name="height">
698
+ <a:documentation>Width of image</a:documentation>
699
+ <ref name="ImageSize"/>
700
+ </attribute>
701
+ </optional>
702
+ </define>
644
703
  </include>
645
704
  <!-- end overrides -->
705
+ <define name="ImageBody">
706
+ <optional>
707
+ <element name="svg">
708
+ <a:documentation>image can contain SVG XML, which is used to access its identifiers within the Metanorma XML</a:documentation>
709
+ <oneOrMore>
710
+ <choice>
711
+ <text/>
712
+ <ref name="AnyElement"/>
713
+ </choice>
714
+ </oneOrMore>
715
+ </element>
716
+ </optional>
717
+ <zeroOrMore>
718
+ <ref name="altsource">
719
+ <a:documentation>Alternative files to use as media</a:documentation>
720
+ </ref>
721
+ </zeroOrMore>
722
+ </define>
646
723
  <define name="key">
647
724
  <a:documentation>Key to a table, figure, or formula</a:documentation>
648
725
  <element name="key">
@@ -930,34 +1007,6 @@ titlecase, or lowercase</a:documentation>
930
1007
  <ref name="ReducedBibliographicItem"/>
931
1008
  </element>
932
1009
  </define>
933
- <define name="image" combine="choice">
934
- <choice>
935
- <element name="image">
936
- <ref name="RequiredId"/>
937
- <ref name="ImageAttributes"/>
938
- <optional>
939
- <element name="svg">
940
- <a:documentation>Allow svg in image/svg, for consistency</a:documentation>
941
- <oneOrMore>
942
- <choice>
943
- <text/>
944
- <ref name="AnyElement"/>
945
- </choice>
946
- </oneOrMore>
947
- </element>
948
- </optional>
949
- </element>
950
- <element name="svg">
951
- <a:documentation>Add svg mark up to image</a:documentation>
952
- <oneOrMore>
953
- <choice>
954
- <text/>
955
- <ref name="AnyElement"/>
956
- </choice>
957
- </oneOrMore>
958
- </element>
959
- </choice>
960
- </define>
961
1010
  <define name="ParagraphFnBody" combine="interleave">
962
1011
  <ref name="BlockSource">
963
1012
  <a:documentation>Bibliographic source for the information in the paragraph
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Bipm
3
- VERSION = "2.8.1".freeze
3
+ VERSION = "2.8.2".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-bipm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-03-02 00:00:00.000000000 Z
11
+ date: 2026-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic