metanorma-itu 2.6.5 → 2.6.6

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: b5f187ffbd83cb13e467918539ed15e31d4801118af0897d367caa1de419c720
4
- data.tar.gz: 573e7c8a806e13ab18c401fa0d67a1a7840067f0e8d4e57b12fcaccd5efe4a80
3
+ metadata.gz: 4dcbbd7572fe2303877767686ec3ee8674c33ce4f4a41155e59174a4085ef241
4
+ data.tar.gz: fb67c1baeacf801f605650d84f52d8490e60285721c489fcbd894ed8eb41b2c3
5
5
  SHA512:
6
- metadata.gz: 9c50ccce84cda01718a398c65900785b93c82f8004839d86309435414d63877d29d2f72dd9d46d6e3676cecc826528761425dbebba4bd21e893ae43953bdafe3
7
- data.tar.gz: b0f85e6e051fb887c24b5131da8586b117eb3cf0940d98f9a09b3e56b25441fa58d5d6728094b854d0cab16f1697e2f2e47f9be608bf1fc411c2518a2f9d0c3a
6
+ metadata.gz: da628d1d65997bbad001858fcd459eba9f161b8721445860f694a5bb49bdb4c0b5582147c2fb981a7f66be782d97c878c094ce9be1b931ebd01606aaaf79714e
7
+ data.tar.gz: ad8f591f58f2b3583abe75e1cb8ce9e79de7ad628392ca4fdad0fddfc9af5874537ee9a598cb45dea244b5295f73134a537e672286a3aa75baf9ef5e4b559086
@@ -42,19 +42,6 @@ module IsoDoc
42
42
  super
43
43
  end
44
44
 
45
- # KILL
46
- def ol_depthx(node)
47
- node["class"] == "steps" ||
48
- node.at(".//ancestor::xmlns:ol[@class = 'steps']") or return super
49
- depth = node.ancestors("ul, ol").size + 1
50
- type = :arabic
51
- type = :alphabet if [2, 7].include? depth
52
- type = :roman if [3, 8].include? depth
53
- type = :alphabet_upper if [4, 9].include? depth
54
- type = :roman_upper if [5, 10].include? depth
55
- ol_style(type)
56
- end
57
-
58
45
  def annex_name(_annex, name, div)
59
46
  r_a = @meta.get[:doctype_original] == "recommendation-annex"
60
47
  div.h1 class: r_a ? "RecommendationAnnex" : "Annex" do |t|
@@ -83,29 +70,6 @@ module IsoDoc
83
70
  super
84
71
  end
85
72
 
86
- # TODO kill
87
- def note_p_parsex(node, div)
88
- name = node.at(ns("./name"))&.remove
89
- div.p do |p|
90
- name and p.span class: "note_label" do |s|
91
- name.children.each { |n| parse(n, s) }
92
- end
93
- node.first_element_child.children.each { |n| parse(n, p) }
94
- end
95
- node.element_children[1..-1].each { |n| parse(n, div) }
96
- end
97
-
98
- # TODO kill
99
- def note_parse1x(node, div)
100
- name = node.at(ns("./name"))&.remove
101
- div.p do |p|
102
- name and p.span class: "note_label" do |s|
103
- name.children.each { |n| parse(n, s) }
104
- end
105
- end
106
- node.children.each { |n| parse(n, div) }
107
- end
108
-
109
73
  def note_parse(node, out)
110
74
  node["type"] == "title-footnote" and return
111
75
  super
@@ -11479,11 +11479,11 @@
11479
11479
  </xsl:template>
11480
11480
 
11481
11481
  <!-- figure/fn -->
11482
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
11482
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'fn']" priority="2"/>
11483
11483
  <!-- figure/note -->
11484
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
11484
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'note']" priority="2"/>
11485
11485
  <!-- figure/example -->
11486
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
11486
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'example']" priority="2"/>
11487
11487
 
11488
11488
  <!-- figure/note[@type = 'units'] -->
11489
11489
  <!-- image/note[@type = 'units'] -->
@@ -15024,6 +15024,9 @@
15024
15024
  <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
15025
15025
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
15026
15026
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
15027
+ <!-- https://github.com/metanorma/isodoc/issues/687 -->
15028
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_step1"/>
15029
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_pres"/>
15027
15030
 
15028
15031
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
15029
15032
  <xsl:copy>
@@ -15306,6 +15309,20 @@
15306
15309
  </xsl:element>
15307
15310
  </xsl:template>
15308
15311
 
15312
+ <xsl:template match="*[local-name() = 'fmt-source']"/>
15313
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_step1">
15314
+ <xsl:element name="source" namespace="{$namespace_full}">
15315
+ <xsl:copy-of select="@*"/>
15316
+ <xsl:apply-templates mode="update_xml_step1"/>
15317
+ </xsl:element>
15318
+ </xsl:template>
15319
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_pres">
15320
+ <xsl:element name="source" namespace="{$namespace_full}">
15321
+ <xsl:copy-of select="@*"/>
15322
+ <xsl:apply-templates mode="update_xml_pres"/>
15323
+ </xsl:element>
15324
+ </xsl:template>
15325
+
15309
15326
  <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
15310
15327
  <xsl:apply-templates mode="update_xml_step1"/>
15311
15328
  </xsl:template>
@@ -16665,6 +16682,12 @@
16665
16682
  </xsl:if>
16666
16683
  </xsl:template>
16667
16684
 
16685
+ <xsl:template name="setIDforNamedDestinationInline">
16686
+ <xsl:if test="@named_dest">
16687
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
16688
+ </xsl:if>
16689
+ </xsl:template>
16690
+
16668
16691
  <xsl:template name="setNamedDestination">
16669
16692
  <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
16670
16693
  <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
@@ -11479,11 +11479,11 @@
11479
11479
  </xsl:template>
11480
11480
 
11481
11481
  <!-- figure/fn -->
11482
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
11482
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'fn']" priority="2"/>
11483
11483
  <!-- figure/note -->
11484
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
11484
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'note']" priority="2"/>
11485
11485
  <!-- figure/example -->
11486
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
11486
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'example']" priority="2"/>
11487
11487
 
11488
11488
  <!-- figure/note[@type = 'units'] -->
11489
11489
  <!-- image/note[@type = 'units'] -->
@@ -15024,6 +15024,9 @@
15024
15024
  <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
15025
15025
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
15026
15026
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
15027
+ <!-- https://github.com/metanorma/isodoc/issues/687 -->
15028
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_step1"/>
15029
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_pres"/>
15027
15030
 
15028
15031
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
15029
15032
  <xsl:copy>
@@ -15306,6 +15309,20 @@
15306
15309
  </xsl:element>
15307
15310
  </xsl:template>
15308
15311
 
15312
+ <xsl:template match="*[local-name() = 'fmt-source']"/>
15313
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_step1">
15314
+ <xsl:element name="source" namespace="{$namespace_full}">
15315
+ <xsl:copy-of select="@*"/>
15316
+ <xsl:apply-templates mode="update_xml_step1"/>
15317
+ </xsl:element>
15318
+ </xsl:template>
15319
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_pres">
15320
+ <xsl:element name="source" namespace="{$namespace_full}">
15321
+ <xsl:copy-of select="@*"/>
15322
+ <xsl:apply-templates mode="update_xml_pres"/>
15323
+ </xsl:element>
15324
+ </xsl:template>
15325
+
15309
15326
  <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
15310
15327
  <xsl:apply-templates mode="update_xml_step1"/>
15311
15328
  </xsl:template>
@@ -16665,6 +16682,12 @@
16665
16682
  </xsl:if>
16666
16683
  </xsl:template>
16667
16684
 
16685
+ <xsl:template name="setIDforNamedDestinationInline">
16686
+ <xsl:if test="@named_dest">
16687
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
16688
+ </xsl:if>
16689
+ </xsl:template>
16690
+
16668
16691
  <xsl:template name="setNamedDestination">
16669
16692
  <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
16670
16693
  <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
@@ -11479,11 +11479,11 @@
11479
11479
  </xsl:template>
11480
11480
 
11481
11481
  <!-- figure/fn -->
11482
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
11482
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'fn']" priority="2"/>
11483
11483
  <!-- figure/note -->
11484
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
11484
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'note']" priority="2"/>
11485
11485
  <!-- figure/example -->
11486
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
11486
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'example']" priority="2"/>
11487
11487
 
11488
11488
  <!-- figure/note[@type = 'units'] -->
11489
11489
  <!-- image/note[@type = 'units'] -->
@@ -15024,6 +15024,9 @@
15024
15024
  <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
15025
15025
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
15026
15026
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
15027
+ <!-- https://github.com/metanorma/isodoc/issues/687 -->
15028
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_step1"/>
15029
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_pres"/>
15027
15030
 
15028
15031
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
15029
15032
  <xsl:copy>
@@ -15306,6 +15309,20 @@
15306
15309
  </xsl:element>
15307
15310
  </xsl:template>
15308
15311
 
15312
+ <xsl:template match="*[local-name() = 'fmt-source']"/>
15313
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_step1">
15314
+ <xsl:element name="source" namespace="{$namespace_full}">
15315
+ <xsl:copy-of select="@*"/>
15316
+ <xsl:apply-templates mode="update_xml_step1"/>
15317
+ </xsl:element>
15318
+ </xsl:template>
15319
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_pres">
15320
+ <xsl:element name="source" namespace="{$namespace_full}">
15321
+ <xsl:copy-of select="@*"/>
15322
+ <xsl:apply-templates mode="update_xml_pres"/>
15323
+ </xsl:element>
15324
+ </xsl:template>
15325
+
15309
15326
  <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
15310
15327
  <xsl:apply-templates mode="update_xml_step1"/>
15311
15328
  </xsl:template>
@@ -16665,6 +16682,12 @@
16665
16682
  </xsl:if>
16666
16683
  </xsl:template>
16667
16684
 
16685
+ <xsl:template name="setIDforNamedDestinationInline">
16686
+ <xsl:if test="@named_dest">
16687
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
16688
+ </xsl:if>
16689
+ </xsl:template>
16690
+
16668
16691
  <xsl:template name="setNamedDestination">
16669
16692
  <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
16670
16693
  <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
@@ -11479,11 +11479,11 @@
11479
11479
  </xsl:template>
11480
11480
 
11481
11481
  <!-- figure/fn -->
11482
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
11482
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'fn']" priority="2"/>
11483
11483
  <!-- figure/note -->
11484
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
11484
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'note']" priority="2"/>
11485
11485
  <!-- figure/example -->
11486
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
11486
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'example']" priority="2"/>
11487
11487
 
11488
11488
  <!-- figure/note[@type = 'units'] -->
11489
11489
  <!-- image/note[@type = 'units'] -->
@@ -15024,6 +15024,9 @@
15024
15024
  <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
15025
15025
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
15026
15026
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
15027
+ <!-- https://github.com/metanorma/isodoc/issues/687 -->
15028
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_step1"/>
15029
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_pres"/>
15027
15030
 
15028
15031
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
15029
15032
  <xsl:copy>
@@ -15306,6 +15309,20 @@
15306
15309
  </xsl:element>
15307
15310
  </xsl:template>
15308
15311
 
15312
+ <xsl:template match="*[local-name() = 'fmt-source']"/>
15313
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_step1">
15314
+ <xsl:element name="source" namespace="{$namespace_full}">
15315
+ <xsl:copy-of select="@*"/>
15316
+ <xsl:apply-templates mode="update_xml_step1"/>
15317
+ </xsl:element>
15318
+ </xsl:template>
15319
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_pres">
15320
+ <xsl:element name="source" namespace="{$namespace_full}">
15321
+ <xsl:copy-of select="@*"/>
15322
+ <xsl:apply-templates mode="update_xml_pres"/>
15323
+ </xsl:element>
15324
+ </xsl:template>
15325
+
15309
15326
  <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
15310
15327
  <xsl:apply-templates mode="update_xml_step1"/>
15311
15328
  </xsl:template>
@@ -16665,6 +16682,12 @@
16665
16682
  </xsl:if>
16666
16683
  </xsl:template>
16667
16684
 
16685
+ <xsl:template name="setIDforNamedDestinationInline">
16686
+ <xsl:if test="@named_dest">
16687
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
16688
+ </xsl:if>
16689
+ </xsl:template>
16690
+
16668
16691
  <xsl:template name="setNamedDestination">
16669
16692
  <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
16670
16693
  <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
@@ -11479,11 +11479,11 @@
11479
11479
  </xsl:template>
11480
11480
 
11481
11481
  <!-- figure/fn -->
11482
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
11482
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'fn']" priority="2"/>
11483
11483
  <!-- figure/note -->
11484
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
11484
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'note']" priority="2"/>
11485
11485
  <!-- figure/example -->
11486
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
11486
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'example']" priority="2"/>
11487
11487
 
11488
11488
  <!-- figure/note[@type = 'units'] -->
11489
11489
  <!-- image/note[@type = 'units'] -->
@@ -15024,6 +15024,9 @@
15024
15024
  <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
15025
15025
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
15026
15026
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
15027
+ <!-- https://github.com/metanorma/isodoc/issues/687 -->
15028
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_step1"/>
15029
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_pres"/>
15027
15030
 
15028
15031
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
15029
15032
  <xsl:copy>
@@ -15306,6 +15309,20 @@
15306
15309
  </xsl:element>
15307
15310
  </xsl:template>
15308
15311
 
15312
+ <xsl:template match="*[local-name() = 'fmt-source']"/>
15313
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_step1">
15314
+ <xsl:element name="source" namespace="{$namespace_full}">
15315
+ <xsl:copy-of select="@*"/>
15316
+ <xsl:apply-templates mode="update_xml_step1"/>
15317
+ </xsl:element>
15318
+ </xsl:template>
15319
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_pres">
15320
+ <xsl:element name="source" namespace="{$namespace_full}">
15321
+ <xsl:copy-of select="@*"/>
15322
+ <xsl:apply-templates mode="update_xml_pres"/>
15323
+ </xsl:element>
15324
+ </xsl:template>
15325
+
15309
15326
  <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
15310
15327
  <xsl:apply-templates mode="update_xml_step1"/>
15311
15328
  </xsl:template>
@@ -16665,6 +16682,12 @@
16665
16682
  </xsl:if>
16666
16683
  </xsl:template>
16667
16684
 
16685
+ <xsl:template name="setIDforNamedDestinationInline">
16686
+ <xsl:if test="@named_dest">
16687
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
16688
+ </xsl:if>
16689
+ </xsl:template>
16690
+
16668
16691
  <xsl:template name="setNamedDestination">
16669
16692
  <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
16670
16693
  <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
@@ -11479,11 +11479,11 @@
11479
11479
  </xsl:template>
11480
11480
 
11481
11481
  <!-- figure/fn -->
11482
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
11482
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'fn']" priority="2"/>
11483
11483
  <!-- figure/note -->
11484
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
11484
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'note']" priority="2"/>
11485
11485
  <!-- figure/example -->
11486
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
11486
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'example']" priority="2"/>
11487
11487
 
11488
11488
  <!-- figure/note[@type = 'units'] -->
11489
11489
  <!-- image/note[@type = 'units'] -->
@@ -15024,6 +15024,9 @@
15024
15024
  <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
15025
15025
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
15026
15026
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
15027
+ <!-- https://github.com/metanorma/isodoc/issues/687 -->
15028
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_step1"/>
15029
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_pres"/>
15027
15030
 
15028
15031
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
15029
15032
  <xsl:copy>
@@ -15306,6 +15309,20 @@
15306
15309
  </xsl:element>
15307
15310
  </xsl:template>
15308
15311
 
15312
+ <xsl:template match="*[local-name() = 'fmt-source']"/>
15313
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_step1">
15314
+ <xsl:element name="source" namespace="{$namespace_full}">
15315
+ <xsl:copy-of select="@*"/>
15316
+ <xsl:apply-templates mode="update_xml_step1"/>
15317
+ </xsl:element>
15318
+ </xsl:template>
15319
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_pres">
15320
+ <xsl:element name="source" namespace="{$namespace_full}">
15321
+ <xsl:copy-of select="@*"/>
15322
+ <xsl:apply-templates mode="update_xml_pres"/>
15323
+ </xsl:element>
15324
+ </xsl:template>
15325
+
15309
15326
  <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
15310
15327
  <xsl:apply-templates mode="update_xml_step1"/>
15311
15328
  </xsl:template>
@@ -16665,6 +16682,12 @@
16665
16682
  </xsl:if>
16666
16683
  </xsl:template>
16667
16684
 
16685
+ <xsl:template name="setIDforNamedDestinationInline">
16686
+ <xsl:if test="@named_dest">
16687
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
16688
+ </xsl:if>
16689
+ </xsl:template>
16690
+
16668
16691
  <xsl:template name="setNamedDestination">
16669
16692
  <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
16670
16693
  <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
@@ -11479,11 +11479,11 @@
11479
11479
  </xsl:template>
11480
11480
 
11481
11481
  <!-- figure/fn -->
11482
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
11482
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'fn']" priority="2"/>
11483
11483
  <!-- figure/note -->
11484
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
11484
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'note']" priority="2"/>
11485
11485
  <!-- figure/example -->
11486
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
11486
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'example']" priority="2"/>
11487
11487
 
11488
11488
  <!-- figure/note[@type = 'units'] -->
11489
11489
  <!-- image/note[@type = 'units'] -->
@@ -15024,6 +15024,9 @@
15024
15024
  <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
15025
15025
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
15026
15026
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
15027
+ <!-- https://github.com/metanorma/isodoc/issues/687 -->
15028
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_step1"/>
15029
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_pres"/>
15027
15030
 
15028
15031
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
15029
15032
  <xsl:copy>
@@ -15306,6 +15309,20 @@
15306
15309
  </xsl:element>
15307
15310
  </xsl:template>
15308
15311
 
15312
+ <xsl:template match="*[local-name() = 'fmt-source']"/>
15313
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_step1">
15314
+ <xsl:element name="source" namespace="{$namespace_full}">
15315
+ <xsl:copy-of select="@*"/>
15316
+ <xsl:apply-templates mode="update_xml_step1"/>
15317
+ </xsl:element>
15318
+ </xsl:template>
15319
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_pres">
15320
+ <xsl:element name="source" namespace="{$namespace_full}">
15321
+ <xsl:copy-of select="@*"/>
15322
+ <xsl:apply-templates mode="update_xml_pres"/>
15323
+ </xsl:element>
15324
+ </xsl:template>
15325
+
15309
15326
  <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
15310
15327
  <xsl:apply-templates mode="update_xml_step1"/>
15311
15328
  </xsl:template>
@@ -16665,6 +16682,12 @@
16665
16682
  </xsl:if>
16666
16683
  </xsl:template>
16667
16684
 
16685
+ <xsl:template name="setIDforNamedDestinationInline">
16686
+ <xsl:if test="@named_dest">
16687
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
16688
+ </xsl:if>
16689
+ </xsl:template>
16690
+
16668
16691
  <xsl:template name="setNamedDestination">
16669
16692
  <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
16670
16693
  <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
@@ -11479,11 +11479,11 @@
11479
11479
  </xsl:template>
11480
11480
 
11481
11481
  <!-- figure/fn -->
11482
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
11482
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'fn']" priority="2"/>
11483
11483
  <!-- figure/note -->
11484
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
11484
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'note']" priority="2"/>
11485
11485
  <!-- figure/example -->
11486
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
11486
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'example']" priority="2"/>
11487
11487
 
11488
11488
  <!-- figure/note[@type = 'units'] -->
11489
11489
  <!-- image/note[@type = 'units'] -->
@@ -15024,6 +15024,9 @@
15024
15024
  <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
15025
15025
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
15026
15026
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
15027
+ <!-- https://github.com/metanorma/isodoc/issues/687 -->
15028
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_step1"/>
15029
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_pres"/>
15027
15030
 
15028
15031
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
15029
15032
  <xsl:copy>
@@ -15306,6 +15309,20 @@
15306
15309
  </xsl:element>
15307
15310
  </xsl:template>
15308
15311
 
15312
+ <xsl:template match="*[local-name() = 'fmt-source']"/>
15313
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_step1">
15314
+ <xsl:element name="source" namespace="{$namespace_full}">
15315
+ <xsl:copy-of select="@*"/>
15316
+ <xsl:apply-templates mode="update_xml_step1"/>
15317
+ </xsl:element>
15318
+ </xsl:template>
15319
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_pres">
15320
+ <xsl:element name="source" namespace="{$namespace_full}">
15321
+ <xsl:copy-of select="@*"/>
15322
+ <xsl:apply-templates mode="update_xml_pres"/>
15323
+ </xsl:element>
15324
+ </xsl:template>
15325
+
15309
15326
  <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
15310
15327
  <xsl:apply-templates mode="update_xml_step1"/>
15311
15328
  </xsl:template>
@@ -16665,6 +16682,12 @@
16665
16682
  </xsl:if>
16666
16683
  </xsl:template>
16667
16684
 
16685
+ <xsl:template name="setIDforNamedDestinationInline">
16686
+ <xsl:if test="@named_dest">
16687
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
16688
+ </xsl:if>
16689
+ </xsl:template>
16690
+
16668
16691
  <xsl:template name="setNamedDestination">
16669
16692
  <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
16670
16693
  <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
@@ -11479,11 +11479,11 @@
11479
11479
  </xsl:template>
11480
11480
 
11481
11481
  <!-- figure/fn -->
11482
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
11482
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'fn']" priority="2"/>
11483
11483
  <!-- figure/note -->
11484
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
11484
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'note']" priority="2"/>
11485
11485
  <!-- figure/example -->
11486
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
11486
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'example']" priority="2"/>
11487
11487
 
11488
11488
  <!-- figure/note[@type = 'units'] -->
11489
11489
  <!-- image/note[@type = 'units'] -->
@@ -15024,6 +15024,9 @@
15024
15024
  <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
15025
15025
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
15026
15026
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
15027
+ <!-- https://github.com/metanorma/isodoc/issues/687 -->
15028
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_step1"/>
15029
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_pres"/>
15027
15030
 
15028
15031
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
15029
15032
  <xsl:copy>
@@ -15306,6 +15309,20 @@
15306
15309
  </xsl:element>
15307
15310
  </xsl:template>
15308
15311
 
15312
+ <xsl:template match="*[local-name() = 'fmt-source']"/>
15313
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_step1">
15314
+ <xsl:element name="source" namespace="{$namespace_full}">
15315
+ <xsl:copy-of select="@*"/>
15316
+ <xsl:apply-templates mode="update_xml_step1"/>
15317
+ </xsl:element>
15318
+ </xsl:template>
15319
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_pres">
15320
+ <xsl:element name="source" namespace="{$namespace_full}">
15321
+ <xsl:copy-of select="@*"/>
15322
+ <xsl:apply-templates mode="update_xml_pres"/>
15323
+ </xsl:element>
15324
+ </xsl:template>
15325
+
15309
15326
  <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
15310
15327
  <xsl:apply-templates mode="update_xml_step1"/>
15311
15328
  </xsl:template>
@@ -16665,6 +16682,12 @@
16665
16682
  </xsl:if>
16666
16683
  </xsl:template>
16667
16684
 
16685
+ <xsl:template name="setIDforNamedDestinationInline">
16686
+ <xsl:if test="@named_dest">
16687
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
16688
+ </xsl:if>
16689
+ </xsl:template>
16690
+
16668
16691
  <xsl:template name="setNamedDestination">
16669
16692
  <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
16670
16693
  <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
@@ -56,7 +56,7 @@ module IsoDoc
56
56
 
57
57
  def middle_title(isoxml)
58
58
  s = isoxml.at(ns("//sections")) or return
59
- isoxml.at(ns("//note[@type = 'title-footnote']"))
59
+ # isoxml.at(ns("//note[@type = 'title-footnote']"))
60
60
  case @doctype
61
61
  when "resolution"
62
62
  middle_title_resolution(isoxml, s.children.first)
@@ -102,7 +102,9 @@ module IsoDoc
102
102
  ret = ""
103
103
  isoxml.xpath(ns("//note[@type = 'title-footnote']"))
104
104
  .each_with_index do |f, i|
105
- ret += "<fn reference='H#{i}'>#{f.remove.children.to_xml}</fn>"
105
+ ret += <<~FN.strip
106
+ <fn id='_#{UUIDTools::UUID.random_create}' reference='H#{i}'>#{f.remove.children.to_xml}</fn>
107
+ FN
106
108
  end
107
109
  ret
108
110
  end
@@ -141,7 +141,7 @@ module IsoDoc
141
141
  def dl(xml)
142
142
  super
143
143
  (xml.xpath(ns("//dl")) -
144
- xml.xpath(ns("//table//dl | //figure//dl | //formula//dl")))
144
+ xml.xpath(ns("//table//dl | //figure//dl | //formula//dl | //dl//dl")))
145
145
  .each do |d|
146
146
  dl2(d)
147
147
  end
@@ -267,6 +267,10 @@ in a document (e.g. sourcecode annotations)</a:documentation>
267
267
  <value>justified</value>
268
268
  </choice>
269
269
  </define>
270
+ <define name="IdRefType">
271
+ <a:documentation>Type of cross-references to elements. In BasicDoc, these always point to id { xsd:ID } </a:documentation>
272
+ <data type="IDREF"/>
273
+ </define>
270
274
  <define name="RequiredId">
271
275
  <a:documentation>Mandatory anchor of element, to be used for cross-references within the document</a:documentation>
272
276
  <attribute name="id">
@@ -409,13 +413,13 @@ in a document (e.g. sourcecode annotations)</a:documentation>
409
413
  <attribute name="from">
410
414
  <a:documentation>Identifier for the start of the text or point in the text to which the comment applies.
411
415
  If not provided, the comment applies in the vicinity of the place it has been inserted into the text</a:documentation>
412
- <data type="IDREF"/>
416
+ <ref name="IdRefType"/>
413
417
  </attribute>
414
418
  </optional>
415
419
  <optional>
416
420
  <attribute name="to">
417
421
  <a:documentation>Identifier for the end of the text to which the comment applies</a:documentation>
418
- <data type="IDREF"/>
422
+ <ref name="IdRefType"/>
419
423
  </attribute>
420
424
  </optional>
421
425
  </define>
@@ -1504,7 +1508,7 @@ Restricted recursively to contain only other such inline elements with no identi
1504
1508
  <attribute name="to">
1505
1509
  <a:documentation>A reference to an anchor element (typically a bookmark),
1506
1510
  to indicate that the index range covers a range of locations between the current index element and the `to` anchor</a:documentation>
1507
- <data type="IDREF"/>
1511
+ <ref name="IdRefType"/>
1508
1512
  </attribute>
1509
1513
  </optional>
1510
1514
  <ref name="index-primary">
@@ -1662,7 +1666,7 @@ which can be bookmarks as well as block or section references</a:documentation>
1662
1666
  <define name="XrefAttributes">
1663
1667
  <attribute name="target">
1664
1668
  <a:documentation>The identifier of a section, block or inlined element being referenced</a:documentation>
1665
- <data type="IDREF"/>
1669
+ <ref name="IdRefType"/>
1666
1670
  </attribute>
1667
1671
  <optional>
1668
1672
  <attribute name="type">
@@ -1723,7 +1727,7 @@ The target of a footnote is the location it is embedded in within the text</a:do
1723
1727
  <attribute name="target">
1724
1728
  <a:documentation>The target of the callout is understood to be the location of the callout within the source code;
1725
1729
  the extent of the target is not expressed overtly</a:documentation>
1726
- <data type="IDREF"/>
1730
+ <ref name="IdRefType"/>
1727
1731
  </attribute>
1728
1732
  <text>
1729
1733
  <a:documentation>The label of the callout, used to identify its target within the source code</a:documentation>
@@ -67,13 +67,13 @@ module Metanorma
67
67
  # then title
68
68
  def sort_biblio_key(bib)
69
69
  pubclass = pub_class(bib)
70
- id = bib&.at("./docidentifier[not(#{skip_docid} or @type = " \
70
+ id = bib.at("./docidentifier[not(#{skip_docid} or @type = " \
71
71
  "'metanorma')]")
72
- metaid = bib&.at("./docidentifier[@type = 'metanorma']")&.text
73
- abbrid = metaid unless /^\[\d+\]$/.match?(metaid)
72
+ metaid = bib.at("./docidentifier[@type = 'metanorma']")&.text
73
+ #abbrid = metaid unless /^\[\d+\]$/.match?(metaid)
74
74
  type = id["type"] if id
75
- title = bib&.at("./title[@type = 'main']")&.text ||
76
- bib&.at("./title")&.text || bib&.at("./formattedref")&.text
75
+ title = bib.at("./title[@type = 'main']")&.text ||
76
+ bib.at("./title")&.text || bib.at("./formattedref")&.text
77
77
  "#{pubclass} :: #{type} :: #{id&.text || metaid} :: #{title}"
78
78
  end
79
79
 
@@ -26,7 +26,7 @@ module Metanorma
26
26
  insert_conventions(xml)
27
27
  end
28
28
 
29
- def add_id
29
+ def add_id_txt
30
30
  %(id="_#{UUIDTools::UUID.random_create}")
31
31
  end
32
32
 
@@ -38,7 +38,7 @@ module Metanorma
38
38
  ins = xml.at("//sections").elements.first
39
39
  xml.at("//sections/clause[@type = 'scope']") or
40
40
  ins.previous =
41
- "<clause type='scope' #{add_id}><title>#{@i18n.scope}</title><p>" \
41
+ "<clause type='scope' #{add_id_txt}><title>#{@i18n.scope}</title><p>" \
42
42
  "#{@i18n.clause_empty}</p></clause>"
43
43
  xml.at("//sentinel")&.remove
44
44
  end
@@ -49,7 +49,7 @@ module Metanorma
49
49
  "<bibliography><sentinel/></bibliography>"
50
50
  ins = xml.at("//bibliography").elements.first
51
51
  xml.at("//bibliography/references[@normative = 'true']") or
52
- ins.previous = "<references #{add_id} normative='true'>" \
52
+ ins.previous = "<references #{add_id_txt} normative='true'>" \
53
53
  "<title>#{@i18n.normref}</title></references>"
54
54
  xml.at("//sentinel")&.remove
55
55
  end
@@ -57,14 +57,14 @@ module Metanorma
57
57
  def insert_terms(xml)
58
58
  ins = xml.at("//sections/clause[@type = 'scope']")
59
59
  xml.at("//sections//terms") or
60
- ins.next = "<terms #{add_id}><title>#{@i18n.termsdef}</title></terms>"
60
+ ins.next = "<terms #{add_id_txt}><title>#{@i18n.termsdef}</title></terms>"
61
61
  end
62
62
 
63
63
  def insert_symbols(xml)
64
64
  ins = xml.at("//sections/terms") ||
65
65
  xml.at("//sections/clause[descendant::terms]")
66
66
  unless xml.at("//sections//definitions")
67
- ins.next = "<definitions #{add_id}>" \
67
+ ins.next = "<definitions #{add_id_txt}>" \
68
68
  "<title>#{@i18n.symbolsabbrev}</title></definitions>"
69
69
  end
70
70
  end
@@ -73,7 +73,7 @@ module Metanorma
73
73
  ins = xml.at("//sections//definitions") ||
74
74
  xml.at("//sections/clause[descendant::definitions]")
75
75
  unless xml.at("//sections/clause[@type = 'conventions']")
76
- ins.next = "<clause #{add_id} type='conventions'>" \
76
+ ins.next = "<clause #{add_id_txt} type='conventions'>" \
77
77
  "<title>#{@i18n.conventions}</title><p>" \
78
78
  "#{@i18n.clause_empty}</p></clause>"
79
79
  end
@@ -142,7 +142,7 @@ module Metanorma
142
142
  def sections_names_pref_cleanup(xml)
143
143
  super
144
144
  t = xml.at("//preface//abstract") or return
145
- t["id"] == "_summary" and
145
+ t["anchor"] == "_summary" and
146
146
  replace_title(xml, "//preface//abstract", @i18n&.summary)
147
147
  end
148
148
  end
@@ -40,14 +40,8 @@ module Metanorma
40
40
  @default_doctype = "recommendation"
41
41
  end
42
42
 
43
- def olist(node)
44
- id = Metanorma::Utils::anchor_or_uuid(node)
45
- noko do |xml|
46
- xml.ol **attr_code(id: id, class: node.attr("class")) do |xml_ol|
47
- list_caption(node, xml_ol)
48
- node.items.each { |item| li(xml_ol, item) }
49
- end
50
- end
43
+ def ol_attrs(node)
44
+ attr_code(id_attr(node).merge(class: node.attr("class")))
51
45
  end
52
46
 
53
47
  def outputs(node, ret)
@@ -105,8 +99,7 @@ module Metanorma
105
99
  end
106
100
 
107
101
  def metadata_keywords(node, xml)
108
- return unless node.attr("keywords")
109
-
102
+ node.attr("keywords") or return
110
103
  node.attr("keywords").split(/, */).sort.each_with_index do |kw, i|
111
104
  kw_out = i.zero? ? Metanorma::Utils.strict_capitalize_first(kw) : kw
112
105
  xml.keyword kw_out
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!-- VERSION v2.0.4 -->
3
+ <!-- VERSION v2.0.5 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -36,6 +36,12 @@
36
36
  </zeroOrMore>
37
37
  </element>
38
38
  </define>
39
+ <define name="IdRefType">
40
+ <a:documentation>Cross-references are not normalised to xsd:IDREF in Semantic XML: that is deferred to Presentation XML.
41
+ All IdRefType instances point not to `@id` in Semantic XML, which is the Content GUID for an element,
42
+ but to `@anchor`, the user-supplied cross-reference</a:documentation>
43
+ <text/>
44
+ </define>
39
45
  <define name="index-primary">
40
46
  <element name="primary">
41
47
  <oneOrMore>
@@ -238,7 +244,7 @@
238
244
  <a:documentation>Notes specific to this block</a:documentation>
239
245
  </ref>
240
246
  </zeroOrMore>
241
- <ref name="TermSource">
247
+ <ref name="BlockSource">
242
248
  <a:documentation>A source for the table</a:documentation>
243
249
  </ref>
244
250
  </define>
@@ -262,10 +268,112 @@ and is intended to be referenced by a callout within the source code</a:document
262
268
  <a:documentation>Notes whose scope is the current block</a:documentation>
263
269
  </ref>
264
270
  </zeroOrMore>
265
- <ref name="TermSource">
271
+ <ref name="BlockSource">
272
+ <a:documentation>A source for the block</a:documentation>
273
+ </ref>
274
+ </define>
275
+ <define name="FigureBody">
276
+ <optional>
277
+ <ref name="tname">
278
+ <a:documentation>The caption of the block</a:documentation>
279
+ </ref>
280
+ </optional>
281
+ <choice>
282
+ <a:documentation>Content of the figure</a:documentation>
283
+ <ref name="image"/>
284
+ <ref name="video"/>
285
+ <ref name="audio"/>
286
+ <ref name="pre"/>
287
+ <oneOrMore>
288
+ <ref name="paragraph-with-footnote"/>
289
+ </oneOrMore>
290
+ <zeroOrMore>
291
+ <ref name="figure"/>
292
+ </zeroOrMore>
293
+ </choice>
294
+ <zeroOrMore>
295
+ <ref name="fn">
296
+ <a:documentation>Footnotes specific to the figure</a:documentation>
297
+ </ref>
298
+ </zeroOrMore>
299
+ <optional>
300
+ <ref name="dl">
301
+ <a:documentation>An optional definitions list defining any symbols used in the figure</a:documentation>
302
+ </ref>
303
+ </optional>
304
+ <zeroOrMore>
305
+ <ref name="note">
306
+ <a:documentation>Notes whose scope is the current block</a:documentation>
307
+ </ref>
308
+ </zeroOrMore>
309
+ <ref name="BlockSource">
266
310
  <a:documentation>A source for the block</a:documentation>
267
311
  </ref>
268
312
  </define>
313
+ <define name="FigureNoIdBody">
314
+ <optional>
315
+ <ref name="source">
316
+ <a:documentation>A URI or other reference intended to link to an externally hosted image (or equivalent)</a:documentation>
317
+ </ref>
318
+ </optional>
319
+ <optional>
320
+ <ref name="tname">
321
+ <a:documentation>The caption of the block</a:documentation>
322
+ </ref>
323
+ </optional>
324
+ <choice>
325
+ <a:documentation>Content of the figure</a:documentation>
326
+ <ref name="image-no-id"/>
327
+ <ref name="video-no-id"/>
328
+ <ref name="audio-no-id"/>
329
+ <ref name="pre-no-id"/>
330
+ <oneOrMore>
331
+ <ref name="paragraph-with-footnote-no-id"/>
332
+ </oneOrMore>
333
+ <zeroOrMore>
334
+ <ref name="figure-no-id"/>
335
+ </zeroOrMore>
336
+ </choice>
337
+ <zeroOrMore>
338
+ <ref name="fn">
339
+ <a:documentation>Footnotes specific to the figure</a:documentation>
340
+ </ref>
341
+ </zeroOrMore>
342
+ <optional>
343
+ <ref name="dl-no-id">
344
+ <a:documentation>An optional definitions list defining any symbols used in the figure</a:documentation>
345
+ </ref>
346
+ </optional>
347
+ <zeroOrMore>
348
+ <ref name="note-no-id">
349
+ <a:documentation>Notes whose scope is the current block</a:documentation>
350
+ </ref>
351
+ </zeroOrMore>
352
+ <ref name="BlockSource">
353
+ <a:documentation>A source for the block</a:documentation>
354
+ </ref>
355
+ </define>
356
+ <define name="source">
357
+ <element name="source">
358
+ <attribute name="status">
359
+ <a:documentation>The status of the term as it is used in this document, relative to its definition in the original document</a:documentation>
360
+ <ref name="SourceStatusType"/>
361
+ </attribute>
362
+ <attribute name="type">
363
+ <a:documentation>The type of the managed term in the present context</a:documentation>
364
+ <ref name="SourceTypeType"/>
365
+ </attribute>
366
+ <ref name="origin">
367
+ <a:documentation>The original document and location where the term definition has been obtained from</a:documentation>
368
+ </ref>
369
+ <optional>
370
+ <ref name="modification">
371
+ <a:documentation>Any changes that the definition of the term has undergone relative to the original document,
372
+ in order to be applicable in this standardisation document</a:documentation>
373
+ </ref>
374
+ </optional>
375
+ </element>
376
+ </define>
269
377
  <define name="sourcecodebody">
270
378
  <a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
271
379
  (The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
@@ -687,6 +795,20 @@ titlecase, or lowercase</a:documentation>
687
795
  </attribute>
688
796
  </optional>
689
797
  </define>
798
+ <define name="RequiredId" combine="interleave">
799
+ <optional>
800
+ <attribute name="anchor">
801
+ <a:documentation>User-supplied anchor of element; replaced by content-based id, with all references to the anchor updated accordingly</a:documentation>
802
+ </attribute>
803
+ </optional>
804
+ </define>
805
+ <define name="OptionalId" combine="interleave">
806
+ <optional>
807
+ <attribute name="anchor">
808
+ <a:documentation> User-supplied anchor of element; replaced by content-based id, with all references to the anchor updated accordingly</a:documentation>
809
+ </attribute>
810
+ </optional>
811
+ </define>
690
812
  <define name="ObligationType">
691
813
  <a:documentation>The force of a clause in a standard document: whether it has normative or informative effect</a:documentation>
692
814
  <choice>
@@ -1081,7 +1203,7 @@ That concept may be defined as a term within the current document, or it may be
1081
1203
  <element name="label">
1082
1204
  <!-- Identifier of form input element that this element is a label of -->
1083
1205
  <attribute name="for">
1084
- <data type="IDREF"/>
1206
+ <ref name="IdRefType"/>
1085
1207
  </attribute>
1086
1208
  <zeroOrMore>
1087
1209
  <ref name="PureTextElement"/>
@@ -2121,7 +2243,7 @@ used in document amendments</a:documentation>
2121
2243
  </define>
2122
2244
  <define name="termsource">
2123
2245
  <a:documentation>The bibliographic source where a term is defined in the sense applicable in this standardisation document</a:documentation>
2124
- <element name="termsource">
2246
+ <element name="source">
2125
2247
  <attribute name="status">
2126
2248
  <a:documentation>The status of the term as it is used in this document, relative to its definition in the original document</a:documentation>
2127
2249
  <ref name="SourceStatusType"/>
@@ -2503,6 +2625,11 @@ Normative References contents contain normative references, but as a clause in t
2503
2625
  <ref name="termsource"/>
2504
2626
  </zeroOrMore>
2505
2627
  </define>
2628
+ <define name="BlockSource">
2629
+ <zeroOrMore>
2630
+ <ref name="source"/>
2631
+ </zeroOrMore>
2632
+ </define>
2506
2633
  <start>
2507
2634
  <ref name="standard-document"/>
2508
2635
  </start>
@@ -3,7 +3,6 @@ require "metanorma/processor"
3
3
  module Metanorma
4
4
  module Itu
5
5
  class Processor < Metanorma::Processor
6
-
7
6
  def initialize
8
7
  @short = :itu
9
8
  @input_format = :asciidoc
@@ -14,7 +13,7 @@ module Metanorma
14
13
  super.merge(
15
14
  html: "html",
16
15
  doc: "doc",
17
- pdf: "pdf"
16
+ pdf: "pdf",
18
17
  )
19
18
  end
20
19
 
@@ -33,21 +32,22 @@ module Metanorma
33
32
  "Metanorma::Itu #{Metanorma::Itu::VERSION}"
34
33
  end
35
34
 
36
- def output(isodoc_node, inname, outname, format, options={})
35
+ def output(isodoc_node, inname, outname, format, options = {})
37
36
  options_preprocess(options)
38
37
  case format
39
38
  when :html
40
- IsoDoc::Itu::HtmlConvert.new(options).convert(inname, isodoc_node,
39
+ IsoDoc::Itu::HtmlConvert.new(options).convert(inname, isodoc_node,
41
40
  nil, outname)
42
41
  when :doc
43
- IsoDoc::Itu::WordConvert.new(options).convert(inname, isodoc_node,
42
+ IsoDoc::Itu::WordConvert.new(options).convert(inname, isodoc_node,
44
43
  nil, outname)
45
44
  when :pdf
46
- IsoDoc::Itu::PdfConvert.new(options).convert(inname, isodoc_node,
45
+ IsoDoc::Itu::PdfConvert.new(options).convert(inname, isodoc_node,
47
46
  nil, outname)
48
47
  when :presentation
49
48
  IsoDoc::Itu::PresentationXMLConvert.new(options).convert(
50
- inname, isodoc_node, nil, outname)
49
+ inname, isodoc_node, nil, outname
50
+ )
51
51
  else
52
52
  super
53
53
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Itu
3
- VERSION = "2.6.5".freeze
3
+ VERSION = "2.6.6".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-itu
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.5
4
+ version: 2.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-04-29 00:00:00.000000000 Z
11
+ date: 2025-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc