metanorma-taste 1.0.9 → 1.1.0

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: 6a3e9f97884e009d35840d3d18f05fdba70e00e188a61103a3ae7389adefde6c
4
- data.tar.gz: 4eb73ea8e02b601860f40be9feb1eb430d6f403fd6074cd074f498fc5ea0c146
3
+ metadata.gz: eca330c6ecac8898e33460d368b0305ee83b2f44f08182a389231122d5970d7b
4
+ data.tar.gz: d775c3b890c30c6270f3e650a03324900a3b0fadcd4c01ee0fb50d2e5be78e46
5
5
  SHA512:
6
- metadata.gz: 66bfb74954c81cfff671623f411ebb653622a0dff14b2698ecb84afea01ed7d4fafc2c09def624c5a5f10dda0b239cc1657cb7b5387891d30644cd8f6c6a04d0
7
- data.tar.gz: 65d92ed5ebb3d5766fe7e16e35ac0807280c55b513447dc0f73a822d788999272047a0adb9f497642cf4bf4be50aafddefe3bec947068bb396a387eee17fb499
6
+ metadata.gz: db98365c339648ba8c6c36dd693f8d22b3b97a3370768d16677457bbd190462fdc6923813509ea4749d2b60a801a3b3328ee28ca476df1336a4f9e7c1eb52801
7
+ data.tar.gz: d51259cd69eefc681da4867d946fe075c27bd150201150003d673d5052245fc10bb7fb93d34c874444bd0788ac22cf8e5cbca9151f9c618a2a1fe508cde58b9f
data/.rubocop.yml CHANGED
@@ -1,14 +1,31 @@
1
1
  # Auto-generated by Cimas: Do not edit it manually!
2
2
  # See https://github.com/metanorma/cimas
3
3
  inherit_from:
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.
4
13
  - .rubocop_todo.yml
5
- - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.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
6
22
 
7
23
  # local repo-specific modifications
8
24
  # ...
9
25
 
10
26
  AllCops:
11
- TargetRubyVersion: 3.1
12
-
13
- Lint/MissingSuper:
14
- AllowedParentClasses: [Liquid::Drop]
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
data/Create-Taste.adoc CHANGED
@@ -172,27 +172,34 @@ doctypes:
172
172
 
173
173
  ===== 5.2 Stage
174
174
 
175
- A limited number of tastes (CSA, PDFA) also provide a dictionary of stage values. Unlike the doctype, this does not map to the base flavor,
176
- but gives the listing of stages applicable to the taste. The dictionary is formatted as for `metanorma-generic`: it gives a hash
177
- of stage names, mapping optionally to standard stage abbreviations. Each stage may optionally have a boolean value given for whether it
178
- is the `default` stage applied to documents (legal for only one stage), and whether it constitutes a `published` stage (may apply to more
179
- than one stage). So CSA has the following stage dictionary:
175
+ A limited number of tastes (for example, PDFA) also provide a list of stage values. Like the doctype, each stage is a struct: a `taste` value,
176
+ for the taste's label of the stage, and a `base` value, for the corresponding stage in the base flavor to be used in processing. A stage may
177
+ optionally give an `abbrev` (its abbreviation), and the boolean values `default` (whether it is the default stage applied to documents, legal
178
+ for only one stage) and `published` (whether it constitutes a published stage, which may apply to more than one stage). So a taste might
179
+ declare the following stages:
180
180
 
181
181
  [source,asciidoc]
182
182
  ----
183
183
  stages:
184
- proposal:
185
- working-draft:
186
- abbreviation: wd
187
- committee-draft:
188
- abbreviation: cd
189
- draft-standard:
190
- abbreviation: d
191
- final-draft:
192
- published:
184
+ - taste: proposal
185
+ base: proposal
186
+ - taste: working-draft
187
+ base: working-draft
188
+ abbrev: wd
189
+ - taste: committee-draft
190
+ base: committee-draft
191
+ abbrev: cd
192
+ - taste: draft-standard
193
+ base: draft
194
+ abbrev: d
195
+ - taste: final-draft
196
+ base: final-draft
197
+ - taste: published
198
+ base: published
193
199
  default: true
194
200
  published: true
195
- withdrawn:
201
+ - taste: withdrawn
202
+ base: withdrawn
196
203
  published: true
197
204
  ----
198
205
 
data/README.adoc CHANGED
@@ -189,6 +189,11 @@ currently available:
189
189
  |`iso`
190
190
  |International Organization of Legal Metrology specifications and standards with OIML branding and copyright
191
191
 
192
+ |`wmo`
193
+ |World Meteorological Organization
194
+ |`iho`
195
+ |World Meteorological Organization specifications (e.g. S-411) with WMO branding and copyright, built on the IHO document structure
196
+
192
197
 
193
198
  |===
194
199
 
@@ -286,7 +291,7 @@ doctypes: # Array of doctypes built over base flavour doctypes
286
291
  stages: # Array of stages built over base flavour stages
287
292
  - taste: string # Taste-specific machine-readable stage name
288
293
  base: string # Base Metanorma flavor machine-readable stage name
289
- abbreviation: string # Abbreviation of stage
294
+ abbrev: string # Abbreviation of stage
290
295
  default: boolean # Whether the stage is the default stage to be applied to a document
291
296
  published: boolean # Whether the stage is to be considered published
292
297
  committees: # Hash of predefined editorial groups for the SDO
@@ -599,6 +604,30 @@ These include:
599
604
  * `doctype`: mapping of taste doctypes to native base flavor doctypes
600
605
  * `stage`: mapping of taste stages to native base flavor stages
601
606
 
607
+ === Stage repertoire contract
608
+
609
+ When a taste defines `stages:`, its stage repertoire supersedes the base
610
+ flavor's: input stages are validated against the taste's stage names, an
611
+ unrecognised stage is reported and replaced with the taste's default stage,
612
+ and the base stages the taste maps to are advertised to the flavor as valid
613
+ (through the `:docstage-valid:` document attribute), so the flavor does not
614
+ report them as unrecognised in turn.
615
+
616
+ The `base:` values of taste stages must respect the base flavor's native
617
+ stage semantics:
618
+
619
+ * For flavors with free-form stage names (Metanorma Generic and its
620
+ derivatives, such as Ribose), any string is acceptable as a `base:` stage;
621
+ draft-ness is controlled by the `published:` flag of the stage.
622
+ * For flavors whose machinery interprets stage values — above all ISO, where
623
+ document identifiers (pubid) and cover/boilerplate logic are keyed to the
624
+ numeric harmonized stage codes — `base:` values must be drawn from the
625
+ flavor's native repertoire (for ISO: numeric stage codes such as `30`,
626
+ `60`). A stage the flavor cannot interpret will degrade identifier
627
+ generation to a warning (the taste's own docidentifier template is used
628
+ instead), but stage-keyed rendering logic will treat the document as a
629
+ draft.
630
+
602
631
 
603
632
  == Data model
604
633
 
@@ -373,7 +373,11 @@
373
373
  <xsl:call-template name="setAltText">
374
374
  <xsl:with-param name="value" select="@alt-text"/>
375
375
  </xsl:call-template>
376
- <xsl:apply-templates select="." mode="contents"/>
376
+ <xsl:variable name="item">
377
+ <!-- mnx:table/mn:fmt-name, mnx:figure/mn:fmt-name, mnx:example/mn:fmt-name -->
378
+ <xsl:apply-templates select="mn:fmt-name" mode="contents_item"/>
379
+ </xsl:variable>
380
+ <xsl:apply-templates select="xalan:nodeset($item)/node()"/>
377
381
  <fo:inline keep-together.within-line="always">
378
382
  <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
379
383
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
@@ -425,7 +429,7 @@
425
429
  <!-- List of Tables -->
426
430
  <xsl:if test="$contents/mnx:doc[@num = $num]//mnx:tables/mnx:table">
427
431
  <xsl:call-template name="insertListOf_Title">
428
- <xsl:with-param name="title" select="$title-list-tables"/>
432
+ <xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-tables"/>
429
433
  </xsl:call-template>
430
434
  <fo:block role="TOC">
431
435
  <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:tables/mnx:table">
@@ -437,7 +441,7 @@
437
441
  <!-- List of Figures -->
438
442
  <xsl:if test="$contents/mnx:doc[@num = $num]//mnx:figures/mnx:figure">
439
443
  <xsl:call-template name="insertListOf_Title">
440
- <xsl:with-param name="title" select="$title-list-figures"/>
444
+ <xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-figures"/>
441
445
  </xsl:call-template>
442
446
  <fo:block role="TOC">
443
447
  <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:figures/mnx:figure">
@@ -449,7 +453,7 @@
449
453
  <!-- List of Examples -->
450
454
  <xsl:if test="$contents/mnx:doc[@num = $num]//mnx:examples/mnx:example">
451
455
  <xsl:call-template name="insertListOf_Title">
452
- <xsl:with-param name="title" select="$title-list-examples"/>
456
+ <xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-examples"/>
453
457
  </xsl:call-template>
454
458
  <fo:block role="TOC">
455
459
  <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:examples/mnx:example">
@@ -887,45 +891,59 @@
887
891
 
888
892
  <xsl:variable name="ace_tag">ace-tag_</xsl:variable>
889
893
 
890
- <xsl:variable name="title-list-tables">
891
- <xsl:variable name="toc_table_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title"/>
892
- <xsl:value-of select="$toc_table_title"/>
893
- <xsl:if test="normalize-space($toc_table_title) = ''">
894
- <xsl:call-template name="getLocalizedString">
895
- <xsl:with-param name="key">toc_tables</xsl:with-param>
896
- </xsl:call-template>
897
- </xsl:if>
898
- </xsl:variable>
894
+ <xsl:variable name="toc_title_lists_">
895
+ <xsl:for-each select="//mn:metanorma">
896
+ <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
897
+ <xsl:variable name="docid"><xsl:call-template name="getDocumentId"/></xsl:variable>
898
+ <xsl:variable name="current_document">
899
+ <xsl:copy-of select="."/>
900
+ </xsl:variable>
901
+ <xsl:for-each select="xalan:nodeset($current_document)">
902
+ <mnx:doc id="{$docid}" num="{$num}">
903
+ <mnx:title-list-tables>
904
+ <xsl:variable name="toc_table_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title"/>
905
+ <xsl:value-of select="$toc_table_title"/>
906
+ <xsl:if test="normalize-space($toc_table_title) = ''">
907
+ <xsl:call-template name="getLocalizedString">
908
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
909
+ </xsl:call-template>
910
+ </xsl:if>
911
+ </mnx:title-list-tables>
899
912
 
900
- <xsl:variable name="title-list-figures">
901
- <xsl:variable name="toc_figure_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title"/>
902
- <xsl:value-of select="$toc_figure_title"/>
903
- <xsl:if test="normalize-space($toc_figure_title) = ''">
904
- <xsl:call-template name="getLocalizedString">
905
- <xsl:with-param name="key">toc_figures</xsl:with-param>
906
- </xsl:call-template>
907
- </xsl:if>
908
- </xsl:variable>
913
+ <mnx:title-list-figures>
914
+ <xsl:variable name="toc_figure_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title"/>
915
+ <xsl:value-of select="$toc_figure_title"/>
916
+ <xsl:if test="normalize-space($toc_figure_title) = ''">
917
+ <xsl:call-template name="getLocalizedString">
918
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
919
+ </xsl:call-template>
920
+ </xsl:if>
921
+ </mnx:title-list-figures>
909
922
 
910
- <xsl:variable name="title-list-examples">
911
- <xsl:variable name="toc_example_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title"/>
912
- <xsl:value-of select="$toc_example_title"/>
913
- <xsl:if test="normalize-space($toc_example_title) = ''">
914
- <xsl:call-template name="getLocalizedString">
915
- <xsl:with-param name="key">toc_examples</xsl:with-param>
916
- </xsl:call-template>
917
- </xsl:if>
918
- </xsl:variable>
923
+ <mnx:title-list-examples>
924
+ <xsl:variable name="toc_example_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title"/>
925
+ <xsl:value-of select="$toc_example_title"/>
926
+ <xsl:if test="normalize-space($toc_example_title) = ''">
927
+ <xsl:call-template name="getLocalizedString">
928
+ <xsl:with-param name="key">toc_examples</xsl:with-param>
929
+ </xsl:call-template>
930
+ </xsl:if>
931
+ </mnx:title-list-examples>
919
932
 
920
- <xsl:variable name="title-list-recommendations">
921
- <xsl:variable name="toc_requirement_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='requirement']/mn:title"/>
922
- <xsl:value-of select="$toc_requirement_title"/>
923
- <xsl:if test="normalize-space($toc_requirement_title) = ''">
924
- <xsl:call-template name="getLocalizedString">
925
- <xsl:with-param name="key">toc_recommendations</xsl:with-param>
926
- </xsl:call-template>
927
- </xsl:if>
933
+ <mnx:title-list-recommendations>
934
+ <xsl:variable name="toc_requirement_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='requirement']/mn:title"/>
935
+ <xsl:value-of select="$toc_requirement_title"/>
936
+ <xsl:if test="normalize-space($toc_requirement_title) = ''">
937
+ <xsl:call-template name="getLocalizedString">
938
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
939
+ </xsl:call-template>
940
+ </xsl:if>
941
+ </mnx:title-list-recommendations>
942
+ </mnx:doc>
943
+ </xsl:for-each>
944
+ </xsl:for-each>
928
945
  </xsl:variable>
946
+ <xsl:variable name="toc_title_lists" select="xalan:nodeset($toc_title_lists_)"/>
929
947
 
930
948
  <xsl:variable name="bibdata">
931
949
  <xsl:copy-of select="//mn:metanorma/mn:bibdata"/>
@@ -1709,7 +1727,7 @@
1709
1727
  <xsl:apply-templates mode="update_xml_step1"/>
1710
1728
  </xsl:template>
1711
1729
 
1712
- <xsl:template match="mn:semx" mode="update_xml_step1">
1730
+ <xsl:template match="mn:semx[not(@element = 'name')]" mode="update_xml_step1">
1713
1731
  <xsl:apply-templates mode="update_xml_step1"/>
1714
1732
  </xsl:template>
1715
1733
 
@@ -1992,7 +2010,7 @@
1992
2010
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
1993
2011
  <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>
1994
2012
 
1995
- <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">
2013
+ <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">
1996
2014
 
1997
2015
  <xsl:variable name="parent" select="local-name(..)"/>
1998
2016
 
@@ -2037,7 +2055,7 @@
2037
2055
  <xsl:variable name="text">
2038
2056
  <xsl:element name="text" namespace="{$namespace_full}">
2039
2057
  <xsl:choose>
2040
- <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 -->
2058
+ <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 -->
2041
2059
  <xsl:otherwise>
2042
2060
  <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))"/>
2043
2061
  <!-- <xsl:value-of select="$text__"/> -->
@@ -2115,6 +2133,10 @@
2115
2133
  <xsl:copy-of select="."/>
2116
2134
  </xsl:template>
2117
2135
 
2136
+ <xsl:template match="mn:semx" mode="update_xml_enclose_keep-together_within-line">
2137
+ <xsl:apply-templates mode="update_xml_enclose_keep-together_within-line"/>
2138
+ </xsl:template>
2139
+
2118
2140
  <xsl:template name="replace_text_tags">
2119
2141
  <xsl:param name="tag_open"/>
2120
2142
  <xsl:param name="tag_close"/>
@@ -6285,6 +6307,12 @@
6285
6307
  <style name="{$key}-left"><xsl:value-of select="$value"/></style>
6286
6308
  <style name="{$key}-bottom"><xsl:value-of select="$value"/></style>
6287
6309
  </xsl:if>
6310
+ <xsl:if test="$key = 'page-break-inside' and $value = 'avoid'">
6311
+ <style name="keep-together.within-page">always</style>
6312
+ </xsl:if>
6313
+ <xsl:if test="$key = 'page-break-after' and $value = 'always'">
6314
+ <style name="break-after">page</style>
6315
+ </xsl:if>
6288
6316
  </xsl:for-each>
6289
6317
  </xsl:variable>
6290
6318
  <xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
@@ -6328,6 +6356,11 @@
6328
6356
 
6329
6357
  <fo:block role="SKIP">
6330
6358
 
6359
+ <xsl:variable name="styles">
6360
+ <styles><xsl:call-template name="setTableStyles"/></styles>
6361
+ </xsl:variable>
6362
+ <xsl:copy-of select="xalan:nodeset($styles)/styles/@break-after"/>
6363
+
6331
6364
  <xsl:if test="$isGenerateTableIF = 'true'">
6332
6365
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
6333
6366
  </xsl:if>
@@ -8477,11 +8510,27 @@
8477
8510
  <!-- ====== -->
8478
8511
  <!-- ====== -->
8479
8512
 
8480
- <xsl:attribute-set name="quote-style">
8513
+ <xsl:attribute-set name="quote-container-style">
8481
8514
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
8482
8515
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
8483
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
8516
+ <xsl:attribute name="role">SKIP</xsl:attribute>
8517
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
8484
8518
  <xsl:attribute name="margin-left">13mm</xsl:attribute>
8519
+ </xsl:attribute-set>
8520
+
8521
+ <xsl:template name="refine_quote-container-style">
8522
+ <xsl:if test="parent::mn:note">
8523
+ <xsl:if test="not(ancestor::mn:table)">
8524
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
8525
+ </xsl:if>
8526
+ </xsl:if>
8527
+ </xsl:template>
8528
+
8529
+ <xsl:attribute-set name="quote-style">
8530
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
8531
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
8532
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
8533
+
8485
8534
  </xsl:attribute-set> <!-- quote-style -->
8486
8535
 
8487
8536
  <xsl:template name="refine_quote-style">
@@ -8489,7 +8538,8 @@
8489
8538
 
8490
8539
  <xsl:attribute-set name="quote-source-style">
8491
8540
  <xsl:attribute name="text-align">right</xsl:attribute>
8492
- <xsl:attribute name="margin-right">25mm</xsl:attribute>
8541
+ <xsl:attribute name="margin-right">-12mm</xsl:attribute>
8542
+ <xsl:attribute name="margin-right">13mm</xsl:attribute>
8493
8543
  </xsl:attribute-set> <!-- quote-source-style -->
8494
8544
 
8495
8545
  <xsl:template name="refine_quote-source-style">
@@ -8512,12 +8562,9 @@
8512
8562
 
8513
8563
  <xsl:call-template name="setBlockSpanAll"/>
8514
8564
 
8515
- <xsl:if test="parent::mn:note">
8516
- <xsl:if test="not(ancestor::mn:table)">
8517
- <xsl:attribute name="margin-left">5mm</xsl:attribute>
8518
- </xsl:if>
8519
- </xsl:if>
8520
- <fo:block-container margin-left="0mm" role="SKIP">
8565
+ <fo:block-container xsl:use-attribute-sets="quote-container-style">
8566
+ <xsl:call-template name="refine_quote-container-style"/>
8567
+
8521
8568
  <fo:block-container xsl:use-attribute-sets="quote-style" role="SKIP">
8522
8569
 
8523
8570
  <xsl:call-template name="refine_quote-style"/>
@@ -8529,14 +8576,16 @@
8529
8576
  </fo:block-container>
8530
8577
  </fo:block-container>
8531
8578
  <xsl:if test="mn:author or mn:fmt-source or mn:attribution">
8532
- <fo:block xsl:use-attribute-sets="quote-source-style">
8533
- <xsl:call-template name="refine_quote-source-style"/>
8534
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
8535
- <xsl:apply-templates select="mn:author"/>
8536
- <xsl:apply-templates select="mn:fmt-source"/>
8537
- <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
8538
- <xsl:apply-templates select="mn:attribution/mn:p/node()"/>
8539
- </fo:block>
8579
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8580
+ <fo:block xsl:use-attribute-sets="quote-source-style">
8581
+ <xsl:call-template name="refine_quote-source-style"/>
8582
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
8583
+ <xsl:apply-templates select="mn:author"/>
8584
+ <xsl:apply-templates select="mn:fmt-source"/>
8585
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
8586
+ <xsl:apply-templates select="mn:attribution/mn:p/node()"/>
8587
+ </fo:block>
8588
+ </fo:block-container>
8540
8589
  </xsl:if>
8541
8590
 
8542
8591
  </fo:block-container>
@@ -9329,6 +9378,7 @@
9329
9378
  <xsl:variable name="svg_content">
9330
9379
  <xsl:apply-templates select="." mode="svg_update"/>
9331
9380
  </xsl:variable>
9381
+ <!-- <svg_content><xsl:copy-of select="$svg_content"/></svg_content> -->
9332
9382
 
9333
9383
  <xsl:variable name="alt-text">
9334
9384
  <xsl:choose>
@@ -9543,7 +9593,7 @@
9543
9593
  </xsl:copy>
9544
9594
  </xsl:template>
9545
9595
 
9546
- <xsl:template match="mn:image/@href" mode="svg_update">
9596
+ <xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
9547
9597
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
9548
9598
  <xsl:value-of select="."/>
9549
9599
  </xsl:attribute>
@@ -12123,13 +12173,13 @@
12123
12173
 
12124
12174
  <xsl:template name="processTablesFigures_Contents">
12125
12175
  <xsl:param name="always"/>
12126
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
12176
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
12127
12177
  <xsl:call-template name="processTables_Contents"/>
12128
12178
  </xsl:if>
12129
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
12179
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
12130
12180
  <xsl:call-template name="processFigures_Contents"/>
12131
12181
  </xsl:if>
12132
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title)">
12182
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title)">
12133
12183
  <xsl:call-template name="processExamples_Contents"/>
12134
12184
  </xsl:if>
12135
12185
  </xsl:template>
@@ -12180,22 +12230,22 @@
12180
12230
 
12181
12231
  <xsl:template name="processExamples_Contents">
12182
12232
  <mnx:examples>
12183
- <xsl:for-each select="//mn:example[@id and mn:fmt-name and not(@unnumbered = 'true') and normalize-space(@id) != '']">
12184
- <xsl:choose>
12185
- <xsl:when test="mn:fmt-name">
12186
- <xsl:variable name="fmt_name">
12187
- <xsl:apply-templates select="mn:fmt-name" mode="update_xml_step1"/>
12188
- </xsl:variable>
12189
- <mnx:example id="{@id}" alt-text="{normalize-space($fmt_name)}">
12190
- <xsl:copy-of select="$fmt_name"/>
12191
- </mnx:example>
12192
- </xsl:when>
12193
- <xsl:otherwise>
12194
- <mnx:example id="{@id}" alt-text="{mn:name}">
12195
- <xsl:copy-of select="mn:name"/>
12196
- </mnx:example>
12197
- </xsl:otherwise>
12198
- </xsl:choose>
12233
+ <xsl:for-each select="//mn:example[@id and mn:fmt-name and normalize-space(@id) != '']">
12234
+ <!-- https://github.com/metanorma/metanorma-pdfa/issues/32#issuecomment-4929133938:
12235
+ //example/fmt-xref-label[@container] + //example/fmt-name/span[@class = 'fmt-caption-delim'] + //example/name,
12236
+ with the last two elements dropped if //example/name does not exist. -->
12237
+ <xsl:variable name="example_name">
12238
+ <xsl:apply-templates select="mn:name/node()" mode="update_xml_step1"/>
12239
+ </xsl:variable>
12240
+ <mnx:example id="{@id}" alt-text="{normalize-space($example_name)}">
12241
+ <xsl:element name="fmt-name" namespace="{$namespace_full}">
12242
+ <xsl:value-of select="mn:fmt-xref-label[@container]"/>
12243
+ <xsl:if test="normalize-space($example_name) != ''">
12244
+ <xsl:value-of select="mn:fmt-name/mn:span[@class = 'fmt-caption-delim']"/>
12245
+ <xsl:copy-of select="$example_name"/>
12246
+ </xsl:if>
12247
+ </xsl:element>
12248
+ </mnx:example>
12199
12249
  </xsl:for-each>
12200
12250
  </mnx:examples>
12201
12251
  </xsl:template>
@@ -12468,15 +12518,18 @@
12468
12518
 
12469
12519
  <xsl:call-template name="insertFigureBookmarks">
12470
12520
  <xsl:with-param name="contents" select="mnx:contents"/>
12521
+ <xsl:with-param name="num" select="@num"/>
12471
12522
  </xsl:call-template>
12472
12523
 
12473
12524
  <xsl:call-template name="insertTableBookmarks">
12474
12525
  <xsl:with-param name="contents" select="mnx:contents"/>
12526
+ <xsl:with-param name="num" select="@num"/>
12475
12527
  <xsl:with-param name="lang" select="@lang"/>
12476
12528
  </xsl:call-template>
12477
12529
 
12478
12530
  <xsl:call-template name="insertExampleBookmarks">
12479
12531
  <xsl:with-param name="contents" select="mnx:contents"/>
12532
+ <xsl:with-param name="num" select="@num"/>
12480
12533
  <xsl:with-param name="lang" select="@lang"/>
12481
12534
  </xsl:call-template>
12482
12535
 
@@ -12491,15 +12544,18 @@
12491
12544
 
12492
12545
  <xsl:call-template name="insertFigureBookmarks">
12493
12546
  <xsl:with-param name="contents" select="mnx:contents"/>
12547
+ <xsl:with-param name="num" select="@num"/>
12494
12548
  </xsl:call-template>
12495
12549
 
12496
12550
  <xsl:call-template name="insertTableBookmarks">
12497
12551
  <xsl:with-param name="contents" select="mnx:contents"/>
12552
+ <xsl:with-param name="num" select="@num"/>
12498
12553
  <xsl:with-param name="lang" select="@lang"/>
12499
12554
  </xsl:call-template>
12500
12555
 
12501
12556
  <xsl:call-template name="insertExampleBookmarks">
12502
12557
  <xsl:with-param name="contents" select="mnx:contents"/>
12558
+ <xsl:with-param name="num" select="@num"/>
12503
12559
  <xsl:with-param name="lang" select="@lang"/>
12504
12560
  </xsl:call-template>
12505
12561
 
@@ -12512,15 +12568,18 @@
12512
12568
 
12513
12569
  <xsl:call-template name="insertFigureBookmarks">
12514
12570
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
12571
+ <xsl:with-param name="num" select="@num"/>
12515
12572
  </xsl:call-template>
12516
12573
 
12517
12574
  <xsl:call-template name="insertTableBookmarks">
12518
12575
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
12576
+ <xsl:with-param name="num" select="@num"/>
12519
12577
  <xsl:with-param name="lang" select="@lang"/>
12520
12578
  </xsl:call-template>
12521
12579
 
12522
12580
  <xsl:call-template name="insertExampleBookmarks">
12523
12581
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
12582
+ <xsl:with-param name="num" select="@num"/>
12524
12583
  <xsl:with-param name="lang" select="@lang"/>
12525
12584
  </xsl:call-template>
12526
12585
 
@@ -12536,6 +12595,7 @@
12536
12595
 
12537
12596
  <xsl:template name="insertFigureBookmarks">
12538
12597
  <xsl:param name="contents"/>
12598
+ <xsl:param name="num"/>
12539
12599
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
12540
12600
  <xsl:if test="$contents_nodes/mnx:figure">
12541
12601
  <fo:bookmark internal-destination="{$contents_nodes/mnx:figure[1]/@id}" starting-state="hide">
@@ -12553,7 +12613,7 @@
12553
12613
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
12554
12614
 
12555
12615
  <xsl:variable name="bookmark-title">
12556
- <xsl:value-of select="$title-list-figures"/>
12616
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-figures"/>
12557
12617
  </xsl:variable>
12558
12618
  <fo:bookmark-title><xsl:value-of select="normalize-space($bookmark-title)"/></fo:bookmark-title>
12559
12619
  <xsl:for-each select="$contents_nodes//mnx:figures/mnx:figure">
@@ -12567,6 +12627,7 @@
12567
12627
 
12568
12628
  <xsl:template name="insertTableBookmarks">
12569
12629
  <xsl:param name="contents"/>
12630
+ <xsl:param name="num"/>
12570
12631
  <xsl:param name="lang"/>
12571
12632
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
12572
12633
  <xsl:if test="$contents_nodes/mnx:table">
@@ -12590,7 +12651,7 @@
12590
12651
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
12591
12652
 
12592
12653
  <xsl:variable name="bookmark-title">
12593
- <xsl:value-of select="$title-list-tables"/>
12654
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-tables"/>
12594
12655
  </xsl:variable>
12595
12656
 
12596
12657
  <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
@@ -12605,8 +12666,9 @@
12605
12666
  </xsl:if>
12606
12667
  </xsl:template> <!-- insertTableBookmarks -->
12607
12668
 
12608
- <xsl:template name="insertExampleBookmarks">
12669
+ <xsl:template name="insertExampleBookmarks">
12609
12670
  <xsl:param name="contents"/>
12671
+ <xsl:param name="num"/>
12610
12672
  <xsl:param name="lang"/>
12611
12673
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
12612
12674
  <xsl:if test="$contents_nodes/mnx:example">
@@ -12630,7 +12692,7 @@
12630
12692
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
12631
12693
 
12632
12694
  <xsl:variable name="bookmark-title">
12633
- <xsl:value-of select="$title-list-examples"/>
12695
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-examples"/>
12634
12696
  </xsl:variable>
12635
12697
 
12636
12698
  <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
@@ -12791,6 +12853,18 @@
12791
12853
  </xsl:copy>
12792
12854
  </xsl:template>
12793
12855
 
12856
+ <xsl:template match="mn:tt" mode="contents_item">
12857
+ <xsl:copy>
12858
+ <xsl:apply-templates mode="contents_item"/>
12859
+ </xsl:copy>
12860
+ </xsl:template>
12861
+
12862
+ <xsl:template match="*[local-name() = 'keep-together_within-line']" mode="contents_item">
12863
+ <xsl:copy>
12864
+ <xsl:apply-templates mode="contents_item"/>
12865
+ </xsl:copy>
12866
+ </xsl:template>
12867
+
12794
12868
  <xsl:template match="mn:stem" mode="contents_item"/>
12795
12869
  <xsl:template match="mn:fmt-stem" mode="contents_item">
12796
12870
  <xsl:copy-of select="."/>
@@ -13626,6 +13700,10 @@
13626
13700
  <fo:block break-after="page"/>
13627
13701
  </xsl:template>
13628
13702
 
13703
+ <xsl:template match="mn:pagebreak[ancestor::mn:table]" priority="2">
13704
+ <fo:block break-after="page"/>
13705
+ </xsl:template>
13706
+
13629
13707
  <xsl:variable name="font_main_root_style">
13630
13708
  <root-style xsl:use-attribute-sets="root-style">
13631
13709
  </root-style>