metanorma-jis 1.1.3 → 1.1.5

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: 9727824814788553e26155d864083a9719656df5838de1228de2d79ec7abeca8
4
- data.tar.gz: af78942277db16d4d8d4e2006aed3959a9c446a15255028f2533a8909f3b652d
3
+ metadata.gz: 45a55b154f22819867e78c58cd9c5e6b5df3f2945fe2b5c59ff1ed82da5d0e3b
4
+ data.tar.gz: 6395393aa0b1aab58c787cf32f910a6d195d3445ea9ccc678c7ef238732a16f5
5
5
  SHA512:
6
- metadata.gz: 261358f56f3d9cd70fee2d8586560628ec06e2efdd855a70bd8393d9c8fbd8161a48d1243ec7cbca291bc51ceced35d119c4e25adc56bbc1719a22bae26af675
7
- data.tar.gz: 053e8c3fd4f136acc9c5e45b63b866eb9080ad570d61bf333b3b8218b5732db85e5123efd66c1394a15de64890192e7d050f41a3c229169f303f5623a488c7cf
6
+ metadata.gz: fb5a4666ba5423f52ce5a54018c1af773188121226295c8edcdba55695f9e2734d57f99de637195dab0924a40906f5aec35c1985565b3745947bd1dc02363041
7
+ data.tar.gz: 9103861c122a615b858716a4802f6f43836e87c937b417dcd29dd97390a915696848cf7082ba080119b9c5f776ee721102460149a3c38b99013bb5a716a97359
data/.rubocop.yml CHANGED
@@ -2,9 +2,30 @@
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
14
+
15
+ # Rubocop plugins enabled centrally so every metanorma-org gem picks them up
16
+ # on cimas sync — best practice belongs at the shared-template layer, not
17
+ # per-repo. Per ronaldtse feedback on metanorma/ci#332.
18
+ plugins:
19
+ - rubocop-rspec
20
+ - rubocop-performance
21
+ - rubocop-rake
5
22
 
6
23
  # local repo-specific modifications
7
24
  # ...
8
25
 
9
26
  AllCops:
10
- TargetRubyVersion: 3.4
27
+ # 3.3 matches the org-wide minimum being pushed via #274 (Raise minimum
28
+ # Ruby version to 3.3 due to EOL of 3.2 on 2026-03-31). Was 3.4 before
29
+ # this commit — 3.4 was above the org's stated minimum and would have
30
+ # applied Rubocop rules that fail-close on gems still targeting 3.3.
31
+ TargetRubyVersion: 3.3
@@ -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
  }
@@ -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
  }
@@ -5644,45 +5644,59 @@
5644
5644
 
5645
5645
  <xsl:variable name="ace_tag">ace-tag_</xsl:variable>
5646
5646
 
5647
- <xsl:variable name="title-list-tables">
5648
- <xsl:variable name="toc_table_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title"/>
5649
- <xsl:value-of select="$toc_table_title"/>
5650
- <xsl:if test="normalize-space($toc_table_title) = ''">
5651
- <xsl:call-template name="getLocalizedString">
5652
- <xsl:with-param name="key">toc_tables</xsl:with-param>
5653
- </xsl:call-template>
5654
- </xsl:if>
5655
- </xsl:variable>
5647
+ <xsl:variable name="toc_title_lists_">
5648
+ <xsl:for-each select="//mn:metanorma">
5649
+ <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
5650
+ <xsl:variable name="docid"><xsl:call-template name="getDocumentId"/></xsl:variable>
5651
+ <xsl:variable name="current_document">
5652
+ <xsl:copy-of select="."/>
5653
+ </xsl:variable>
5654
+ <xsl:for-each select="xalan:nodeset($current_document)">
5655
+ <mnx:doc id="{$docid}" num="{$num}">
5656
+ <mnx:title-list-tables>
5657
+ <xsl:variable name="toc_table_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title"/>
5658
+ <xsl:value-of select="$toc_table_title"/>
5659
+ <xsl:if test="normalize-space($toc_table_title) = ''">
5660
+ <xsl:call-template name="getLocalizedString">
5661
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
5662
+ </xsl:call-template>
5663
+ </xsl:if>
5664
+ </mnx:title-list-tables>
5656
5665
 
5657
- <xsl:variable name="title-list-figures">
5658
- <xsl:variable name="toc_figure_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title"/>
5659
- <xsl:value-of select="$toc_figure_title"/>
5660
- <xsl:if test="normalize-space($toc_figure_title) = ''">
5661
- <xsl:call-template name="getLocalizedString">
5662
- <xsl:with-param name="key">toc_figures</xsl:with-param>
5663
- </xsl:call-template>
5664
- </xsl:if>
5665
- </xsl:variable>
5666
+ <mnx:title-list-figures>
5667
+ <xsl:variable name="toc_figure_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title"/>
5668
+ <xsl:value-of select="$toc_figure_title"/>
5669
+ <xsl:if test="normalize-space($toc_figure_title) = ''">
5670
+ <xsl:call-template name="getLocalizedString">
5671
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
5672
+ </xsl:call-template>
5673
+ </xsl:if>
5674
+ </mnx:title-list-figures>
5666
5675
 
5667
- <xsl:variable name="title-list-examples">
5668
- <xsl:variable name="toc_example_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title"/>
5669
- <xsl:value-of select="$toc_example_title"/>
5670
- <xsl:if test="normalize-space($toc_example_title) = ''">
5671
- <xsl:call-template name="getLocalizedString">
5672
- <xsl:with-param name="key">toc_examples</xsl:with-param>
5673
- </xsl:call-template>
5674
- </xsl:if>
5675
- </xsl:variable>
5676
+ <mnx:title-list-examples>
5677
+ <xsl:variable name="toc_example_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title"/>
5678
+ <xsl:value-of select="$toc_example_title"/>
5679
+ <xsl:if test="normalize-space($toc_example_title) = ''">
5680
+ <xsl:call-template name="getLocalizedString">
5681
+ <xsl:with-param name="key">toc_examples</xsl:with-param>
5682
+ </xsl:call-template>
5683
+ </xsl:if>
5684
+ </mnx:title-list-examples>
5676
5685
 
5677
- <xsl:variable name="title-list-recommendations">
5678
- <xsl:variable name="toc_requirement_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='requirement']/mn:title"/>
5679
- <xsl:value-of select="$toc_requirement_title"/>
5680
- <xsl:if test="normalize-space($toc_requirement_title) = ''">
5681
- <xsl:call-template name="getLocalizedString">
5682
- <xsl:with-param name="key">toc_recommendations</xsl:with-param>
5683
- </xsl:call-template>
5684
- </xsl:if>
5686
+ <mnx:title-list-recommendations>
5687
+ <xsl:variable name="toc_requirement_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='requirement']/mn:title"/>
5688
+ <xsl:value-of select="$toc_requirement_title"/>
5689
+ <xsl:if test="normalize-space($toc_requirement_title) = ''">
5690
+ <xsl:call-template name="getLocalizedString">
5691
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
5692
+ </xsl:call-template>
5693
+ </xsl:if>
5694
+ </mnx:title-list-recommendations>
5695
+ </mnx:doc>
5696
+ </xsl:for-each>
5697
+ </xsl:for-each>
5685
5698
  </xsl:variable>
5699
+ <xsl:variable name="toc_title_lists" select="xalan:nodeset($toc_title_lists_)"/>
5686
5700
 
5687
5701
  <xsl:variable name="bibdata">
5688
5702
  <xsl:copy-of select="//mn:metanorma/mn:bibdata"/>
@@ -6514,7 +6528,7 @@
6514
6528
  <xsl:apply-templates mode="update_xml_step1"/>
6515
6529
  </xsl:template>
6516
6530
 
6517
- <xsl:template match="mn:semx" mode="update_xml_step1">
6531
+ <xsl:template match="mn:semx[not(@element = 'name')]" mode="update_xml_step1">
6518
6532
  <xsl:apply-templates mode="update_xml_step1"/>
6519
6533
  </xsl:template>
6520
6534
 
@@ -6900,7 +6914,7 @@
6900
6914
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
6901
6915
  <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>
6902
6916
 
6903
- <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">
6917
+ <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">
6904
6918
 
6905
6919
  <xsl:variable name="parent" select="local-name(..)"/>
6906
6920
 
@@ -6945,7 +6959,7 @@
6945
6959
  <xsl:variable name="text">
6946
6960
  <xsl:element name="text" namespace="{$namespace_full}">
6947
6961
  <xsl:choose>
6948
- <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 -->
6962
+ <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 -->
6949
6963
  <xsl:otherwise>
6950
6964
  <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))"/>
6951
6965
  <!-- <xsl:value-of select="$text__"/> -->
@@ -7023,6 +7037,10 @@
7023
7037
  <xsl:copy-of select="."/>
7024
7038
  </xsl:template>
7025
7039
 
7040
+ <xsl:template match="mn:semx" mode="update_xml_enclose_keep-together_within-line">
7041
+ <xsl:apply-templates mode="update_xml_enclose_keep-together_within-line"/>
7042
+ </xsl:template>
7043
+
7026
7044
  <xsl:template name="replace_text_tags">
7027
7045
  <xsl:param name="tag_open"/>
7028
7046
  <xsl:param name="tag_close"/>
@@ -11198,6 +11216,12 @@
11198
11216
  <style name="{$key}-left"><xsl:value-of select="$value"/></style>
11199
11217
  <style name="{$key}-bottom"><xsl:value-of select="$value"/></style>
11200
11218
  </xsl:if>
11219
+ <xsl:if test="$key = 'page-break-inside' and $value = 'avoid'">
11220
+ <style name="keep-together.within-page">always</style>
11221
+ </xsl:if>
11222
+ <xsl:if test="$key = 'page-break-after' and $value = 'always'">
11223
+ <style name="break-after">page</style>
11224
+ </xsl:if>
11201
11225
  </xsl:for-each>
11202
11226
  </xsl:variable>
11203
11227
  <xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
@@ -11241,6 +11265,11 @@
11241
11265
 
11242
11266
  <fo:block role="SKIP">
11243
11267
 
11268
+ <xsl:variable name="styles">
11269
+ <styles><xsl:call-template name="setTableStyles"/></styles>
11270
+ </xsl:variable>
11271
+ <xsl:copy-of select="xalan:nodeset($styles)/styles/@break-after"/>
11272
+
11244
11273
  <xsl:if test="$isGenerateTableIF = 'true'">
11245
11274
  <fo:inline>
11246
11275
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
@@ -13436,21 +13465,38 @@
13436
13465
  <!-- ====== -->
13437
13466
  <!-- ====== -->
13438
13467
 
13439
- <xsl:attribute-set name="quote-style">
13468
+ <xsl:attribute-set name="quote-container-style">
13440
13469
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
13441
13470
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
13471
+ <xsl:attribute name="role">SKIP</xsl:attribute>
13472
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
13442
13473
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
13443
13474
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
13444
- </xsl:attribute-set> <!-- quote-style -->
13475
+ </xsl:attribute-set>
13445
13476
 
13446
- <xsl:template name="refine_quote-style">
13477
+ <xsl:template name="refine_quote-container-style">
13478
+ <xsl:if test="parent::mn:note">
13479
+ <xsl:if test="not(ancestor::mn:table)">
13480
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
13481
+ </xsl:if>
13482
+ </xsl:if>
13447
13483
  <xsl:if test="ancestor::mn:li">
13448
13484
  <xsl:attribute name="margin-left">7.5mm</xsl:attribute>
13449
13485
  </xsl:if>
13486
+ </xsl:template>
13487
+
13488
+ <xsl:attribute-set name="quote-style">
13489
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
13490
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
13491
+
13492
+ </xsl:attribute-set> <!-- quote-style -->
13493
+
13494
+ <xsl:template name="refine_quote-style">
13450
13495
  </xsl:template> <!-- refine_quote-style -->
13451
13496
 
13452
13497
  <xsl:attribute-set name="quote-source-style">
13453
13498
  <xsl:attribute name="text-align">right</xsl:attribute>
13499
+ <xsl:attribute name="margin-right">-12mm</xsl:attribute>
13454
13500
  </xsl:attribute-set> <!-- quote-source-style -->
13455
13501
 
13456
13502
  <xsl:template name="refine_quote-source-style">
@@ -13473,12 +13519,9 @@
13473
13519
 
13474
13520
  <xsl:call-template name="setBlockSpanAll"/>
13475
13521
 
13476
- <xsl:if test="parent::mn:note">
13477
- <xsl:if test="not(ancestor::mn:table)">
13478
- <xsl:attribute name="margin-left">5mm</xsl:attribute>
13479
- </xsl:if>
13480
- </xsl:if>
13481
- <fo:block-container margin-left="0mm" role="SKIP">
13522
+ <fo:block-container xsl:use-attribute-sets="quote-container-style">
13523
+ <xsl:call-template name="refine_quote-container-style"/>
13524
+
13482
13525
  <fo:block-container xsl:use-attribute-sets="quote-style" role="SKIP">
13483
13526
 
13484
13527
  <xsl:call-template name="refine_quote-style"/>
@@ -13490,14 +13533,16 @@
13490
13533
  </fo:block-container>
13491
13534
  </fo:block-container>
13492
13535
  <xsl:if test="mn:author or mn:fmt-source or mn:attribution">
13493
- <fo:block xsl:use-attribute-sets="quote-source-style">
13494
- <xsl:call-template name="refine_quote-source-style"/>
13495
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
13496
- <xsl:apply-templates select="mn:author"/>
13497
- <xsl:apply-templates select="mn:fmt-source"/>
13498
- <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
13499
- <xsl:apply-templates select="mn:attribution/mn:p/node()"/>
13500
- </fo:block>
13536
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
13537
+ <fo:block xsl:use-attribute-sets="quote-source-style">
13538
+ <xsl:call-template name="refine_quote-source-style"/>
13539
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
13540
+ <xsl:apply-templates select="mn:author"/>
13541
+ <xsl:apply-templates select="mn:fmt-source"/>
13542
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
13543
+ <xsl:apply-templates select="mn:attribution/mn:p/node()"/>
13544
+ </fo:block>
13545
+ </fo:block-container>
13501
13546
  </xsl:if>
13502
13547
  <!-- render footnotes after references -->
13503
13548
  <xsl:apply-templates select=".//mn:fn[generate-id(.)=generate-id(key('kfn',@reference)[1])]" mode="fn_after_element">
@@ -14388,6 +14433,7 @@
14388
14433
  <xsl:variable name="svg_content">
14389
14434
  <xsl:apply-templates select="." mode="svg_update"/>
14390
14435
  </xsl:variable>
14436
+ <!-- <svg_content><xsl:copy-of select="$svg_content"/></svg_content> -->
14391
14437
 
14392
14438
  <xsl:variable name="alt-text">
14393
14439
  <xsl:choose>
@@ -14602,7 +14648,7 @@
14602
14648
  </xsl:copy>
14603
14649
  </xsl:template>
14604
14650
 
14605
- <xsl:template match="mn:image/@href" mode="svg_update">
14651
+ <xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
14606
14652
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
14607
14653
  <xsl:value-of select="."/>
14608
14654
  </xsl:attribute>
@@ -17299,13 +17345,13 @@
17299
17345
 
17300
17346
  <xsl:template name="processTablesFigures_Contents">
17301
17347
  <xsl:param name="always"/>
17302
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
17348
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
17303
17349
  <xsl:call-template name="processTables_Contents"/>
17304
17350
  </xsl:if>
17305
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
17351
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
17306
17352
  <xsl:call-template name="processFigures_Contents"/>
17307
17353
  </xsl:if>
17308
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title)">
17354
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title)">
17309
17355
  <xsl:call-template name="processExamples_Contents"/>
17310
17356
  </xsl:if>
17311
17357
  </xsl:template>
@@ -17356,22 +17402,22 @@
17356
17402
 
17357
17403
  <xsl:template name="processExamples_Contents">
17358
17404
  <mnx:examples>
17359
- <xsl:for-each select="//mn:example[@id and mn:fmt-name and not(@unnumbered = 'true') and normalize-space(@id) != '']">
17360
- <xsl:choose>
17361
- <xsl:when test="mn:fmt-name">
17362
- <xsl:variable name="fmt_name">
17363
- <xsl:apply-templates select="mn:fmt-name" mode="update_xml_step1"/>
17364
- </xsl:variable>
17365
- <mnx:example id="{@id}" alt-text="{normalize-space($fmt_name)}">
17366
- <xsl:copy-of select="$fmt_name"/>
17367
- </mnx:example>
17368
- </xsl:when>
17369
- <xsl:otherwise>
17370
- <mnx:example id="{@id}" alt-text="{mn:name}">
17371
- <xsl:copy-of select="mn:name"/>
17372
- </mnx:example>
17373
- </xsl:otherwise>
17374
- </xsl:choose>
17405
+ <xsl:for-each select="//mn:example[@id and mn:fmt-name and normalize-space(@id) != '']">
17406
+ <!-- https://github.com/metanorma/metanorma-pdfa/issues/32#issuecomment-4929133938:
17407
+ //example/fmt-xref-label[@container] + //example/fmt-name/span[@class = 'fmt-caption-delim'] + //example/name,
17408
+ with the last two elements dropped if //example/name does not exist. -->
17409
+ <xsl:variable name="example_name">
17410
+ <xsl:apply-templates select="mn:name/node()" mode="update_xml_step1"/>
17411
+ </xsl:variable>
17412
+ <mnx:example id="{@id}" alt-text="{normalize-space($example_name)}">
17413
+ <xsl:element name="fmt-name" namespace="{$namespace_full}">
17414
+ <xsl:value-of select="mn:fmt-xref-label[@container]"/>
17415
+ <xsl:if test="normalize-space($example_name) != ''">
17416
+ <xsl:value-of select="mn:fmt-name/mn:span[@class = 'fmt-caption-delim']"/>
17417
+ <xsl:copy-of select="$example_name"/>
17418
+ </xsl:if>
17419
+ </xsl:element>
17420
+ </mnx:example>
17375
17421
  </xsl:for-each>
17376
17422
  </mnx:examples>
17377
17423
  </xsl:template>
@@ -17644,15 +17690,18 @@
17644
17690
 
17645
17691
  <xsl:call-template name="insertFigureBookmarks">
17646
17692
  <xsl:with-param name="contents" select="mnx:contents"/>
17693
+ <xsl:with-param name="num" select="@num"/>
17647
17694
  </xsl:call-template>
17648
17695
 
17649
17696
  <xsl:call-template name="insertTableBookmarks">
17650
17697
  <xsl:with-param name="contents" select="mnx:contents"/>
17698
+ <xsl:with-param name="num" select="@num"/>
17651
17699
  <xsl:with-param name="lang" select="@lang"/>
17652
17700
  </xsl:call-template>
17653
17701
 
17654
17702
  <xsl:call-template name="insertExampleBookmarks">
17655
17703
  <xsl:with-param name="contents" select="mnx:contents"/>
17704
+ <xsl:with-param name="num" select="@num"/>
17656
17705
  <xsl:with-param name="lang" select="@lang"/>
17657
17706
  </xsl:call-template>
17658
17707
 
@@ -17667,15 +17716,18 @@
17667
17716
 
17668
17717
  <xsl:call-template name="insertFigureBookmarks">
17669
17718
  <xsl:with-param name="contents" select="mnx:contents"/>
17719
+ <xsl:with-param name="num" select="@num"/>
17670
17720
  </xsl:call-template>
17671
17721
 
17672
17722
  <xsl:call-template name="insertTableBookmarks">
17673
17723
  <xsl:with-param name="contents" select="mnx:contents"/>
17724
+ <xsl:with-param name="num" select="@num"/>
17674
17725
  <xsl:with-param name="lang" select="@lang"/>
17675
17726
  </xsl:call-template>
17676
17727
 
17677
17728
  <xsl:call-template name="insertExampleBookmarks">
17678
17729
  <xsl:with-param name="contents" select="mnx:contents"/>
17730
+ <xsl:with-param name="num" select="@num"/>
17679
17731
  <xsl:with-param name="lang" select="@lang"/>
17680
17732
  </xsl:call-template>
17681
17733
 
@@ -17688,15 +17740,18 @@
17688
17740
 
17689
17741
  <xsl:call-template name="insertFigureBookmarks">
17690
17742
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
17743
+ <xsl:with-param name="num" select="@num"/>
17691
17744
  </xsl:call-template>
17692
17745
 
17693
17746
  <xsl:call-template name="insertTableBookmarks">
17694
17747
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
17748
+ <xsl:with-param name="num" select="@num"/>
17695
17749
  <xsl:with-param name="lang" select="@lang"/>
17696
17750
  </xsl:call-template>
17697
17751
 
17698
17752
  <xsl:call-template name="insertExampleBookmarks">
17699
17753
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
17754
+ <xsl:with-param name="num" select="@num"/>
17700
17755
  <xsl:with-param name="lang" select="@lang"/>
17701
17756
  </xsl:call-template>
17702
17757
 
@@ -17712,6 +17767,7 @@
17712
17767
 
17713
17768
  <xsl:template name="insertFigureBookmarks">
17714
17769
  <xsl:param name="contents"/>
17770
+ <xsl:param name="num"/>
17715
17771
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
17716
17772
  <xsl:if test="$contents_nodes/mnx:figure">
17717
17773
  <fo:bookmark internal-destination="{$contents_nodes/mnx:figure[1]/@id}" starting-state="hide">
@@ -17729,7 +17785,7 @@
17729
17785
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
17730
17786
 
17731
17787
  <xsl:variable name="bookmark-title">
17732
- <xsl:value-of select="$title-list-figures"/>
17788
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-figures"/>
17733
17789
  </xsl:variable>
17734
17790
  <fo:bookmark-title><xsl:value-of select="normalize-space($bookmark-title)"/></fo:bookmark-title>
17735
17791
  <xsl:for-each select="$contents_nodes//mnx:figures/mnx:figure">
@@ -17743,6 +17799,7 @@
17743
17799
 
17744
17800
  <xsl:template name="insertTableBookmarks">
17745
17801
  <xsl:param name="contents"/>
17802
+ <xsl:param name="num"/>
17746
17803
  <xsl:param name="lang"/>
17747
17804
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
17748
17805
  <xsl:if test="$contents_nodes/mnx:table">
@@ -17766,7 +17823,7 @@
17766
17823
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
17767
17824
 
17768
17825
  <xsl:variable name="bookmark-title">
17769
- <xsl:value-of select="$title-list-tables"/>
17826
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-tables"/>
17770
17827
  </xsl:variable>
17771
17828
 
17772
17829
  <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
@@ -17781,8 +17838,9 @@
17781
17838
  </xsl:if>
17782
17839
  </xsl:template> <!-- insertTableBookmarks -->
17783
17840
 
17784
- <xsl:template name="insertExampleBookmarks">
17841
+ <xsl:template name="insertExampleBookmarks">
17785
17842
  <xsl:param name="contents"/>
17843
+ <xsl:param name="num"/>
17786
17844
  <xsl:param name="lang"/>
17787
17845
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
17788
17846
  <xsl:if test="$contents_nodes/mnx:example">
@@ -17806,7 +17864,7 @@
17806
17864
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
17807
17865
 
17808
17866
  <xsl:variable name="bookmark-title">
17809
- <xsl:value-of select="$title-list-examples"/>
17867
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-examples"/>
17810
17868
  </xsl:variable>
17811
17869
 
17812
17870
  <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
@@ -17967,6 +18025,18 @@
17967
18025
  </xsl:copy>
17968
18026
  </xsl:template>
17969
18027
 
18028
+ <xsl:template match="mn:tt" mode="contents_item">
18029
+ <xsl:copy>
18030
+ <xsl:apply-templates mode="contents_item"/>
18031
+ </xsl:copy>
18032
+ </xsl:template>
18033
+
18034
+ <xsl:template match="*[local-name() = 'keep-together_within-line']" mode="contents_item">
18035
+ <xsl:copy>
18036
+ <xsl:apply-templates mode="contents_item"/>
18037
+ </xsl:copy>
18038
+ </xsl:template>
18039
+
17970
18040
  <xsl:template match="mn:stem" mode="contents_item"/>
17971
18041
  <xsl:template match="mn:fmt-stem" mode="contents_item">
17972
18042
  <xsl:copy-of select="."/>
@@ -18873,6 +18943,10 @@
18873
18943
  <fo:block break-after="page"/>
18874
18944
  </xsl:template>
18875
18945
 
18946
+ <xsl:template match="mn:pagebreak[ancestor::mn:table]" priority="2">
18947
+ <fo:block break-after="page"/>
18948
+ </xsl:template>
18949
+
18876
18950
  <xsl:variable name="font_main_root_style">
18877
18951
  <root-style xsl:use-attribute-sets="root-style">
18878
18952
  </root-style>
@@ -1902,15 +1902,40 @@ or as the string "auto"</a:documentation>
1902
1902
  <a:documentation>Mathematically formatted text</a:documentation>
1903
1903
  <element name="stem">
1904
1904
  <ref name="StemAttributes"/>
1905
- <oneOrMore>
1906
- <choice>
1905
+ <optional>
1906
+ <text>
1907
1907
  <a:documentation>The content of the mathematically formatted text</a:documentation>
1908
- <text/>
1909
- <ref name="AnyElement"/>
1910
- </choice>
1911
- </oneOrMore>
1908
+ </text>
1909
+ </optional>
1910
+ <optional>
1911
+ <ref name="mathml"/>
1912
+ </optional>
1913
+ <optional>
1914
+ <ref name="asciimath"/>
1915
+ </optional>
1916
+ <optional>
1917
+ <ref name="latexmath"/>
1918
+ </optional>
1912
1919
  </element>
1913
1920
  </define>
1921
+ <define name="latexmath">
1922
+ <a:documentation>Encoding of LatexMath</a:documentation>
1923
+ <element name="latexmath">
1924
+ <text/>
1925
+ </element>
1926
+ </define>
1927
+ <define name="asciimath">
1928
+ <a:documentation>Encoding of AsciiMath</a:documentation>
1929
+ <element name="asciimath">
1930
+ <text/>
1931
+ </element>
1932
+ </define>
1933
+ <define name="mathml">
1934
+ <a:documentation>Encoding of MathML: the official W3C MathML 4 grammar (namespace
1935
+ http://www.w3.org/1998/Math/MathML), via the metanorma wrapper in
1936
+ grammars/mathml/. See grammars/mathml/README.adoc and basicdoc-models#35.</a:documentation>
1937
+ <externalRef href="metanorma-mathml.rng"/>
1938
+ </define>
1914
1939
  <define name="StemAttributes">
1915
1940
  <attribute name="type">
1916
1941
  <a:documentation>The notation used to mathematically format the text</a:documentation>
@@ -93,29 +93,31 @@ module Metanorma
93
93
  end
94
94
  end
95
95
 
96
- def pub_class_prep(bib)
97
- iso = bib.at("#{PUBLISHER}[abbreviation = 'ISO']") ||
98
- bib.at("#{PUBLISHER}[name = 'International Organization " \
99
- "for Standardization']")
100
- iec = bib.at("#{PUBLISHER}[abbreviation = 'IEC']") ||
101
- bib.at("#{PUBLISHER}[name = 'International " \
102
- "Electrotechnical Commission']")
103
- jis = bib.at("#{PUBLISHER}[abbreviation = 'JIS']") ||
104
- bib.at("#{PUBLISHER}[name = '#{@conv.pub_hash['ja']}']") ||
105
- bib.at("#{PUBLISHER}[name = '#{@conv.pub_hash['en']}']")
106
- [iso, iec, jis]
96
+ # JIS first, then ISO, then IEC, then other standards, then everything
97
+ # else. A co-publisher is ordered by the secondary key (see
98
+ # Standoc::Ref#publisher_sort_second), which reproduces the historical
99
+ # JIS ordering: JIS+IEC before JIS+ISO, JIS+IEC+ISO alongside JIS+IEC.
100
+ # Built at runtime because the JIS publisher name is language-dependent
101
+ # (@conv.pub_hash). Overridable per-document / per-taste via
102
+ # :sort-biblio-<abbrev>:.
103
+ def default_publisher_sort
104
+ [
105
+ { abbrev: "JIS",
106
+ name: [@conv.pub_hash["ja"], @conv.pub_hash["en"]].compact,
107
+ rank: 1 },
108
+ { abbrev: "ISO",
109
+ name: "International Organization for Standardization", rank: 2 },
110
+ { abbrev: "IEC", name: "International Electrotechnical Commission",
111
+ rank: 3 },
112
+ ]
107
113
  end
108
114
 
109
115
  def pub_class(bib)
110
- iso, iec, jis = pub_class_prep(bib)
111
- jis && iec && iso and return 2
112
- jis && iec and return 2
113
- jis && iso and return 3
114
- jis and return 1
115
- iso && iec and return 4
116
- iso and return 4
117
- iec and return 5
118
- 6
116
+ publisher_sort_rank(bib, default_publisher_sort)
117
+ end
118
+
119
+ def second_pub_class(bib, _first_pub = nil)
120
+ publisher_sort_second(bib, default_publisher_sort)
119
121
  end
120
122
  end
121
123
  end