metanorma-iec 2.8.10 → 2.8.11

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: dde5546faaaac61a175265f3912b32e899f302c8c791e49c55690c0014c2d646
4
- data.tar.gz: 1d614cc13478675748fda9ec61e50177142f6d6170273bd7c93b9cb14a5dd692
3
+ metadata.gz: 973ab708c5e817f8b1aa6eb841545feb19ce5614708c332fbbe1c0129a03c91b
4
+ data.tar.gz: 2758d7f25a5495e333d416b089d37421acadb7c7d4386600acee015d8fdcaa45
5
5
  SHA512:
6
- metadata.gz: 4aa551d1fee1db1e4997db561d06399bda209f724add6caee875f2462e155c677bbbf4c0097ba1e33f9a712c753267665c29d8a4f15566e8188acdf2b097f542
7
- data.tar.gz: c0ebeb5bfab426f4f874c2420c6a680f7c3229d54f003080bc24285a5801b29f3a94ce61bfe9048e67a28e9604abefcde16e2ba8f07d14b81cfe010ff4a996f0
6
+ metadata.gz: ebdea4c237cffc6d43ea697f275fed53ded5a8335d316456a8c20f7c3c1ae9c52b67b738324c3bd1735e439fec80fed8bde07b21eb4c82a1c2ee12988c163cd8
7
+ data.tar.gz: c0530c5544dc523b27c857d72a0ce7dde19d7e64ca41c78170438f37d5f360817864c02eb1d8f56364ea0fd545fffeed3f5b476d951e78d9ed26c7b5b07fa326
data/.rubocop.yml CHANGED
@@ -2,6 +2,15 @@
2
2
  # See https://github.com/metanorma/cimas
3
3
  inherit_from:
4
4
  - https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
5
+ # .rubocop_todo.yml MUST be the last entry. inherit_from is last-wins:
6
+ # if listed before oss-guides, the shared config's stricter Metrics/
7
+ # (MethodLength, BlockLength, etc.) rules override the todo's per-file
8
+ # grandfathering, and the todo becomes inert on those cops. Empirically
9
+ # verified on suma 2026-07-06: with todo listed first, 34 Metrics/* offenses
10
+ # remained; moved last, cleared. Every gem in the metanorma-org fleet
11
+ # already ships a `.rubocop_todo.yml` on its live tree (audited 2026-07-06,
12
+ # 54/54 have it), so this reference is safe to emit unconditionally.
13
+ - .rubocop_todo.yml
5
14
 
6
15
  # Rubocop plugins enabled centrally so every metanorma-org gem picks them up
7
16
  # on cimas sync — best practice belongs at the shared-template layer, not
@@ -150,6 +150,11 @@ a.FootnoteRef, span.FootnoteRef {
150
150
  vertical-align: super;
151
151
  }
152
152
 
153
+ a.TableFootnoteRef, a.FootnoteRef, a.footnote-number,
154
+ sup a, a:has(> sup) {
155
+ vertical-align: baseline;
156
+ }
157
+
153
158
  .addition {
154
159
  color: blue;
155
160
  }
@@ -1377,7 +1377,11 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1377
1377
  <fo:block xsl:use-attribute-sets="toc-listof-item-style">
1378
1378
  <xsl:variable name="alt_text" select="normalize-space(translate(normalize-space(mn:fmt-name), ' —', ' -'))"/>
1379
1379
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{$alt_text}"> <!-- {local-name()} {@id} -->
1380
- <xsl:apply-templates select="." mode="contents"/>
1380
+ <xsl:variable name="item">
1381
+ <!-- mnx:table/mn:fmt-name, mnx:figure/mn:fmt-name, mnx:example/mn:fmt-name -->
1382
+ <xsl:apply-templates select="mn:fmt-name" mode="contents_item"/>
1383
+ </xsl:variable>
1384
+ <xsl:apply-templates select="xalan:nodeset($item)/node()"/>
1381
1385
  <fo:inline keep-together.within-line="always" role="SKIP">
1382
1386
  <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
1383
1387
  <fo:wrapper role="artifact">
@@ -2331,45 +2335,59 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
2331
2335
 
2332
2336
  <xsl:variable name="ace_tag">ace-tag_</xsl:variable>
2333
2337
 
2334
- <xsl:variable name="title-list-tables">
2335
- <xsl:variable name="toc_table_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title"/>
2336
- <xsl:value-of select="$toc_table_title"/>
2337
- <xsl:if test="normalize-space($toc_table_title) = ''">
2338
- <xsl:call-template name="getLocalizedString">
2339
- <xsl:with-param name="key">toc_tables</xsl:with-param>
2340
- </xsl:call-template>
2341
- </xsl:if>
2342
- </xsl:variable>
2338
+ <xsl:variable name="toc_title_lists_">
2339
+ <xsl:for-each select="//mn:metanorma">
2340
+ <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
2341
+ <xsl:variable name="docid"><xsl:call-template name="getDocumentId"/></xsl:variable>
2342
+ <xsl:variable name="current_document">
2343
+ <xsl:copy-of select="."/>
2344
+ </xsl:variable>
2345
+ <xsl:for-each select="xalan:nodeset($current_document)">
2346
+ <mnx:doc id="{$docid}" num="{$num}">
2347
+ <mnx:title-list-tables>
2348
+ <xsl:variable name="toc_table_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title"/>
2349
+ <xsl:value-of select="$toc_table_title"/>
2350
+ <xsl:if test="normalize-space($toc_table_title) = ''">
2351
+ <xsl:call-template name="getLocalizedString">
2352
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
2353
+ </xsl:call-template>
2354
+ </xsl:if>
2355
+ </mnx:title-list-tables>
2343
2356
 
2344
- <xsl:variable name="title-list-figures">
2345
- <xsl:variable name="toc_figure_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title"/>
2346
- <xsl:value-of select="$toc_figure_title"/>
2347
- <xsl:if test="normalize-space($toc_figure_title) = ''">
2348
- <xsl:call-template name="getLocalizedString">
2349
- <xsl:with-param name="key">toc_figures</xsl:with-param>
2350
- </xsl:call-template>
2351
- </xsl:if>
2352
- </xsl:variable>
2357
+ <mnx:title-list-figures>
2358
+ <xsl:variable name="toc_figure_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title"/>
2359
+ <xsl:value-of select="$toc_figure_title"/>
2360
+ <xsl:if test="normalize-space($toc_figure_title) = ''">
2361
+ <xsl:call-template name="getLocalizedString">
2362
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
2363
+ </xsl:call-template>
2364
+ </xsl:if>
2365
+ </mnx:title-list-figures>
2353
2366
 
2354
- <xsl:variable name="title-list-examples">
2355
- <xsl:variable name="toc_example_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title"/>
2356
- <xsl:value-of select="$toc_example_title"/>
2357
- <xsl:if test="normalize-space($toc_example_title) = ''">
2358
- <xsl:call-template name="getLocalizedString">
2359
- <xsl:with-param name="key">toc_examples</xsl:with-param>
2360
- </xsl:call-template>
2361
- </xsl:if>
2362
- </xsl:variable>
2367
+ <mnx:title-list-examples>
2368
+ <xsl:variable name="toc_example_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title"/>
2369
+ <xsl:value-of select="$toc_example_title"/>
2370
+ <xsl:if test="normalize-space($toc_example_title) = ''">
2371
+ <xsl:call-template name="getLocalizedString">
2372
+ <xsl:with-param name="key">toc_examples</xsl:with-param>
2373
+ </xsl:call-template>
2374
+ </xsl:if>
2375
+ </mnx:title-list-examples>
2363
2376
 
2364
- <xsl:variable name="title-list-recommendations">
2365
- <xsl:variable name="toc_requirement_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='requirement']/mn:title"/>
2366
- <xsl:value-of select="$toc_requirement_title"/>
2367
- <xsl:if test="normalize-space($toc_requirement_title) = ''">
2368
- <xsl:call-template name="getLocalizedString">
2369
- <xsl:with-param name="key">toc_recommendations</xsl:with-param>
2370
- </xsl:call-template>
2371
- </xsl:if>
2377
+ <mnx:title-list-recommendations>
2378
+ <xsl:variable name="toc_requirement_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='requirement']/mn:title"/>
2379
+ <xsl:value-of select="$toc_requirement_title"/>
2380
+ <xsl:if test="normalize-space($toc_requirement_title) = ''">
2381
+ <xsl:call-template name="getLocalizedString">
2382
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
2383
+ </xsl:call-template>
2384
+ </xsl:if>
2385
+ </mnx:title-list-recommendations>
2386
+ </mnx:doc>
2387
+ </xsl:for-each>
2388
+ </xsl:for-each>
2372
2389
  </xsl:variable>
2390
+ <xsl:variable name="toc_title_lists" select="xalan:nodeset($toc_title_lists_)"/>
2373
2391
 
2374
2392
  <xsl:variable name="bibdata">
2375
2393
  <xsl:copy-of select="//mn:metanorma/mn:bibdata"/>
@@ -3164,7 +3182,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
3164
3182
  <xsl:apply-templates mode="update_xml_step1"/>
3165
3183
  </xsl:template>
3166
3184
 
3167
- <xsl:template match="mn:semx" mode="update_xml_step1">
3185
+ <xsl:template match="mn:semx[not(@element = 'name')]" mode="update_xml_step1">
3168
3186
  <xsl:apply-templates mode="update_xml_step1"/>
3169
3187
  </xsl:template>
3170
3188
 
@@ -3447,7 +3465,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
3447
3465
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
3448
3466
  <xsl:variable name="regex_dots_units">((\b((<xsl:value-of select="$non_white_space"/>{1,3}\.<xsl:value-of select="$non_white_space"/>+)|(<xsl:value-of select="$non_white_space"/>+\.<xsl:value-of select="$non_white_space"/>{1,3}))\b)|(\.<xsl:value-of select="$non_white_space"/>{1,3})\b)</xsl:variable>
3449
3467
 
3450
- <xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or (ancestor::mn:tt and ancestor::mn:table and string-length() &gt; 20) or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or ancestor::mn:fmt-name or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
3468
+ <xsl:template match="text()[not( (ancestor::mn:bibdata and not(ancestor::mn:title)) or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or (ancestor::mn:tt and ancestor::mn:table and string-length() &gt; 20) or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or (ancestor::mn:fmt-name and not(ancestor::mn:semx[@element = 'name'])) or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
3451
3469
 
3452
3470
  <xsl:variable name="parent" select="local-name(..)"/>
3453
3471
 
@@ -3492,7 +3510,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
3492
3510
  <xsl:variable name="text">
3493
3511
  <xsl:element name="text" namespace="{$namespace_full}">
3494
3512
  <xsl:choose>
3495
- <xsl:when test="ancestor::mn:table"><xsl:value-of select="."/></xsl:when> <!-- no need enclose standard's number into tag 'keep-together_within-line' in table cells -->
3513
+ <xsl:when test="ancestor::mn:table and not(ancestor::mn:fmt-name)"><xsl:value-of select="."/></xsl:when> <!-- no need enclose standard's number into tag 'keep-together_within-line' in table cells -->
3496
3514
  <xsl:otherwise>
3497
3515
  <xsl:variable name="text_" select="java:replaceAll(java:java.lang.String.new(.), $regex_standard_reference, concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
3498
3516
  <!-- <xsl:value-of select="$text__"/> -->
@@ -3570,6 +3588,10 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
3570
3588
  <xsl:copy-of select="."/>
3571
3589
  </xsl:template>
3572
3590
 
3591
+ <xsl:template match="mn:semx" mode="update_xml_enclose_keep-together_within-line">
3592
+ <xsl:apply-templates mode="update_xml_enclose_keep-together_within-line"/>
3593
+ </xsl:template>
3594
+
3573
3595
  <xsl:template name="replace_text_tags">
3574
3596
  <xsl:param name="tag_open"/>
3575
3597
  <xsl:param name="tag_close"/>
@@ -10938,6 +10960,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
10938
10960
  <xsl:variable name="svg_content">
10939
10961
  <xsl:apply-templates select="." mode="svg_update"/>
10940
10962
  </xsl:variable>
10963
+ <!-- <svg_content><xsl:copy-of select="$svg_content"/></svg_content> -->
10941
10964
 
10942
10965
  <xsl:variable name="alt-text">
10943
10966
  <xsl:choose>
@@ -11152,7 +11175,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
11152
11175
  </xsl:copy>
11153
11176
  </xsl:template>
11154
11177
 
11155
- <xsl:template match="mn:image/@href" mode="svg_update">
11178
+ <xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
11156
11179
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
11157
11180
  <xsl:value-of select="."/>
11158
11181
  </xsl:attribute>
@@ -13767,13 +13790,13 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
13767
13790
 
13768
13791
  <xsl:template name="processTablesFigures_Contents">
13769
13792
  <xsl:param name="always"/>
13770
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
13793
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
13771
13794
  <xsl:call-template name="processTables_Contents"/>
13772
13795
  </xsl:if>
13773
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
13796
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
13774
13797
  <xsl:call-template name="processFigures_Contents"/>
13775
13798
  </xsl:if>
13776
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title)">
13799
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title)">
13777
13800
  <xsl:call-template name="processExamples_Contents"/>
13778
13801
  </xsl:if>
13779
13802
  </xsl:template>
@@ -13824,22 +13847,22 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
13824
13847
 
13825
13848
  <xsl:template name="processExamples_Contents">
13826
13849
  <mnx:examples>
13827
- <xsl:for-each select="//mn:example[@id and mn:fmt-name and not(@unnumbered = 'true') and normalize-space(@id) != '']">
13828
- <xsl:choose>
13829
- <xsl:when test="mn:fmt-name">
13830
- <xsl:variable name="fmt_name">
13831
- <xsl:apply-templates select="mn:fmt-name" mode="update_xml_step1"/>
13832
- </xsl:variable>
13833
- <mnx:example id="{@id}" alt-text="{normalize-space($fmt_name)}">
13834
- <xsl:copy-of select="$fmt_name"/>
13835
- </mnx:example>
13836
- </xsl:when>
13837
- <xsl:otherwise>
13838
- <mnx:example id="{@id}" alt-text="{mn:name}">
13839
- <xsl:copy-of select="mn:name"/>
13840
- </mnx:example>
13841
- </xsl:otherwise>
13842
- </xsl:choose>
13850
+ <xsl:for-each select="//mn:example[@id and mn:fmt-name and normalize-space(@id) != '']">
13851
+ <!-- https://github.com/metanorma/metanorma-pdfa/issues/32#issuecomment-4929133938:
13852
+ //example/fmt-xref-label[@container] + //example/fmt-name/span[@class = 'fmt-caption-delim'] + //example/name,
13853
+ with the last two elements dropped if //example/name does not exist. -->
13854
+ <xsl:variable name="example_name">
13855
+ <xsl:apply-templates select="mn:name/node()" mode="update_xml_step1"/>
13856
+ </xsl:variable>
13857
+ <mnx:example id="{@id}" alt-text="{normalize-space($example_name)}">
13858
+ <xsl:element name="fmt-name" namespace="{$namespace_full}">
13859
+ <xsl:value-of select="mn:fmt-xref-label[@container]"/>
13860
+ <xsl:if test="normalize-space($example_name) != ''">
13861
+ <xsl:value-of select="mn:fmt-name/mn:span[@class = 'fmt-caption-delim']"/>
13862
+ <xsl:copy-of select="$example_name"/>
13863
+ </xsl:if>
13864
+ </xsl:element>
13865
+ </mnx:example>
13843
13866
  </xsl:for-each>
13844
13867
  </mnx:examples>
13845
13868
  </xsl:template>
@@ -14112,15 +14135,18 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
14112
14135
 
14113
14136
  <xsl:call-template name="insertFigureBookmarks">
14114
14137
  <xsl:with-param name="contents" select="mnx:contents"/>
14138
+ <xsl:with-param name="num" select="@num"/>
14115
14139
  </xsl:call-template>
14116
14140
 
14117
14141
  <xsl:call-template name="insertTableBookmarks">
14118
14142
  <xsl:with-param name="contents" select="mnx:contents"/>
14143
+ <xsl:with-param name="num" select="@num"/>
14119
14144
  <xsl:with-param name="lang" select="@lang"/>
14120
14145
  </xsl:call-template>
14121
14146
 
14122
14147
  <xsl:call-template name="insertExampleBookmarks">
14123
14148
  <xsl:with-param name="contents" select="mnx:contents"/>
14149
+ <xsl:with-param name="num" select="@num"/>
14124
14150
  <xsl:with-param name="lang" select="@lang"/>
14125
14151
  </xsl:call-template>
14126
14152
 
@@ -14135,15 +14161,18 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
14135
14161
 
14136
14162
  <xsl:call-template name="insertFigureBookmarks">
14137
14163
  <xsl:with-param name="contents" select="mnx:contents"/>
14164
+ <xsl:with-param name="num" select="@num"/>
14138
14165
  </xsl:call-template>
14139
14166
 
14140
14167
  <xsl:call-template name="insertTableBookmarks">
14141
14168
  <xsl:with-param name="contents" select="mnx:contents"/>
14169
+ <xsl:with-param name="num" select="@num"/>
14142
14170
  <xsl:with-param name="lang" select="@lang"/>
14143
14171
  </xsl:call-template>
14144
14172
 
14145
14173
  <xsl:call-template name="insertExampleBookmarks">
14146
14174
  <xsl:with-param name="contents" select="mnx:contents"/>
14175
+ <xsl:with-param name="num" select="@num"/>
14147
14176
  <xsl:with-param name="lang" select="@lang"/>
14148
14177
  </xsl:call-template>
14149
14178
 
@@ -14156,15 +14185,18 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
14156
14185
 
14157
14186
  <xsl:call-template name="insertFigureBookmarks">
14158
14187
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
14188
+ <xsl:with-param name="num" select="@num"/>
14159
14189
  </xsl:call-template>
14160
14190
 
14161
14191
  <xsl:call-template name="insertTableBookmarks">
14162
14192
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
14193
+ <xsl:with-param name="num" select="@num"/>
14163
14194
  <xsl:with-param name="lang" select="@lang"/>
14164
14195
  </xsl:call-template>
14165
14196
 
14166
14197
  <xsl:call-template name="insertExampleBookmarks">
14167
14198
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
14199
+ <xsl:with-param name="num" select="@num"/>
14168
14200
  <xsl:with-param name="lang" select="@lang"/>
14169
14201
  </xsl:call-template>
14170
14202
 
@@ -14180,6 +14212,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
14180
14212
 
14181
14213
  <xsl:template name="insertFigureBookmarks">
14182
14214
  <xsl:param name="contents"/>
14215
+ <xsl:param name="num"/>
14183
14216
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
14184
14217
  <xsl:if test="$contents_nodes/mnx:figure">
14185
14218
  <fo:bookmark internal-destination="{$contents_nodes/mnx:figure[1]/@id}" starting-state="hide">
@@ -14213,6 +14246,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
14213
14246
 
14214
14247
  <xsl:template name="insertTableBookmarks">
14215
14248
  <xsl:param name="contents"/>
14249
+ <xsl:param name="num"/>
14216
14250
  <xsl:param name="lang"/>
14217
14251
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
14218
14252
  <xsl:if test="$contents_nodes/mnx:table">
@@ -14258,8 +14292,9 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
14258
14292
  </xsl:if>
14259
14293
  </xsl:template> <!-- insertTableBookmarks -->
14260
14294
 
14261
- <xsl:template name="insertExampleBookmarks">
14295
+ <xsl:template name="insertExampleBookmarks">
14262
14296
  <xsl:param name="contents"/>
14297
+ <xsl:param name="num"/>
14263
14298
  <xsl:param name="lang"/>
14264
14299
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
14265
14300
  <xsl:if test="$contents_nodes/mnx:example">
@@ -14451,6 +14486,18 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
14451
14486
  </xsl:copy>
14452
14487
  </xsl:template>
14453
14488
 
14489
+ <xsl:template match="mn:tt" mode="contents_item">
14490
+ <xsl:copy>
14491
+ <xsl:apply-templates mode="contents_item"/>
14492
+ </xsl:copy>
14493
+ </xsl:template>
14494
+
14495
+ <xsl:template match="*[local-name() = 'keep-together_within-line']" mode="contents_item">
14496
+ <xsl:copy>
14497
+ <xsl:apply-templates mode="contents_item"/>
14498
+ </xsl:copy>
14499
+ </xsl:template>
14500
+
14454
14501
  <xsl:template match="mn:stem" mode="contents_item"/>
14455
14502
  <xsl:template match="mn:fmt-stem" mode="contents_item">
14456
14503
  <xsl:copy-of select="."/>
@@ -1931,7 +1931,7 @@ or as the string "auto"</a:documentation>
1931
1931
  </element>
1932
1932
  </define>
1933
1933
  <define name="mathml">
1934
- <a:documentation>Encoding of MathML: the official W3C MathML 3.0 grammar (namespace
1934
+ <a:documentation>Encoding of MathML: the official W3C MathML 4 grammar (namespace
1935
1935
  http://www.w3.org/1998/Math/MathML), via the metanorma wrapper in
1936
1936
  grammars/mathml/. See grammars/mathml/README.adoc and basicdoc-models#35.</a:documentation>
1937
1937
  <externalRef href="metanorma-mathml.rng"/>
@@ -1,22 +1,21 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!--
4
- This is the Mathematical Markup Language (MathML) 3.0, an XML
5
- application for describing mathematical notation and capturing
6
- both its structure and content.
7
-
8
- Copyright 1998-2014 W3C (MIT, ERCIM, Keio, Beihang)
9
-
10
- Use and distribution of this code are permitted under the terms
11
- W3C Software Notice and License
12
- http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
13
- -->
14
- <include href="mathml3-strict-content.rng">
2
+ <!--
3
+ MathML 4 (Content)
4
+ ##################
5
+ -->
6
+ <!--
7
+ Copyright 1998-2026 W3C (MIT, ERCIM, Keio, Beihang)
8
+
9
+ Use and distribution of this code are permitted under the terms
10
+ W3C Software Notice and License
11
+ http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
12
+ -->
13
+ <grammar ns="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
14
+ <include href="mathml4-strict-content.rng">
15
15
  <define name="cn.content">
16
16
  <zeroOrMore>
17
17
  <choice>
18
18
  <text/>
19
- <ref name="mglyph"/>
20
19
  <ref name="sep"/>
21
20
  <ref name="PresentationExpression"/>
22
21
  </choice>
@@ -46,7 +45,6 @@
46
45
  <zeroOrMore>
47
46
  <choice>
48
47
  <text/>
49
- <ref name="mglyph"/>
50
48
  <ref name="PresentationExpression"/>
51
49
  </choice>
52
50
  </zeroOrMore>
@@ -65,11 +63,22 @@
65
63
  <zeroOrMore>
66
64
  <choice>
67
65
  <text/>
68
- <ref name="mglyph"/>
69
66
  <ref name="PresentationExpression"/>
70
67
  </choice>
71
68
  </zeroOrMore>
72
69
  </define>
70
+ <define name="annotation-xml.attributes" combine="choice">
71
+ <ref name="CommonAtt"/>
72
+ <optional>
73
+ <ref name="cd"/>
74
+ </optional>
75
+ <optional>
76
+ <ref name="name"/>
77
+ </optional>
78
+ <optional>
79
+ <ref name="encoding"/>
80
+ </optional>
81
+ </define>
73
82
  <define name="bvar">
74
83
  <element name="bvar">
75
84
  <ref name="CommonAtt"/>
@@ -113,6 +122,63 @@
113
122
  <ref name="apply.content"/>
114
123
  </define>
115
124
  </include>
125
+ <define name="NonMathMLAtt" combine="choice">
126
+ <attribute>
127
+ <anyName>
128
+ <except>
129
+ <nsName ns=""/>
130
+ <nsName/>
131
+ </except>
132
+ </anyName>
133
+ <data type="string"/>
134
+ </attribute>
135
+ </define>
136
+ <!--
137
+ METANORMA MODIFICATION (basicdoc-models#39): upstream re-adds
138
+ `attribute alttext` to math.attributes here, but mathml4-core.rnc already
139
+ defines it on math; RELAX NG's duplicate-attribute restriction rejects the
140
+ composed grammar (jing: 'duplicate attribute "alttext"').
141
+ Upstream text was:
142
+ math.attributes &=
143
+ attribute alttext {text}?
144
+ -->
145
+ <!--
146
+ METANORMA MODIFICATION (basicdoc-models#39): upstream re-adds the
147
+ `data-other` placeholder to MathMLDataAttributes here; dropped for the
148
+ same reason as the core placeholder (see mathml4-core.rnc modification).
149
+ Upstream text was:
150
+ MathMLDataAttributes &=
151
+ attribute data-other {text}?
152
+ -->
153
+ <define name="CommonAtt" combine="interleave">
154
+ <zeroOrMore>
155
+ <ref name="NonMathMLAtt"/>
156
+ </zeroOrMore>
157
+ <ref name="MathMLDataAttributes"/>
158
+ <optional>
159
+ <attribute name="class">
160
+ <data type="NCName"/>
161
+ </attribute>
162
+ </optional>
163
+ <optional>
164
+ <attribute name="style">
165
+ <data type="string"/>
166
+ </attribute>
167
+ </optional>
168
+ <optional>
169
+ <attribute name="href">
170
+ <data type="anyURI"/>
171
+ </attribute>
172
+ </optional>
173
+ <optional>
174
+ <attribute name="intent"/>
175
+ </optional>
176
+ <optional>
177
+ <attribute name="arg">
178
+ <data type="NCName"/>
179
+ </attribute>
180
+ </optional>
181
+ </define>
116
182
  <define name="base">
117
183
  <attribute name="base"/>
118
184
  </define>
@@ -124,6 +190,18 @@
124
190
  <define name="PresentationExpression" combine="choice">
125
191
  <notAllowed/>
126
192
  </define>
193
+ <define name="DefEncAtt">
194
+ <optional>
195
+ <attribute name="encoding">
196
+ <data type="string"/>
197
+ </attribute>
198
+ </optional>
199
+ <optional>
200
+ <attribute name="definitionURL">
201
+ <data type="anyURI"/>
202
+ </attribute>
203
+ </optional>
204
+ </define>
127
205
  <define name="DomainQ">
128
206
  <zeroOrMore>
129
207
  <choice>
@@ -228,60 +306,6 @@
228
306
  <ref name="ContExp"/>
229
307
  </element>
230
308
  </define>
231
- <define name="DeprecatedContExp">
232
- <choice>
233
- <ref name="reln"/>
234
- <ref name="fn"/>
235
- <ref name="declare"/>
236
- </choice>
237
- </define>
238
- <define name="ContExp" combine="choice">
239
- <ref name="DeprecatedContExp"/>
240
- </define>
241
- <define name="reln">
242
- <element name="reln">
243
- <zeroOrMore>
244
- <ref name="ContExp"/>
245
- </zeroOrMore>
246
- </element>
247
- </define>
248
- <define name="fn">
249
- <element name="fn">
250
- <ref name="ContExp"/>
251
- </element>
252
- </define>
253
- <define name="declare">
254
- <element name="declare">
255
- <optional>
256
- <attribute name="type">
257
- <data type="string"/>
258
- </attribute>
259
- </optional>
260
- <optional>
261
- <attribute name="scope">
262
- <data type="string"/>
263
- </attribute>
264
- </optional>
265
- <optional>
266
- <attribute name="nargs">
267
- <data type="nonNegativeInteger"/>
268
- </attribute>
269
- </optional>
270
- <optional>
271
- <attribute name="occurrence">
272
- <choice>
273
- <value>prefix</value>
274
- <value>infix</value>
275
- <value>function-model</value>
276
- </choice>
277
- </attribute>
278
- </optional>
279
- <ref name="DefEncAtt"/>
280
- <oneOrMore>
281
- <ref name="ContExp"/>
282
- </oneOrMore>
283
- </element>
284
- </define>
285
309
  <define name="interval.class">
286
310
  <ref name="interval"/>
287
311
  </define>
@@ -1253,10 +1277,10 @@
1253
1277
  <define name="nary-stats.class">
1254
1278
  <choice>
1255
1279
  <ref name="mean"/>
1256
- <ref name="sdev"/>
1257
- <ref name="variance"/>
1258
1280
  <ref name="median"/>
1259
1281
  <ref name="mode"/>
1282
+ <ref name="sdev"/>
1283
+ <ref name="variance"/>
1260
1284
  </choice>
1261
1285
  </define>
1262
1286
  <define name="ContExp" combine="choice">
@@ -1269,29 +1293,29 @@
1269
1293
  <empty/>
1270
1294
  </element>
1271
1295
  </define>
1272
- <define name="sdev">
1273
- <element name="sdev">
1296
+ <define name="median">
1297
+ <element name="median">
1274
1298
  <ref name="CommonAtt"/>
1275
1299
  <ref name="DefEncAtt"/>
1276
1300
  <empty/>
1277
1301
  </element>
1278
1302
  </define>
1279
- <define name="variance">
1280
- <element name="variance">
1303
+ <define name="mode">
1304
+ <element name="mode">
1281
1305
  <ref name="CommonAtt"/>
1282
1306
  <ref name="DefEncAtt"/>
1283
1307
  <empty/>
1284
1308
  </element>
1285
1309
  </define>
1286
- <define name="median">
1287
- <element name="median">
1310
+ <define name="sdev">
1311
+ <element name="sdev">
1288
1312
  <ref name="CommonAtt"/>
1289
1313
  <ref name="DefEncAtt"/>
1290
1314
  <empty/>
1291
1315
  </element>
1292
1316
  </define>
1293
- <define name="mode">
1294
- <element name="mode">
1317
+ <define name="variance">
1318
+ <element name="variance">
1295
1319
  <ref name="CommonAtt"/>
1296
1320
  <ref name="DefEncAtt"/>
1297
1321
  <empty/>