metanorma-itu 2.5.12 → 2.5.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -53,6 +53,7 @@ module IsoDoc
53
53
  id = multi_bibitem_ref_code(bib)
54
54
  id1 = render_multi_identifiers(id, bib)
55
55
  out = id1
56
+ out.empty? and return out
56
57
  date = bib.at(ns("./date[@type = 'published']/on | " \
57
58
  "./date[@type = 'published']/from")) and
58
59
  out << " (#{date.text.sub(/-.*$/, '')})"
@@ -79,9 +80,9 @@ module IsoDoc
79
80
 
80
81
  def norm_ref_entry_code(_ordinal, idents, _ids, _standard, datefn, _bib)
81
82
  ret = (idents[:metanorma] || idents[:ordinal] || idents[:sdo]).to_s
83
+ ret.empty? and return ret
82
84
  /^\[.+\]$/.match?(ret) or ret = "[#{ret}]"
83
85
  ret += datefn
84
- ret.empty? and return ret
85
86
  ret.gsub("-", "&#x2011;").gsub(/ /, "&#xa0;")
86
87
  end
87
88
 
@@ -94,7 +95,7 @@ module IsoDoc
94
95
  end
95
96
 
96
97
  def bracket_if_num(num)
97
- return nil if num.nil?
98
+ return nil if num.nil? || num.text.strip.empty?
98
99
 
99
100
  num = num.text.sub(/^\[/, "").sub(/\]$/, "")
100
101
  "[#{num}]"
@@ -40,14 +40,22 @@ module IsoDoc
40
40
  def designation1(desgn)
41
41
  super
42
42
  desgn.name == "preferred" or return
43
- desgn.children = l10n "#{to_xml desgn.children}:"
43
+ out = desgn.parent
44
+ .at(ns("./fmt-preferred//semx[@element = 'preferred'][last()]"))
45
+ out or return
46
+ out.text.strip.empty? and return
47
+ out.children = l10n "#{to_xml out.children}:"
44
48
  end
45
49
 
46
- def termsource1(elem)
47
- while elem&.next_element&.name == "termsource"
48
- elem << "; #{to_xml(elem.next_element.remove.children)}"
50
+ def designation(docxml)
51
+ super
52
+ docxml.xpath(ns("//fmt-preferred")).each do |x|
53
+ x.xpath(ns("./p")).each { |p| p.replace(p.children) }
49
54
  end
50
- elem.children = l10n(to_xml(elem.children).strip)
55
+ end
56
+
57
+ def termsource_label(elem, sources)
58
+ elem.replace(sources)
51
59
  end
52
60
 
53
61
  def eref1(elem)
@@ -6,7 +6,7 @@ module IsoDoc
6
6
  p.b do |b|
7
7
  node&.at(ns("./fmt-name"))&.children&.each { |n| parse(n, b) }
8
8
  insert_tab(b, 1)
9
- node&.at(ns("./preferred"))&.children&.each { |n| parse(n, b) }
9
+ node&.at(ns("./fmt-preferred"))&.children&.each { |n| parse(n, b) }
10
10
  end
11
11
  source and p << "#{source.value} "
12
12
  end
@@ -14,12 +14,12 @@ module IsoDoc
14
14
  end
15
15
 
16
16
  def termdef_parse(node, out)
17
- defn = node.at(ns("./definition"))
18
- source = node.at(ns("./termsource/origin/@citeas"))
17
+ defn = node.at(ns("./fmt-definition"))
18
+ source = node.at(ns("./fmt-termsource//origin/@citeas"))
19
19
  out.div **attr_code(id: node["id"]) do |div|
20
20
  termdef_parse1(node, div, defn, source)
21
21
  node.children.each do |n|
22
- next if %w(preferred definition termsource fmt-title
22
+ next if %w(fmt-preferred fmt-definition fmt-termsource fmt-title
23
23
  fmt-name).include? n.name
24
24
 
25
25
  parse(n, out)
@@ -267,11 +267,11 @@ Detailed in https://www.relaton.org/model/creator/</a:documentation>
267
267
  <a:documentation>An identifier of the person according to an international identifier scheme</a:documentation>
268
268
  </ref>
269
269
  </zeroOrMore>
270
- <zeroOrMore>
270
+ <optional>
271
271
  <ref name="contact">
272
272
  <a:documentation>Contact information for the person, including URI, address, phone number, and email</a:documentation>
273
273
  </ref>
274
- </zeroOrMore>
274
+ </optional>
275
275
  </element>
276
276
  </define>
277
277
  <define name="fullname">
@@ -454,11 +454,11 @@ real names (if the person is named with a pseudonym or user name); previous lega
454
454
  <a:documentation>An identifier of the organization according to an international identifier scheme</a:documentation>
455
455
  </ref>
456
456
  </zeroOrMore>
457
- <zeroOrMore>
457
+ <optional>
458
458
  <ref name="contact">
459
459
  <a:documentation>Contact information for the organization, including address, phone number, and email</a:documentation>
460
460
  </ref>
461
- </zeroOrMore>
461
+ </optional>
462
462
  <optional>
463
463
  <ref name="logo">
464
464
  <a:documentation>A logo for the organization</a:documentation>
@@ -540,12 +540,18 @@ real names (if the person is named with a pseudonym or user name); previous lega
540
540
  <!-- TODO may change -->
541
541
  <define name="contact">
542
542
  <a:documentation>Contact information for a person or organization</a:documentation>
543
- <choice>
543
+ <zeroOrMore>
544
544
  <ref name="address"/>
545
+ </zeroOrMore>
546
+ <zeroOrMore>
545
547
  <ref name="phone"/>
548
+ </zeroOrMore>
549
+ <zeroOrMore>
546
550
  <ref name="email"/>
551
+ </zeroOrMore>
552
+ <zeroOrMore>
547
553
  <ref name="uri"/>
548
- </choice>
554
+ </zeroOrMore>
549
555
  </define>
550
556
  <define name="phone">
551
557
  <a:documentation>The phone number associated with a person or organization</a:documentation>
@@ -1271,17 +1277,17 @@ for which this claim of validity is made, if applicable</a:documentation>
1271
1277
  </define>
1272
1278
  <define name="validityBegins">
1273
1279
  <element name="validityBegins">
1274
- <ref name="ISO8601DateTime"/>
1280
+ <ref name="ISO8601Date"/>
1275
1281
  </element>
1276
1282
  </define>
1277
1283
  <define name="validityEnds">
1278
1284
  <element name="validityEnds">
1279
- <ref name="ISO8601DateTime"/>
1285
+ <ref name="ISO8601Date"/>
1280
1286
  </element>
1281
1287
  </define>
1282
1288
  <define name="validityRevision">
1283
1289
  <element name="revision">
1284
- <ref name="ISO8601DateTime"/>
1290
+ <ref name="ISO8601Date"/>
1285
1291
  </element>
1286
1292
  </define>
1287
1293
  <define name="TypedTitleString">
@@ -18,6 +18,7 @@
18
18
  <value>service-publication</value>
19
19
  <value>handbook</value>
20
20
  <value>question</value>
21
+ <value>contribution</value>
21
22
  </choice>
22
23
  </define>
23
24
  <define name="editorialgroup">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Itu
3
- VERSION = "2.5.12".freeze
3
+ VERSION = "2.5.13".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.5.12
4
+ version: 2.5.13
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-01-07 00:00:00.000000000 Z
11
+ date: 2025-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc