metanorma-ogc 2.9.9 → 2.9.10

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: 142079bd041b8a880cfb119263cc299b80dcb1caa59656447848113cb67dfd92
4
- data.tar.gz: '092ca544076a820250f758b93918f734cb555ac2bf7ec98abe9caaa45f8e7b41'
3
+ metadata.gz: e08e7cb459d12485f89db319854ae6a94bac1abad1d52f7ba1ed7e3597c32745
4
+ data.tar.gz: 4f61478dec1ec9b00be6ca94caeb43fbf08f3de93e514b76a5307c712f4d824a
5
5
  SHA512:
6
- metadata.gz: 3041ccc81ac6053f9010e9fab4788da0a199980ebd0e3fab6be800c51b0d2153df7386af5eb1ec7730835dfc705425fa4a297b90d6d1bf1e6cc1ec34fffb11f6
7
- data.tar.gz: 8a2e8df76396229db1556271de5fc752910e31cd56057b8e20ea71aca003bc4e388956cced0b7b6a46b2f2aa1bf42b2a4ead63affaff86c4bd9f3f99becf22e2
6
+ metadata.gz: 9a1cb4bcb4e5fb52a1b5c14eb6b4068980f12c59e9fd147dc9b66cdc66c4ab55e3a637a1a814711b6ec04c9a48bdd6b966b043a19b149fc2367122c313957350
7
+ data.tar.gz: 78e3ca0324082f56c695e00680c308df4898701727f0ddbe54f73b59fb7e0c17cbc8cb3bb1562fd57c2e6539c62d1ac491df6481f8defa5c72d8d316e0b31673
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
@@ -52,6 +52,8 @@
52
52
  <span class="label">Submission Date: </span> <span class="value">{{ receiveddate }}</span>
53
53
  <span class="label">Approval Date: </span> <span class="value">{{ issueddate }}</span>
54
54
  <span class="label">Publication Date: </span> <span class="value">{{ publisheddate }}</span>
55
+ {% assign doi = bibdata.docidentifier | where: "type", "DOI" | first %}
56
+ {% if doi %}<span class="label">DOI: <span class="docnumber value">{{ doi.content }}</span></span>{% endif %}
55
57
  <span class="label">External identifier of this OGC® document: <span class="docnumber value">{{ externalid }}</span></span>
56
58
  <span class="label">Internal identifier of this OGC® document: <span class="docnumber value">{{ docnumber }}</span></span>
57
59
  {% if url or html %}
@@ -143,6 +143,11 @@ a.FootnoteRef, span.FootnoteRef {
143
143
  vertical-align: super;
144
144
  }
145
145
 
146
+ a.TableFootnoteRef, a.FootnoteRef, a.footnote-number,
147
+ sup a, a:has(> sup) {
148
+ vertical-align: baseline;
149
+ }
150
+
146
151
  .addition {
147
152
  color: blue;
148
153
  }
@@ -196,7 +196,7 @@
196
196
  <xsl:for-each select="xalan:nodeset($current_document)">
197
197
  <mnx:doc num="{$num}">
198
198
 
199
- <xsl:if test="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='recommendation']/mn:title">
199
+ <xsl:if test="//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='recommendation']/mn:title">
200
200
  <xsl:for-each select="//mn:table[.//mn:p[@class = 'RecommendationTitle']]">
201
201
  <xsl:variable name="table_id" select="@id"/>
202
202
  <recommendation alt-text="{.//mn:p[@class = 'RecommendationTitle'][1]}">
@@ -372,7 +372,7 @@
372
372
  <xsl:if test="$contents//mnx:tables/mnx:table">
373
373
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
374
374
  <fo:bookmark-title>
375
- <xsl:value-of select="$title-list-tables"/>
375
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = 1]/mnx:title-list-tables"/>
376
376
  </fo:bookmark-title>
377
377
  <xsl:for-each select="$contents//mnx:tables/mnx:table">
378
378
  <fo:bookmark internal-destination="{@id}">
@@ -388,7 +388,7 @@
388
388
  <xsl:if test="$contents//mnx:figures/mnx:figure">
389
389
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
390
390
  <fo:bookmark-title>
391
- <xsl:value-of select="$title-list-figures"/>
391
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = 1]/mnx:title-list-figures"/>
392
392
  </fo:bookmark-title>
393
393
  <xsl:for-each select="$contents//mnx:figures/mnx:figure">
394
394
  <fo:bookmark internal-destination="{@id}">
@@ -404,7 +404,7 @@
404
404
  <xsl:if test="$contents//mnx:examples/mnx:example">
405
405
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
406
406
  <fo:bookmark-title>
407
- <xsl:value-of select="$title-list-examples"/>
407
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = 1]/mnx:title-list-examples"/>
408
408
  </fo:bookmark-title>
409
409
  <xsl:for-each select="$contents//mnx:examples/mnx:example">
410
410
  <fo:bookmark internal-destination="{@id}">
@@ -420,7 +420,7 @@
420
420
  <xsl:if test="$toc_recommendations//*[normalize-space(@id) != '']">
421
421
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
422
422
  <fo:bookmark-title>
423
- <xsl:value-of select="$title-list-recommendations"/>
423
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = 1]/mnx:title-list-recommendations"/>
424
424
  </fo:bookmark-title>
425
425
  <xsl:for-each select="$toc_recommendations//*[normalize-space(@id) != '']">
426
426
  <fo:bookmark internal-destination="{@id}">
@@ -977,7 +977,11 @@
977
977
  <xsl:with-param name="value" select="@alt-text"/>
978
978
  </xsl:call-template>
979
979
  <!-- <xsl:copy-of select="node()"/> -->
980
- <xsl:apply-templates select="." mode="contents"/>
980
+ <xsl:variable name="item">
981
+ <!-- mnx:table/mn:fmt-name, mnx:figure/mn:fmt-name, mnx:example/mn:fmt-name -->
982
+ <xsl:apply-templates select="mn:fmt-name" mode="contents_item"/>
983
+ </xsl:variable>
984
+ <xsl:apply-templates select="xalan:nodeset($item)/node()"/>
981
985
  <fo:inline keep-together.within-line="always">
982
986
  <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
983
987
  <fo:page-number-citation ref-id="{@id}"/>
@@ -1073,7 +1077,7 @@
1073
1077
  <!-- List of Tables -->
1074
1078
  <xsl:if test="$contents/mnx:doc[@num = $num]//mnx:tables/mnx:table">
1075
1079
  <xsl:call-template name="insertListOf_Title">
1076
- <xsl:with-param name="title" select="$title-list-tables"/>
1080
+ <xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-tables"/>
1077
1081
  </xsl:call-template>
1078
1082
  <fo:block-container line-height="130%" role="TOC">
1079
1083
  <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:tables/mnx:table">
@@ -1085,7 +1089,7 @@
1085
1089
  <!-- List of Figures -->
1086
1090
  <xsl:if test="$contents/mnx:doc[@num = $num]//mnx:figures/mnx:figure">
1087
1091
  <xsl:call-template name="insertListOf_Title">
1088
- <xsl:with-param name="title" select="$title-list-figures"/>
1092
+ <xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-figures"/>
1089
1093
  </xsl:call-template>
1090
1094
  <fo:block-container line-height="130%" role="TOC">
1091
1095
  <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:figures/mnx:figure">
@@ -1097,7 +1101,7 @@
1097
1101
  <!-- List of Examples -->
1098
1102
  <xsl:if test="$contents/mnx:doc[@num = $num]//mnx:examples/mnx:example">
1099
1103
  <xsl:call-template name="insertListOf_Title">
1100
- <xsl:with-param name="title" select="$title-list-examples"/>
1104
+ <xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-examples"/>
1101
1105
  </xsl:call-template>
1102
1106
  <fo:block-container line-height="130%" role="TOC">
1103
1107
  <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:examples/mnx:example">
@@ -1111,7 +1115,7 @@
1111
1115
  <!-- List of Recommendations -->
1112
1116
  <xsl:if test="$toc_recommendations/mnx:doc[@num = $num]/*[normalize-space(@id) != '']">
1113
1117
  <xsl:call-template name="insertListOf_Title">
1114
- <xsl:with-param name="title" select="$title-list-recommendations"/>
1118
+ <xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-recommendations"/>
1115
1119
  </xsl:call-template>
1116
1120
  <fo:block-container line-height="130%" role="TOC">
1117
1121
  <xsl:for-each select="$toc_recommendations/mnx:doc[@num = $num]/*[normalize-space(@id) != '']">
@@ -2310,45 +2314,59 @@
2310
2314
 
2311
2315
  <xsl:variable name="ace_tag">ace-tag_</xsl:variable>
2312
2316
 
2313
- <xsl:variable name="title-list-tables">
2314
- <xsl:variable name="toc_table_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title"/>
2315
- <xsl:value-of select="$toc_table_title"/>
2316
- <xsl:if test="normalize-space($toc_table_title) = ''">
2317
- <xsl:call-template name="getLocalizedString">
2318
- <xsl:with-param name="key">toc_tables</xsl:with-param>
2319
- </xsl:call-template>
2320
- </xsl:if>
2321
- </xsl:variable>
2317
+ <xsl:variable name="toc_title_lists_">
2318
+ <xsl:for-each select="//mn:metanorma">
2319
+ <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
2320
+ <xsl:variable name="docid"><xsl:call-template name="getDocumentId"/></xsl:variable>
2321
+ <xsl:variable name="current_document">
2322
+ <xsl:copy-of select="."/>
2323
+ </xsl:variable>
2324
+ <xsl:for-each select="xalan:nodeset($current_document)">
2325
+ <mnx:doc id="{$docid}" num="{$num}">
2326
+ <mnx:title-list-tables>
2327
+ <xsl:variable name="toc_table_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title"/>
2328
+ <xsl:value-of select="$toc_table_title"/>
2329
+ <xsl:if test="normalize-space($toc_table_title) = ''">
2330
+ <xsl:call-template name="getLocalizedString">
2331
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
2332
+ </xsl:call-template>
2333
+ </xsl:if>
2334
+ </mnx:title-list-tables>
2322
2335
 
2323
- <xsl:variable name="title-list-figures">
2324
- <xsl:variable name="toc_figure_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title"/>
2325
- <xsl:value-of select="$toc_figure_title"/>
2326
- <xsl:if test="normalize-space($toc_figure_title) = ''">
2327
- <xsl:call-template name="getLocalizedString">
2328
- <xsl:with-param name="key">toc_figures</xsl:with-param>
2329
- </xsl:call-template>
2330
- </xsl:if>
2331
- </xsl:variable>
2336
+ <mnx:title-list-figures>
2337
+ <xsl:variable name="toc_figure_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title"/>
2338
+ <xsl:value-of select="$toc_figure_title"/>
2339
+ <xsl:if test="normalize-space($toc_figure_title) = ''">
2340
+ <xsl:call-template name="getLocalizedString">
2341
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
2342
+ </xsl:call-template>
2343
+ </xsl:if>
2344
+ </mnx:title-list-figures>
2332
2345
 
2333
- <xsl:variable name="title-list-examples">
2334
- <xsl:variable name="toc_example_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title"/>
2335
- <xsl:value-of select="$toc_example_title"/>
2336
- <xsl:if test="normalize-space($toc_example_title) = ''">
2337
- <xsl:call-template name="getLocalizedString">
2338
- <xsl:with-param name="key">toc_examples</xsl:with-param>
2339
- </xsl:call-template>
2340
- </xsl:if>
2341
- </xsl:variable>
2346
+ <mnx:title-list-examples>
2347
+ <xsl:variable name="toc_example_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title"/>
2348
+ <xsl:value-of select="$toc_example_title"/>
2349
+ <xsl:if test="normalize-space($toc_example_title) = ''">
2350
+ <xsl:call-template name="getLocalizedString">
2351
+ <xsl:with-param name="key">toc_examples</xsl:with-param>
2352
+ </xsl:call-template>
2353
+ </xsl:if>
2354
+ </mnx:title-list-examples>
2342
2355
 
2343
- <xsl:variable name="title-list-recommendations">
2344
- <xsl:variable name="toc_requirement_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='requirement']/mn:title"/>
2345
- <xsl:value-of select="$toc_requirement_title"/>
2346
- <xsl:if test="normalize-space($toc_requirement_title) = ''">
2347
- <xsl:call-template name="getLocalizedString">
2348
- <xsl:with-param name="key">toc_recommendations</xsl:with-param>
2349
- </xsl:call-template>
2350
- </xsl:if>
2356
+ <mnx:title-list-recommendations>
2357
+ <xsl:variable name="toc_requirement_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='requirement']/mn:title"/>
2358
+ <xsl:value-of select="$toc_requirement_title"/>
2359
+ <xsl:if test="normalize-space($toc_requirement_title) = ''">
2360
+ <xsl:call-template name="getLocalizedString">
2361
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
2362
+ </xsl:call-template>
2363
+ </xsl:if>
2364
+ </mnx:title-list-recommendations>
2365
+ </mnx:doc>
2366
+ </xsl:for-each>
2367
+ </xsl:for-each>
2351
2368
  </xsl:variable>
2369
+ <xsl:variable name="toc_title_lists" select="xalan:nodeset($toc_title_lists_)"/>
2352
2370
 
2353
2371
  <xsl:variable name="bibdata">
2354
2372
  <xsl:copy-of select="//mn:metanorma/mn:bibdata"/>
@@ -3140,7 +3158,7 @@
3140
3158
  <xsl:apply-templates mode="update_xml_step1"/>
3141
3159
  </xsl:template>
3142
3160
 
3143
- <xsl:template match="mn:semx" mode="update_xml_step1">
3161
+ <xsl:template match="mn:semx[not(@element = 'name')]" mode="update_xml_step1">
3144
3162
  <xsl:apply-templates mode="update_xml_step1"/>
3145
3163
  </xsl:template>
3146
3164
 
@@ -3423,7 +3441,7 @@
3423
3441
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
3424
3442
  <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>
3425
3443
 
3426
- <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">
3444
+ <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">
3427
3445
 
3428
3446
  <xsl:variable name="parent" select="local-name(..)"/>
3429
3447
 
@@ -3468,7 +3486,7 @@
3468
3486
  <xsl:variable name="text">
3469
3487
  <xsl:element name="text" namespace="{$namespace_full}">
3470
3488
  <xsl:choose>
3471
- <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 -->
3489
+ <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 -->
3472
3490
  <xsl:otherwise>
3473
3491
  <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))"/>
3474
3492
  <!-- <xsl:value-of select="$text__"/> -->
@@ -3546,6 +3564,10 @@
3546
3564
  <xsl:copy-of select="."/>
3547
3565
  </xsl:template>
3548
3566
 
3567
+ <xsl:template match="mn:semx" mode="update_xml_enclose_keep-together_within-line">
3568
+ <xsl:apply-templates mode="update_xml_enclose_keep-together_within-line"/>
3569
+ </xsl:template>
3570
+
3549
3571
  <xsl:template name="replace_text_tags">
3550
3572
  <xsl:param name="tag_open"/>
3551
3573
  <xsl:param name="tag_close"/>
@@ -10983,6 +11005,7 @@
10983
11005
  <xsl:variable name="svg_content">
10984
11006
  <xsl:apply-templates select="." mode="svg_update"/>
10985
11007
  </xsl:variable>
11008
+ <!-- <svg_content><xsl:copy-of select="$svg_content"/></svg_content> -->
10986
11009
 
10987
11010
  <xsl:variable name="alt-text">
10988
11011
  <xsl:choose>
@@ -11197,7 +11220,7 @@
11197
11220
  </xsl:copy>
11198
11221
  </xsl:template>
11199
11222
 
11200
- <xsl:template match="mn:image/@href" mode="svg_update">
11223
+ <xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
11201
11224
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
11202
11225
  <xsl:value-of select="."/>
11203
11226
  </xsl:attribute>
@@ -13818,13 +13841,13 @@
13818
13841
 
13819
13842
  <xsl:template name="processTablesFigures_Contents">
13820
13843
  <xsl:param name="always"/>
13821
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
13844
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
13822
13845
  <xsl:call-template name="processTables_Contents"/>
13823
13846
  </xsl:if>
13824
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
13847
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
13825
13848
  <xsl:call-template name="processFigures_Contents"/>
13826
13849
  </xsl:if>
13827
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title)">
13850
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title)">
13828
13851
  <xsl:call-template name="processExamples_Contents"/>
13829
13852
  </xsl:if>
13830
13853
  </xsl:template>
@@ -13875,22 +13898,22 @@
13875
13898
 
13876
13899
  <xsl:template name="processExamples_Contents">
13877
13900
  <mnx:examples>
13878
- <xsl:for-each select="//mn:example[@id and mn:fmt-name and not(@unnumbered = 'true') and normalize-space(@id) != '']">
13879
- <xsl:choose>
13880
- <xsl:when test="mn:fmt-name">
13881
- <xsl:variable name="fmt_name">
13882
- <xsl:apply-templates select="mn:fmt-name" mode="update_xml_step1"/>
13883
- </xsl:variable>
13884
- <mnx:example id="{@id}" alt-text="{normalize-space($fmt_name)}">
13885
- <xsl:copy-of select="$fmt_name"/>
13886
- </mnx:example>
13887
- </xsl:when>
13888
- <xsl:otherwise>
13889
- <mnx:example id="{@id}" alt-text="{mn:name}">
13890
- <xsl:copy-of select="mn:name"/>
13891
- </mnx:example>
13892
- </xsl:otherwise>
13893
- </xsl:choose>
13901
+ <xsl:for-each select="//mn:example[@id and mn:fmt-name and normalize-space(@id) != '']">
13902
+ <!-- https://github.com/metanorma/metanorma-pdfa/issues/32#issuecomment-4929133938:
13903
+ //example/fmt-xref-label[@container] + //example/fmt-name/span[@class = 'fmt-caption-delim'] + //example/name,
13904
+ with the last two elements dropped if //example/name does not exist. -->
13905
+ <xsl:variable name="example_name">
13906
+ <xsl:apply-templates select="mn:name/node()" mode="update_xml_step1"/>
13907
+ </xsl:variable>
13908
+ <mnx:example id="{@id}" alt-text="{normalize-space($example_name)}">
13909
+ <xsl:element name="fmt-name" namespace="{$namespace_full}">
13910
+ <xsl:value-of select="mn:fmt-xref-label[@container]"/>
13911
+ <xsl:if test="normalize-space($example_name) != ''">
13912
+ <xsl:value-of select="mn:fmt-name/mn:span[@class = 'fmt-caption-delim']"/>
13913
+ <xsl:copy-of select="$example_name"/>
13914
+ </xsl:if>
13915
+ </xsl:element>
13916
+ </mnx:example>
13894
13917
  </xsl:for-each>
13895
13918
  </mnx:examples>
13896
13919
  </xsl:template>
@@ -14163,15 +14186,18 @@
14163
14186
 
14164
14187
  <xsl:call-template name="insertFigureBookmarks">
14165
14188
  <xsl:with-param name="contents" select="mnx:contents"/>
14189
+ <xsl:with-param name="num" select="@num"/>
14166
14190
  </xsl:call-template>
14167
14191
 
14168
14192
  <xsl:call-template name="insertTableBookmarks">
14169
14193
  <xsl:with-param name="contents" select="mnx:contents"/>
14194
+ <xsl:with-param name="num" select="@num"/>
14170
14195
  <xsl:with-param name="lang" select="@lang"/>
14171
14196
  </xsl:call-template>
14172
14197
 
14173
14198
  <xsl:call-template name="insertExampleBookmarks">
14174
14199
  <xsl:with-param name="contents" select="mnx:contents"/>
14200
+ <xsl:with-param name="num" select="@num"/>
14175
14201
  <xsl:with-param name="lang" select="@lang"/>
14176
14202
  </xsl:call-template>
14177
14203
 
@@ -14186,15 +14212,18 @@
14186
14212
 
14187
14213
  <xsl:call-template name="insertFigureBookmarks">
14188
14214
  <xsl:with-param name="contents" select="mnx:contents"/>
14215
+ <xsl:with-param name="num" select="@num"/>
14189
14216
  </xsl:call-template>
14190
14217
 
14191
14218
  <xsl:call-template name="insertTableBookmarks">
14192
14219
  <xsl:with-param name="contents" select="mnx:contents"/>
14220
+ <xsl:with-param name="num" select="@num"/>
14193
14221
  <xsl:with-param name="lang" select="@lang"/>
14194
14222
  </xsl:call-template>
14195
14223
 
14196
14224
  <xsl:call-template name="insertExampleBookmarks">
14197
14225
  <xsl:with-param name="contents" select="mnx:contents"/>
14226
+ <xsl:with-param name="num" select="@num"/>
14198
14227
  <xsl:with-param name="lang" select="@lang"/>
14199
14228
  </xsl:call-template>
14200
14229
 
@@ -14207,15 +14236,18 @@
14207
14236
 
14208
14237
  <xsl:call-template name="insertFigureBookmarks">
14209
14238
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
14239
+ <xsl:with-param name="num" select="@num"/>
14210
14240
  </xsl:call-template>
14211
14241
 
14212
14242
  <xsl:call-template name="insertTableBookmarks">
14213
14243
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
14244
+ <xsl:with-param name="num" select="@num"/>
14214
14245
  <xsl:with-param name="lang" select="@lang"/>
14215
14246
  </xsl:call-template>
14216
14247
 
14217
14248
  <xsl:call-template name="insertExampleBookmarks">
14218
14249
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
14250
+ <xsl:with-param name="num" select="@num"/>
14219
14251
  <xsl:with-param name="lang" select="@lang"/>
14220
14252
  </xsl:call-template>
14221
14253
 
@@ -14231,6 +14263,7 @@
14231
14263
 
14232
14264
  <xsl:template name="insertFigureBookmarks">
14233
14265
  <xsl:param name="contents"/>
14266
+ <xsl:param name="num"/>
14234
14267
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
14235
14268
  <xsl:if test="$contents_nodes/mnx:figure">
14236
14269
  <fo:bookmark internal-destination="{$contents_nodes/mnx:figure[1]/@id}" starting-state="hide">
@@ -14248,6 +14281,7 @@
14248
14281
 
14249
14282
  <xsl:template name="insertTableBookmarks">
14250
14283
  <xsl:param name="contents"/>
14284
+ <xsl:param name="num"/>
14251
14285
  <xsl:param name="lang"/>
14252
14286
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
14253
14287
  <xsl:if test="$contents_nodes/mnx:table">
@@ -14269,8 +14303,9 @@
14269
14303
  </xsl:if><!-- see template addBookmarks -->
14270
14304
  </xsl:template> <!-- insertTableBookmarks -->
14271
14305
 
14272
- <xsl:template name="insertExampleBookmarks">
14306
+ <xsl:template name="insertExampleBookmarks">
14273
14307
  <xsl:param name="contents"/>
14308
+ <xsl:param name="num"/>
14274
14309
  <xsl:param name="lang"/>
14275
14310
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
14276
14311
  <xsl:if test="$contents_nodes/mnx:example">
@@ -14438,6 +14473,18 @@
14438
14473
  </xsl:copy>
14439
14474
  </xsl:template>
14440
14475
 
14476
+ <xsl:template match="mn:tt" mode="contents_item">
14477
+ <xsl:copy>
14478
+ <xsl:apply-templates mode="contents_item"/>
14479
+ </xsl:copy>
14480
+ </xsl:template>
14481
+
14482
+ <xsl:template match="*[local-name() = 'keep-together_within-line']" mode="contents_item">
14483
+ <xsl:copy>
14484
+ <xsl:apply-templates mode="contents_item"/>
14485
+ </xsl:copy>
14486
+ </xsl:template>
14487
+
14441
14488
  <xsl:template match="mn:stem" mode="contents_item"/>
14442
14489
  <xsl:template match="mn:fmt-stem" mode="contents_item">
14443
14490
  <xsl:copy-of select="."/>