metanorma-iso 3.4.7 → 3.4.9

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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +9 -0
  3. data/lib/isodoc/iso/html/style-human.css +5 -0
  4. data/lib/isodoc/iso/html/style-iso.css +5 -0
  5. data/lib/isodoc/iso/iso.amendment.xsl +146 -91
  6. data/lib/isodoc/iso/iso.international-standard.xsl +146 -91
  7. data/lib/isodoc/iso/presentation_xml_convert.rb +16 -0
  8. data/lib/metanorma/iso/basicdoc.rng +1 -1
  9. data/lib/metanorma/iso/cleanup_biblio.rb +28 -24
  10. data/lib/metanorma/iso/front_id.rb +4 -0
  11. data/lib/metanorma/iso/{mathml3-content.rng → mathml4-content.rng} +104 -80
  12. data/lib/metanorma/iso/mathml4-core.rng +1041 -0
  13. data/lib/metanorma/iso/{mathml3-presentation.rng → mathml4-presentation.rng} +184 -1060
  14. data/lib/metanorma/iso/{mathml3-strict-content.rng → mathml4-strict-content.rng} +92 -8
  15. data/lib/metanorma/iso/mathml4.rng +30 -0
  16. data/lib/metanorma/iso/metanorma-mathml.rng +22 -8
  17. data/lib/metanorma/iso/processor.rb +32 -2
  18. data/lib/metanorma/iso/sts/transformer/back_transformer.rb +85 -0
  19. data/lib/metanorma/iso/sts/transformer/base.rb +118 -0
  20. data/lib/metanorma/iso/sts/transformer/block_dispatcher.rb +109 -0
  21. data/lib/metanorma/iso/sts/transformer/body_transformer.rb +39 -0
  22. data/lib/metanorma/iso/sts/transformer/content_text.rb +40 -0
  23. data/lib/metanorma/iso/sts/transformer/context.rb +64 -0
  24. data/lib/metanorma/iso/sts/transformer/def_list_transformer.rb +57 -0
  25. data/lib/metanorma/iso/sts/transformer/document_transformer.rb +30 -0
  26. data/lib/metanorma/iso/sts/transformer/example_transformer.rb +41 -0
  27. data/lib/metanorma/iso/sts/transformer/figure_transformer.rb +44 -0
  28. data/lib/metanorma/iso/sts/transformer/footnote_collector.rb +82 -0
  29. data/lib/metanorma/iso/sts/transformer/formula_transformer.rb +38 -0
  30. data/lib/metanorma/iso/sts/transformer/front_transformer.rb +56 -0
  31. data/lib/metanorma/iso/sts/transformer/id_generator.rb +181 -0
  32. data/lib/metanorma/iso/sts/transformer/inline_transformer.rb +293 -0
  33. data/lib/metanorma/iso/sts/transformer/iso_meta_transformer.rb +374 -0
  34. data/lib/metanorma/iso/sts/transformer/list_transformer.rb +65 -0
  35. data/lib/metanorma/iso/sts/transformer/nbsp_processor.rb +43 -0
  36. data/lib/metanorma/iso/sts/transformer/note_transformer.rb +43 -0
  37. data/lib/metanorma/iso/sts/transformer/paragraph_transformer.rb +28 -0
  38. data/lib/metanorma/iso/sts/transformer/quote_transformer.rb +17 -0
  39. data/lib/metanorma/iso/sts/transformer/reference_transformer.rb +136 -0
  40. data/lib/metanorma/iso/sts/transformer/section_transformer.rb +102 -0
  41. data/lib/metanorma/iso/sts/transformer/sourcecode_transformer.rb +18 -0
  42. data/lib/metanorma/iso/sts/transformer/standard.rb +33 -0
  43. data/lib/metanorma/iso/sts/transformer/table_transformer.rb +99 -0
  44. data/lib/metanorma/iso/sts/transformer/term_transformer.rb +227 -0
  45. data/lib/metanorma/iso/sts/transformer.rb +52 -0
  46. data/lib/metanorma/iso/sts.rb +38 -0
  47. data/lib/metanorma/iso/version.rb +1 -1
  48. data/lib/metanorma-iso.rb +1 -0
  49. data/metanorma-iso.gemspec +2 -0
  50. metadata +63 -7
  51. data/.hound.yml +0 -5
  52. data/lib/metanorma/iso/mathml3-common.rng +0 -257
  53. data/lib/metanorma/iso/mathml3.rng +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0af54faafa49b9a295ffdbe60b9ab015f6a097bf130283dbfb043fb96be24714
4
- data.tar.gz: 0f882ef90048ea6f2dad7aacc0ec647561be2d767a463488986f300521bd10e5
3
+ metadata.gz: 0d0ba1cf92d2fdda919d052eca80c7390d433ec3ca8846691b0d873167b8f201
4
+ data.tar.gz: 62fe9ac86defc396612e7ebbd6be246b2ff2eb7a31962a801f83e7d6ea94a20b
5
5
  SHA512:
6
- metadata.gz: 9f4904edaadda14223f80d4da1e88cf1b436f8dc78b988ef7e515774e81ca8cffecf2dfb4a7fba0cebbb8971d5a0bd0ff815b993fef3a613c5523ccce2ccfa3e
7
- data.tar.gz: cc9b504554654940a3eccd7be06cf8bfe89dfa866354faa443f22e4020cedfbf85dbd60312dddda87b831306e611caa45c71f234c5a4fa150c448a5cb51c24c1
6
+ metadata.gz: '0529aff473717fe20ae265bf436938f69b6d7f0bdbdc3c548f2ad99238d036eac9ba16fa195d7318ba85eb22a20b0fff9d1fd86cd833236c8748214591dbede6'
7
+ data.tar.gz: 8034436590df5ac775e87eb42b50e7d9968b5ab01472a56c5a65c2721d901571cdf57320d27bd1e23e39ca36cc55d8f63d32cf42369c754f1d76a3bd0ce525b8
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
  }
@@ -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
  }
@@ -3835,7 +3835,7 @@
3835
3835
  <fo:block-container>
3836
3836
  <!-- List of Tables -->
3837
3837
  <xsl:call-template name="insertListOf_Title">
3838
- <xsl:with-param name="title" select="$title-list-tables"/>
3838
+ <xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-tables"/>
3839
3839
  </xsl:call-template>
3840
3840
  <fo:block role="TOC">
3841
3841
  <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:tables/mnx:table">
@@ -3849,7 +3849,7 @@
3849
3849
  <fo:block-container>
3850
3850
  <!-- List of Figures -->
3851
3851
  <xsl:call-template name="insertListOf_Title">
3852
- <xsl:with-param name="title" select="$title-list-figures"/>
3852
+ <xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-figures"/>
3853
3853
  </xsl:call-template>
3854
3854
  <fo:block role="TOC">
3855
3855
  <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:figures/mnx:figure">
@@ -3863,7 +3863,7 @@
3863
3863
  <fo:block-container>
3864
3864
  <!-- List of Examples -->
3865
3865
  <xsl:call-template name="insertListOf_Title">
3866
- <xsl:with-param name="title" select="$title-list-examples"/>
3866
+ <xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-examples"/>
3867
3867
  </xsl:call-template>
3868
3868
  <fo:block role="TOC">
3869
3869
  <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:examples/mnx:example">
@@ -3949,7 +3949,11 @@
3949
3949
  <xsl:call-template name="setAltText">
3950
3950
  <xsl:with-param name="value" select="@alt-text"/>
3951
3951
  </xsl:call-template>
3952
- <xsl:apply-templates select="." mode="contents"/>
3952
+ <xsl:variable name="item">
3953
+ <!-- mnx:table/mn:fmt-name, mnx:figure/mn:fmt-name, mnx:example/mn:fmt-name -->
3954
+ <xsl:apply-templates select="mn:fmt-name" mode="contents_item"/>
3955
+ </xsl:variable>
3956
+ <xsl:apply-templates select="xalan:nodeset($item)/node()"/>
3953
3957
  <fo:inline keep-together.within-line="always" role="SKIP">
3954
3958
  <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
3955
3959
  <fo:inline role="SKIP"><fo:page-number-citation ref-id="{@id}" role="SKIP"/></fo:inline>
@@ -6282,34 +6286,42 @@
6282
6286
  <xsl:call-template name="getVariable"><xsl:with-param name="variable">isAuthorOrganizationAbbreviationISO</xsl:with-param></xsl:call-template>
6283
6287
  </xsl:variable>
6284
6288
 
6285
- <xsl:if test="$layoutVersion = '1951'">
6286
- <xsl:attribute name="font-size">10pt</xsl:attribute>
6287
- <xsl:if test="$revision_date_num &gt;= 19680101">
6288
- <xsl:attribute name="font-size">9pt</xsl:attribute>
6289
- </xsl:if>
6290
- </xsl:if>
6289
+ <xsl:variable name="style">
6290
+ <root-style>
6291
+ <xsl:if test="$layoutVersion = '1951'">
6292
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
6293
+ <xsl:if test="$revision_date_num &gt;= 19680101">
6294
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
6295
+ </xsl:if>
6296
+ </xsl:if>
6291
6297
 
6292
- <xsl:if test="$layoutVersion = '1972' or $layoutVersion = '1979'">
6293
- <xsl:attribute name="font-family">Univers, Times New Roman, Cambria Math, <xsl:value-of select="$font_noto_sans"/></xsl:attribute>
6294
- <xsl:attribute name="font-family-generic">Sans</xsl:attribute>
6295
- <xsl:attribute name="font-size">10pt</xsl:attribute>
6296
- <xsl:if test="$layout_columns = 2">
6297
- <xsl:attribute name="font-size">9pt</xsl:attribute>
6298
- </xsl:if>
6299
- </xsl:if>
6300
- <xsl:if test="$layoutVersion = '1987' or $layoutVersion = '1989'">
6301
- <xsl:attribute name="font-family">Arial, Times New Roman, Cambria Math, <xsl:value-of select="$font_noto_sans"/></xsl:attribute>
6302
- <xsl:attribute name="font-family-generic">Sans</xsl:attribute>
6303
- <xsl:attribute name="font-size">10pt</xsl:attribute>
6304
- </xsl:if>
6298
+ <xsl:if test="$layoutVersion = '1972' or $layoutVersion = '1979'">
6299
+ <xsl:attribute name="font-family">Univers, Times New Roman, Cambria Math, <xsl:value-of select="$font_noto_sans"/></xsl:attribute>
6300
+ <xsl:attribute name="font-family-generic">Sans</xsl:attribute>
6301
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
6302
+ <xsl:if test="$layout_columns = 2">
6303
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
6304
+ </xsl:if>
6305
+ </xsl:if>
6306
+ <xsl:if test="$layoutVersion = '1987' or $layoutVersion = '1989'">
6307
+ <xsl:attribute name="font-family">Arial, Times New Roman, Cambria Math, <xsl:value-of select="$font_noto_sans"/></xsl:attribute>
6308
+ <xsl:attribute name="font-family-generic">Sans</xsl:attribute>
6309
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
6310
+ </xsl:if>
6305
6311
 
6306
- <xsl:if test="(($layoutVersion = '1987' and $doctype = 'technical-report') or ($layoutVersion = '1979' and $doctype = 'addendum'))">
6307
- <xsl:attribute name="font-size">8.5pt</xsl:attribute>
6308
- </xsl:if>
6312
+ <xsl:if test="(($layoutVersion = '1987' and $doctype = 'technical-report') or ($layoutVersion = '1979' and $doctype = 'addendum'))">
6313
+ <xsl:attribute name="font-size">8.5pt</xsl:attribute>
6314
+ </xsl:if>
6309
6315
 
6310
- <xsl:if test="$layoutVersion = '2024' and $isAuthorOrganizationAbbreviationISO = 'true'">
6311
- <xsl:attribute name="color">rgb(35,31,32)</xsl:attribute>
6312
- </xsl:if>
6316
+ <xsl:if test="$layoutVersion = '2024' and $isAuthorOrganizationAbbreviationISO = 'true'">
6317
+ <xsl:attribute name="color">rgb(35,31,32)</xsl:attribute>
6318
+ </xsl:if>
6319
+ </root-style>
6320
+ </xsl:variable>
6321
+
6322
+ <xsl:call-template name="insertRootStyle">
6323
+ <xsl:with-param name="root-style" select="$style"/>
6324
+ </xsl:call-template>
6313
6325
 
6314
6326
  </xsl:template>
6315
6327
 
@@ -6457,45 +6469,59 @@
6457
6469
 
6458
6470
  <xsl:variable name="ace_tag">ace-tag_</xsl:variable>
6459
6471
 
6460
- <xsl:variable name="title-list-tables">
6461
- <xsl:variable name="toc_table_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title"/>
6462
- <xsl:value-of select="$toc_table_title"/>
6463
- <xsl:if test="normalize-space($toc_table_title) = ''">
6464
- <xsl:call-template name="getLocalizedString">
6465
- <xsl:with-param name="key">toc_tables</xsl:with-param>
6466
- </xsl:call-template>
6467
- </xsl:if>
6468
- </xsl:variable>
6472
+ <xsl:variable name="toc_title_lists_">
6473
+ <xsl:for-each select="//mn:metanorma">
6474
+ <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
6475
+ <xsl:variable name="docid"><xsl:call-template name="getDocumentId"/></xsl:variable>
6476
+ <xsl:variable name="current_document">
6477
+ <xsl:copy-of select="."/>
6478
+ </xsl:variable>
6479
+ <xsl:for-each select="xalan:nodeset($current_document)">
6480
+ <mnx:doc id="{$docid}" num="{$num}">
6481
+ <mnx:title-list-tables>
6482
+ <xsl:variable name="toc_table_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title"/>
6483
+ <xsl:value-of select="$toc_table_title"/>
6484
+ <xsl:if test="normalize-space($toc_table_title) = ''">
6485
+ <xsl:call-template name="getLocalizedString">
6486
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
6487
+ </xsl:call-template>
6488
+ </xsl:if>
6489
+ </mnx:title-list-tables>
6469
6490
 
6470
- <xsl:variable name="title-list-figures">
6471
- <xsl:variable name="toc_figure_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title"/>
6472
- <xsl:value-of select="$toc_figure_title"/>
6473
- <xsl:if test="normalize-space($toc_figure_title) = ''">
6474
- <xsl:call-template name="getLocalizedString">
6475
- <xsl:with-param name="key">toc_figures</xsl:with-param>
6476
- </xsl:call-template>
6477
- </xsl:if>
6478
- </xsl:variable>
6491
+ <mnx:title-list-figures>
6492
+ <xsl:variable name="toc_figure_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title"/>
6493
+ <xsl:value-of select="$toc_figure_title"/>
6494
+ <xsl:if test="normalize-space($toc_figure_title) = ''">
6495
+ <xsl:call-template name="getLocalizedString">
6496
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
6497
+ </xsl:call-template>
6498
+ </xsl:if>
6499
+ </mnx:title-list-figures>
6479
6500
 
6480
- <xsl:variable name="title-list-examples">
6481
- <xsl:variable name="toc_example_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title"/>
6482
- <xsl:value-of select="$toc_example_title"/>
6483
- <xsl:if test="normalize-space($toc_example_title) = ''">
6484
- <xsl:call-template name="getLocalizedString">
6485
- <xsl:with-param name="key">toc_examples</xsl:with-param>
6486
- </xsl:call-template>
6487
- </xsl:if>
6488
- </xsl:variable>
6501
+ <mnx:title-list-examples>
6502
+ <xsl:variable name="toc_example_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title"/>
6503
+ <xsl:value-of select="$toc_example_title"/>
6504
+ <xsl:if test="normalize-space($toc_example_title) = ''">
6505
+ <xsl:call-template name="getLocalizedString">
6506
+ <xsl:with-param name="key">toc_examples</xsl:with-param>
6507
+ </xsl:call-template>
6508
+ </xsl:if>
6509
+ </mnx:title-list-examples>
6489
6510
 
6490
- <xsl:variable name="title-list-recommendations">
6491
- <xsl:variable name="toc_requirement_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='requirement']/mn:title"/>
6492
- <xsl:value-of select="$toc_requirement_title"/>
6493
- <xsl:if test="normalize-space($toc_requirement_title) = ''">
6494
- <xsl:call-template name="getLocalizedString">
6495
- <xsl:with-param name="key">toc_recommendations</xsl:with-param>
6496
- </xsl:call-template>
6497
- </xsl:if>
6511
+ <mnx:title-list-recommendations>
6512
+ <xsl:variable name="toc_requirement_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='requirement']/mn:title"/>
6513
+ <xsl:value-of select="$toc_requirement_title"/>
6514
+ <xsl:if test="normalize-space($toc_requirement_title) = ''">
6515
+ <xsl:call-template name="getLocalizedString">
6516
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
6517
+ </xsl:call-template>
6518
+ </xsl:if>
6519
+ </mnx:title-list-recommendations>
6520
+ </mnx:doc>
6521
+ </xsl:for-each>
6522
+ </xsl:for-each>
6498
6523
  </xsl:variable>
6524
+ <xsl:variable name="toc_title_lists" select="xalan:nodeset($toc_title_lists_)"/>
6499
6525
 
6500
6526
  <xsl:variable name="bibdata">
6501
6527
  <xsl:copy-of select="//mn:metanorma/mn:bibdata"/>
@@ -7305,7 +7331,7 @@
7305
7331
  <xsl:apply-templates mode="update_xml_step1"/>
7306
7332
  </xsl:template>
7307
7333
 
7308
- <xsl:template match="mn:semx" mode="update_xml_step1">
7334
+ <xsl:template match="mn:semx[not(@element = 'name')]" mode="update_xml_step1">
7309
7335
  <xsl:apply-templates mode="update_xml_step1"/>
7310
7336
  </xsl:template>
7311
7337
 
@@ -7691,7 +7717,7 @@
7691
7717
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
7692
7718
  <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>
7693
7719
 
7694
- <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">
7720
+ <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">
7695
7721
 
7696
7722
  <xsl:variable name="parent" select="local-name(..)"/>
7697
7723
 
@@ -7737,7 +7763,7 @@
7737
7763
  <xsl:variable name="text">
7738
7764
  <xsl:element name="text" namespace="{$namespace_full}">
7739
7765
  <xsl:choose>
7740
- <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 -->
7766
+ <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 -->
7741
7767
  <xsl:otherwise>
7742
7768
  <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))"/>
7743
7769
  <!-- <xsl:value-of select="$text__"/> -->
@@ -7832,6 +7858,10 @@
7832
7858
  <xsl:copy-of select="."/>
7833
7859
  </xsl:template>
7834
7860
 
7861
+ <xsl:template match="mn:semx" mode="update_xml_enclose_keep-together_within-line">
7862
+ <xsl:apply-templates mode="update_xml_enclose_keep-together_within-line"/>
7863
+ </xsl:template>
7864
+
7835
7865
  <xsl:template name="replace_text_tags">
7836
7866
  <xsl:param name="tag_open"/>
7837
7867
  <xsl:param name="tag_close"/>
@@ -15539,6 +15569,7 @@
15539
15569
  <xsl:variable name="svg_content">
15540
15570
  <xsl:apply-templates select="." mode="svg_update"/>
15541
15571
  </xsl:variable>
15572
+ <!-- <svg_content><xsl:copy-of select="$svg_content"/></svg_content> -->
15542
15573
 
15543
15574
  <xsl:variable name="alt-text">
15544
15575
  <xsl:choose>
@@ -15753,7 +15784,7 @@
15753
15784
  </xsl:copy>
15754
15785
  </xsl:template>
15755
15786
 
15756
- <xsl:template match="mn:image/@href" mode="svg_update">
15787
+ <xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
15757
15788
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
15758
15789
  <xsl:value-of select="."/>
15759
15790
  </xsl:attribute>
@@ -18512,13 +18543,13 @@
18512
18543
 
18513
18544
  <xsl:template name="processTablesFigures_Contents">
18514
18545
  <xsl:param name="always"/>
18515
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
18546
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
18516
18547
  <xsl:call-template name="processTables_Contents"/>
18517
18548
  </xsl:if>
18518
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
18549
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
18519
18550
  <xsl:call-template name="processFigures_Contents"/>
18520
18551
  </xsl:if>
18521
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title)">
18552
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title)">
18522
18553
  <xsl:call-template name="processExamples_Contents"/>
18523
18554
  </xsl:if>
18524
18555
  </xsl:template>
@@ -18569,22 +18600,22 @@
18569
18600
 
18570
18601
  <xsl:template name="processExamples_Contents">
18571
18602
  <mnx:examples>
18572
- <xsl:for-each select="//mn:example[@id and mn:fmt-name and not(@unnumbered = 'true') and normalize-space(@id) != '']">
18573
- <xsl:choose>
18574
- <xsl:when test="mn:fmt-name">
18575
- <xsl:variable name="fmt_name">
18576
- <xsl:apply-templates select="mn:fmt-name" mode="update_xml_step1"/>
18577
- </xsl:variable>
18578
- <mnx:example id="{@id}" alt-text="{normalize-space($fmt_name)}">
18579
- <xsl:copy-of select="$fmt_name"/>
18580
- </mnx:example>
18581
- </xsl:when>
18582
- <xsl:otherwise>
18583
- <mnx:example id="{@id}" alt-text="{mn:name}">
18584
- <xsl:copy-of select="mn:name"/>
18585
- </mnx:example>
18586
- </xsl:otherwise>
18587
- </xsl:choose>
18603
+ <xsl:for-each select="//mn:example[@id and mn:fmt-name and normalize-space(@id) != '']">
18604
+ <!-- https://github.com/metanorma/metanorma-pdfa/issues/32#issuecomment-4929133938:
18605
+ //example/fmt-xref-label[@container] + //example/fmt-name/span[@class = 'fmt-caption-delim'] + //example/name,
18606
+ with the last two elements dropped if //example/name does not exist. -->
18607
+ <xsl:variable name="example_name">
18608
+ <xsl:apply-templates select="mn:name/node()" mode="update_xml_step1"/>
18609
+ </xsl:variable>
18610
+ <mnx:example id="{@id}" alt-text="{normalize-space($example_name)}">
18611
+ <xsl:element name="fmt-name" namespace="{$namespace_full}">
18612
+ <xsl:value-of select="mn:fmt-xref-label[@container]"/>
18613
+ <xsl:if test="normalize-space($example_name) != ''">
18614
+ <xsl:value-of select="mn:fmt-name/mn:span[@class = 'fmt-caption-delim']"/>
18615
+ <xsl:copy-of select="$example_name"/>
18616
+ </xsl:if>
18617
+ </xsl:element>
18618
+ </mnx:example>
18588
18619
  </xsl:for-each>
18589
18620
  </mnx:examples>
18590
18621
  </xsl:template>
@@ -18857,15 +18888,18 @@
18857
18888
 
18858
18889
  <xsl:call-template name="insertFigureBookmarks">
18859
18890
  <xsl:with-param name="contents" select="mnx:contents"/>
18891
+ <xsl:with-param name="num" select="@num"/>
18860
18892
  </xsl:call-template>
18861
18893
 
18862
18894
  <xsl:call-template name="insertTableBookmarks">
18863
18895
  <xsl:with-param name="contents" select="mnx:contents"/>
18896
+ <xsl:with-param name="num" select="@num"/>
18864
18897
  <xsl:with-param name="lang" select="@lang"/>
18865
18898
  </xsl:call-template>
18866
18899
 
18867
18900
  <xsl:call-template name="insertExampleBookmarks">
18868
18901
  <xsl:with-param name="contents" select="mnx:contents"/>
18902
+ <xsl:with-param name="num" select="@num"/>
18869
18903
  <xsl:with-param name="lang" select="@lang"/>
18870
18904
  </xsl:call-template>
18871
18905
 
@@ -18880,15 +18914,18 @@
18880
18914
 
18881
18915
  <xsl:call-template name="insertFigureBookmarks">
18882
18916
  <xsl:with-param name="contents" select="mnx:contents"/>
18917
+ <xsl:with-param name="num" select="@num"/>
18883
18918
  </xsl:call-template>
18884
18919
 
18885
18920
  <xsl:call-template name="insertTableBookmarks">
18886
18921
  <xsl:with-param name="contents" select="mnx:contents"/>
18922
+ <xsl:with-param name="num" select="@num"/>
18887
18923
  <xsl:with-param name="lang" select="@lang"/>
18888
18924
  </xsl:call-template>
18889
18925
 
18890
18926
  <xsl:call-template name="insertExampleBookmarks">
18891
18927
  <xsl:with-param name="contents" select="mnx:contents"/>
18928
+ <xsl:with-param name="num" select="@num"/>
18892
18929
  <xsl:with-param name="lang" select="@lang"/>
18893
18930
  </xsl:call-template>
18894
18931
 
@@ -18901,15 +18938,18 @@
18901
18938
 
18902
18939
  <xsl:call-template name="insertFigureBookmarks">
18903
18940
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
18941
+ <xsl:with-param name="num" select="@num"/>
18904
18942
  </xsl:call-template>
18905
18943
 
18906
18944
  <xsl:call-template name="insertTableBookmarks">
18907
18945
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
18946
+ <xsl:with-param name="num" select="@num"/>
18908
18947
  <xsl:with-param name="lang" select="@lang"/>
18909
18948
  </xsl:call-template>
18910
18949
 
18911
18950
  <xsl:call-template name="insertExampleBookmarks">
18912
18951
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
18952
+ <xsl:with-param name="num" select="@num"/>
18913
18953
  <xsl:with-param name="lang" select="@lang"/>
18914
18954
  </xsl:call-template>
18915
18955
 
@@ -18925,6 +18965,7 @@
18925
18965
 
18926
18966
  <xsl:template name="insertFigureBookmarks">
18927
18967
  <xsl:param name="contents"/>
18968
+ <xsl:param name="num"/>
18928
18969
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
18929
18970
  <xsl:if test="$contents_nodes/mnx:figure">
18930
18971
  <fo:bookmark internal-destination="{$contents_nodes/mnx:figure[1]/@id}" starting-state="hide">
@@ -18942,7 +18983,7 @@
18942
18983
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
18943
18984
 
18944
18985
  <xsl:variable name="bookmark-title">
18945
- <xsl:value-of select="$title-list-figures"/>
18986
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-figures"/>
18946
18987
  </xsl:variable>
18947
18988
  <fo:bookmark-title><xsl:value-of select="normalize-space($bookmark-title)"/></fo:bookmark-title>
18948
18989
  <xsl:for-each select="$contents_nodes//mnx:figures/mnx:figure">
@@ -18956,6 +18997,7 @@
18956
18997
 
18957
18998
  <xsl:template name="insertTableBookmarks">
18958
18999
  <xsl:param name="contents"/>
19000
+ <xsl:param name="num"/>
18959
19001
  <xsl:param name="lang"/>
18960
19002
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
18961
19003
  <xsl:if test="$contents_nodes/mnx:table">
@@ -18979,7 +19021,7 @@
18979
19021
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
18980
19022
 
18981
19023
  <xsl:variable name="bookmark-title">
18982
- <xsl:value-of select="$title-list-tables"/>
19024
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-tables"/>
18983
19025
  </xsl:variable>
18984
19026
 
18985
19027
  <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
@@ -18994,8 +19036,9 @@
18994
19036
  </xsl:if>
18995
19037
  </xsl:template> <!-- insertTableBookmarks -->
18996
19038
 
18997
- <xsl:template name="insertExampleBookmarks">
19039
+ <xsl:template name="insertExampleBookmarks">
18998
19040
  <xsl:param name="contents"/>
19041
+ <xsl:param name="num"/>
18999
19042
  <xsl:param name="lang"/>
19000
19043
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
19001
19044
  <xsl:if test="$contents_nodes/mnx:example">
@@ -19019,7 +19062,7 @@
19019
19062
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
19020
19063
 
19021
19064
  <xsl:variable name="bookmark-title">
19022
- <xsl:value-of select="$title-list-examples"/>
19065
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-examples"/>
19023
19066
  </xsl:variable>
19024
19067
 
19025
19068
  <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
@@ -19180,6 +19223,18 @@
19180
19223
  </xsl:copy>
19181
19224
  </xsl:template>
19182
19225
 
19226
+ <xsl:template match="mn:tt" mode="contents_item">
19227
+ <xsl:copy>
19228
+ <xsl:apply-templates mode="contents_item"/>
19229
+ </xsl:copy>
19230
+ </xsl:template>
19231
+
19232
+ <xsl:template match="*[local-name() = 'keep-together_within-line']" mode="contents_item">
19233
+ <xsl:copy>
19234
+ <xsl:apply-templates mode="contents_item"/>
19235
+ </xsl:copy>
19236
+ </xsl:template>
19237
+
19183
19238
  <xsl:template match="mn:stem" mode="contents_item"/>
19184
19239
  <xsl:template match="mn:fmt-stem" mode="contents_item">
19185
19240
  <xsl:copy-of select="."/>