metanorma-iec 2.6.7 → 2.6.8

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.
@@ -136,11 +136,12 @@ module IsoDoc
136
136
  )
137
137
  pr.empty? and return
138
138
  prefs = pr.map do |p|
139
- "<dt>#{p[:lang]}</dt>" \
140
- "<dd language='#{p[:lang]}' script='#{p[:script]}'>" \
141
- "#{cleanup_entities(p[:designation])}</dd>"
139
+ <<~XML
140
+ <dt>#{p[:lang]}</dt>
141
+ <dd #{add_id_text} language='#{p[:lang]}' script='#{p[:script]}'>#{cleanup_entities(p[:designation])}</dd>
142
+ XML
142
143
  end
143
- term << "<dl type='other-lang'>#{prefs.join}</dl>"
144
+ term << "<dl #{add_id_text} type='other-lang'>#{prefs.join}</dl>"
144
145
  end
145
146
 
146
147
  def remove_otherlang_designations1(term, lgs)
@@ -14,12 +14,6 @@ module IsoDoc
14
14
  @i18n_lg["default"] = @i18n
15
15
  end
16
16
 
17
- # KILL
18
- def clausex(docxml)
19
- super
20
- docxml.xpath(ns("//terms")).each { |f| termclause1(f) }
21
- end
22
-
23
17
  def clause1(elem)
24
18
  if elem.name == "terms" && @is_iev then iev_termclause1(elem)
25
19
  else
@@ -57,7 +51,7 @@ module IsoDoc
57
51
  unless f = docxml.at(ns("//preface/foreword"))
58
52
  ins = toc_title_insert_pt(docxml)
59
53
  f = ins.before(<<~CLAUSE).previous_element
60
- <foreword id='_#{UUIDTools::UUID.random_create}'> </foreword>
54
+ <foreword #{add_id_text}> </foreword>
61
55
  CLAUSE
62
56
  end
63
57
  insert_foreword_boilerplate(f, b)
@@ -67,7 +61,7 @@ module IsoDoc
67
61
  elem.children.empty? and elem.children = " "
68
62
  ins = elem.at(ns("./title")) || elem.children.first.before(" ").previous
69
63
  ins.next = <<~CLAUSE
70
- <clause type='boilerplate_legal'>#{to_xml(boilerplate.children)}</clause>
64
+ <clause type='boilerplate_legal' #{add_id_text}>#{to_xml(boilerplate.children)}</clause>
71
65
  CLAUSE
72
66
  end
73
67
 
@@ -145,7 +145,7 @@ module Metanorma
145
145
  m = /60050-(\d+)/.match(id) or return
146
146
  xmldoc.xpath("//sections/clause/terms/title").each_with_index do |t, i|
147
147
  num = "%02d" % [i + 1]
148
- t.next = "<variant-title type='toc'>" \
148
+ t.next = "<variant-title #{add_id_text} type='toc'>" \
149
149
  "#{@i18n.section_iev} #{m[1]}-#{num} &#x2013; " \
150
150
  "#{t.children.to_xml}</variant-title>"
151
151
  end
@@ -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.6 -->
3
+ <!-- VERSION v2.0.7 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -76,6 +76,7 @@ but to `@anchor`, the user-supplied cross-reference</a:documentation>
76
76
  <a:documentation>Title(s) of a clause</a:documentation>
77
77
  <element name="title">
78
78
  <a:documentation>Title proper for a clause</a:documentation>
79
+ <ref name="RequiredId"/>
79
80
  <zeroOrMore>
80
81
  <ref name="TextElement"/>
81
82
  </zeroOrMore>
@@ -83,10 +84,19 @@ but to `@anchor`, the user-supplied cross-reference</a:documentation>
83
84
  <zeroOrMore>
84
85
  <element name="variant-title">
85
86
  <a:documentation>Alternate title for a clause</a:documentation>
87
+ <ref name="RequiredId"/>
86
88
  <ref name="TypedTitleString"/>
87
89
  </element>
88
90
  </zeroOrMore>
89
91
  </define>
92
+ <define name="tname">
93
+ <element name="name">
94
+ <ref name="RequiredId"/>
95
+ <oneOrMore>
96
+ <ref name="NestedTextElement"/>
97
+ </oneOrMore>
98
+ </element>
99
+ </define>
90
100
  <define name="UlBody">
91
101
  <optional>
92
102
  <ref name="tname">
@@ -475,6 +485,7 @@ normative or informative references, some split references into sections organiz
475
485
  <!-- exclude figures? -->
476
486
  <define name="dd">
477
487
  <element name="dd">
488
+ <ref name="OptionalId"/>
478
489
  <zeroOrMore>
479
490
  <!-- exclude figures? -->
480
491
  <ref name="BasicBlock"/>
@@ -526,6 +537,7 @@ normative or informative references, some split references into sections organiz
526
537
  </choice>
527
538
  </define>
528
539
  <define name="TrAttributes">
540
+ <ref name="OptionalId"/>
529
541
  <optional>
530
542
  <attribute name="style">
531
543
  <a:documentation>CSS style: only background-color supported</a:documentation>
@@ -595,6 +607,7 @@ gives an explicit page orientation</a:documentation>
595
607
  </include>
596
608
  <!-- end overrides -->
597
609
  <define name="FnAttributes" combine="interleave">
610
+ <ref name="RequiredId"/>
598
611
  <optional>
599
612
  <attribute name="hiddenref">
600
613
  <a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
@@ -604,6 +617,7 @@ This is done if the footnote reference is already presented in some other form,
604
617
  </optional>
605
618
  </define>
606
619
  <define name="TdAttributes" combine="interleave">
620
+ <ref name="RequiredId"/>
607
621
  <optional>
608
622
  <attribute name="style">
609
623
  <a:documentation>CSS style: only background-color supported</a:documentation>
@@ -1821,7 +1835,7 @@ used in document amendments</a:documentation>
1821
1835
  </element>
1822
1836
  </define>
1823
1837
  <define name="TermAttributes">
1824
- <ref name="OptionalId"/>
1838
+ <ref name="RequiredId"/>
1825
1839
  <ref name="LocalizedStringAttributes"/>
1826
1840
  <ref name="BlockAttributes"/>
1827
1841
  </define>
@@ -2164,6 +2178,7 @@ used in document amendments</a:documentation>
2164
2178
  <define name="termdefinition">
2165
2179
  <a:documentation>The definition of a term applied in the current document</a:documentation>
2166
2180
  <element name="definition">
2181
+ <ref name="RequiredId"/>
2167
2182
  <optional>
2168
2183
  <attribute name="type">
2169
2184
  <a:documentation>Type of definition, used to differentiate it from other definitions of the same term if present</a:documentation>
@@ -2185,6 +2200,7 @@ used in document amendments</a:documentation>
2185
2200
  </define>
2186
2201
  <define name="verbaldefinition">
2187
2202
  <element name="verbal-definition">
2203
+ <ref name="RequiredId"/>
2188
2204
  <oneOrMore>
2189
2205
  <choice>
2190
2206
  <a:documentation>Content of the verbal representation of the term</a:documentation>
@@ -2205,6 +2221,7 @@ used in document amendments</a:documentation>
2205
2221
  <define name="nonverbalrep">
2206
2222
  <a:documentation>Non-verbal representation of the term</a:documentation>
2207
2223
  <element name="non-verbal-representation">
2224
+ <ref name="RequiredId"/>
2208
2225
  <oneOrMore>
2209
2226
  <choice>
2210
2227
  <a:documentation>Content of the non-verbal representation of the term</a:documentation>
@@ -37,17 +37,17 @@ module Metanorma
37
37
  options_preprocess(options)
38
38
  case format
39
39
  when :html
40
- IsoDoc::Iec::HtmlConvert.new(options).convert(inname, isodoc_node,
41
- nil, outname)
40
+ IsoDoc::Iec::HtmlConvert.new(options)
41
+ .convert(inname, isodoc_node, nil, outname)
42
42
  when :doc
43
- IsoDoc::Iec::WordConvert.new(options).convert(inname, isodoc_node,
44
- nil, outname)
43
+ IsoDoc::Iec::WordConvert.new(options)
44
+ .convert(inname, isodoc_node, nil, outname)
45
45
  when :pdf
46
- IsoDoc::Iec::PdfConvert.new(options).convert(inname, isodoc_node,
47
- nil, outname)
46
+ IsoDoc::Iec::PdfConvert.new(options)
47
+ .convert(inname, isodoc_node, nil, outname)
48
48
  when :sts
49
- IsoDoc::Iso::StsConvert.new(options).convert(inname, isodoc_node,
50
- nil, outname)
49
+ IsoDoc::Iso::StsConvert.new(options)
50
+ .convert(inname, isodoc_node, nil, outname)
51
51
  when :presentation
52
52
  IsoDoc::Iec::PresentationXMLConvert.new(options)
53
53
  .convert(inname, isodoc_node, nil, outname)
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.6.7".freeze
3
+ VERSION = "2.6.8".freeze
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.7
4
+ version: 2.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-26 00:00:00.000000000 Z
11
+ date: 2025-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso