metanorma-iec 2.1.10 → 2.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/iec/html/htmlstyle.css +1 -1
  3. data/lib/isodoc/iec/html/htmlstyle.scss +1 -1
  4. data/lib/isodoc/iec/iec.international-standard.xsl +289 -103
  5. data/lib/isodoc/iec/presentation_xml_convert.rb +8 -6
  6. data/lib/metanorma/iec/basicdoc.rng +0 -27
  7. data/lib/metanorma/iec/biblio-standoc.rng +164 -0
  8. data/lib/metanorma/iec/biblio.rng +50 -18
  9. data/lib/metanorma/iec/iec.rng +1 -100
  10. data/lib/metanorma/iec/iec_intro_en.xml +11 -12
  11. data/lib/metanorma/iec/iec_intro_fr.xml +11 -11
  12. data/lib/metanorma/iec/isodoc.rng +68 -206
  13. data/lib/metanorma/iec/isostandard.rng +0 -194
  14. data/lib/metanorma/iec/relaton-iec.rng +284 -0
  15. data/lib/metanorma/iec/version.rb +1 -1
  16. data/metanorma-iec.gemspec +5 -2
  17. metadata +6 -35
  18. data/.github/workflows/rake.yml +0 -15
  19. data/.github/workflows/release.yml +0 -24
  20. data/Rakefile +0 -8
  21. data/bin/rspec +0 -18
  22. data/spec/assets/header.html +0 -7
  23. data/spec/assets/html.css +0 -2
  24. data/spec/assets/iso.xml +0 -71
  25. data/spec/assets/rice_image1.png +0 -0
  26. data/spec/assets/word.css +0 -2
  27. data/spec/assets/wordintro.html +0 -4
  28. data/spec/assets/xref_error.adoc +0 -7
  29. data/spec/isodoc/blocks_spec.rb +0 -200
  30. data/spec/isodoc/i18n_spec.rb +0 -607
  31. data/spec/isodoc/iev_spec.rb +0 -888
  32. data/spec/isodoc/inline_spec.rb +0 -293
  33. data/spec/isodoc/iso_spec.rb +0 -211
  34. data/spec/isodoc/metadata_spec.rb +0 -251
  35. data/spec/isodoc/postproc_spec.rb +0 -303
  36. data/spec/isodoc/ref_spec.rb +0 -335
  37. data/spec/isodoc/section_spec.rb +0 -566
  38. data/spec/isodoc/terms_spec.rb +0 -192
  39. data/spec/metanorma/base_spec.rb +0 -1041
  40. data/spec/metanorma/blocks_spec.rb +0 -470
  41. data/spec/metanorma/cleanup_spec.rb +0 -372
  42. data/spec/metanorma/iev_spec.rb +0 -254
  43. data/spec/metanorma/inline_spec.rb +0 -145
  44. data/spec/metanorma/lists_spec.rb +0 -194
  45. data/spec/metanorma/processor_spec.rb +0 -171
  46. data/spec/metanorma/section_spec.rb +0 -348
  47. data/spec/metanorma/validate_spec.rb +0 -56
  48. data/spec/spec_helper.rb +0 -305
@@ -13,10 +13,12 @@ module IsoDoc
13
13
  end
14
14
 
15
15
  def clause(docxml)
16
- docxml.xpath(ns("//clause[not(ancestor::annex)] | "\
17
- "//definitions | //references | "\
16
+ docxml.xpath(ns("//clause[not(ancestor::annex)] | " \
17
+ "//definitions | //references | " \
18
18
  "//preface/introduction[clause]"))
19
19
  .each do |f|
20
+ f.parent.name == "annex" &&
21
+ @xrefs.klass.single_term_clause?(f.parent) and next
20
22
  clause1(f)
21
23
  end
22
24
  docxml.xpath(ns("//terms")).each do |f|
@@ -63,7 +65,7 @@ module IsoDoc
63
65
  labels = @xrefs.get_anchors.each_with_object({}) do |(k, v), m|
64
66
  m[v[:label]] = k
65
67
  end
66
- docpart = docxml&.at(ns("//bibdata/ext/structuredidentifier/"\
68
+ docpart = docxml&.at(ns("//bibdata/ext/structuredidentifier/" \
67
69
  "project-number/@part"))&.text or return
68
70
  docxml.xpath(ns("//termref[@base = 'IEV']")).each do |t|
69
71
  concept_iev1(t, docpart, labels)
@@ -155,8 +157,8 @@ module IsoDoc
155
157
  return if pr.empty?
156
158
 
157
159
  prefs = pr.map do |p|
158
- "<dt>#{p[:lang]}</dt>"\
159
- "<dd language='#{p[:lang]}' script='#{p[:script]}'>"\
160
+ "<dt>#{p[:lang]}</dt>" \
161
+ "<dd language='#{p[:lang]}' script='#{p[:script]}'>" \
160
162
  "#{cleanup_entities(p[:designation])}</dd>"
161
163
  end
162
164
  term << "<dl type='other-lang'>#{prefs.join}</dl>"
@@ -180,7 +182,7 @@ module IsoDoc
180
182
  p = node.at(ns("./preferred"))
181
183
  ref = node.at(ns("./xref | ./eref | ./termref"))
182
184
  label = @i18n.relatedterms[node["type"]].upcase
183
- node.replace(l10n("<p>#{label}: "\
185
+ node.replace(l10n("<p>#{label}: " \
184
186
  "#{p.children.to_xml} (#{ref.to_xml})</p>"))
185
187
  @i18n = @i18n_lg["default"]
186
188
  end
@@ -1,10 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <include href="biblio.rng">
4
- <start>
5
- <ref name="document"/>
6
- </start>
7
- </include>
8
3
  <define name="document">
9
4
  <element name="document">
10
5
  <optional>
@@ -1125,26 +1120,4 @@
1125
1120
  </zeroOrMore>
1126
1121
  </element>
1127
1122
  </define>
1128
- <define name="ext">
1129
- <element name="ext">
1130
- <ref name="BibDataExtensionType"/>
1131
- </element>
1132
- </define>
1133
- <define name="BibDataExtensionType">
1134
- <ref name="doctype"/>
1135
- </define>
1136
- <define name="doctype">
1137
- <element name="doctype">
1138
- <ref name="DocumentType"/>
1139
- </element>
1140
- </define>
1141
- <define name="DocumentType">
1142
- <value>document</value>
1143
- </define>
1144
- <define name="BibData">
1145
- <ref name="BibliographicItem"/>
1146
- <optional>
1147
- <ref name="ext"/>
1148
- </optional>
1149
- </define>
1150
1123
  </grammar>
@@ -0,0 +1,164 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0">
3
+ <!--
4
+ Add-ons to biblio.rnc for standoc model: defines the extension point BibDataExtensionType
5
+ of relaton
6
+
7
+ Specialisations as for biblio.rnc. Extension point can be redefined completely for a flavour of standoc
8
+ (SDO); but other elements in Bibdata can only be extended (more specialised vocabularies for Bibdata)
9
+ -->
10
+ <include href="biblio.rng">
11
+ <define name="BibData">
12
+ <ref name="BibliographicItem"/>
13
+ <optional>
14
+ <ref name="ext"/>
15
+ </optional>
16
+ </define>
17
+ </include>
18
+ <define name="ext">
19
+ <element name="ext">
20
+ <ref name="BibDataExtensionType"/>
21
+ </element>
22
+ </define>
23
+ <define name="BibDataExtensionType">
24
+ <optional>
25
+ <attribute name="schema-version"/>
26
+ </optional>
27
+ <ref name="doctype"/>
28
+ <optional>
29
+ <ref name="docsubtype"/>
30
+ </optional>
31
+ <optional>
32
+ <ref name="editorialgroup"/>
33
+ </optional>
34
+ <zeroOrMore>
35
+ <ref name="ics"/>
36
+ </zeroOrMore>
37
+ <zeroOrMore>
38
+ <ref name="structuredidentifier"/>
39
+ </zeroOrMore>
40
+ </define>
41
+ <define name="doctype">
42
+ <element name="doctype">
43
+ <optional>
44
+ <attribute name="abbreviation"/>
45
+ </optional>
46
+ <ref name="DocumentType"/>
47
+ </element>
48
+ </define>
49
+ <define name="DocumentType">
50
+ <value>document</value>
51
+ </define>
52
+ <define name="docsubtype">
53
+ <element name="subdoctype">
54
+ <ref name="DocumentSubtype"/>
55
+ </element>
56
+ </define>
57
+ <define name="DocumentSubtype">
58
+ <text/>
59
+ </define>
60
+ <define name="editorialgroup">
61
+ <element name="editorialgroup">
62
+ <oneOrMore>
63
+ <ref name="technical-committee"/>
64
+ </oneOrMore>
65
+ </element>
66
+ </define>
67
+ <define name="technical-committee">
68
+ <element name="technical-committee">
69
+ <ref name="IsoWorkgroup"/>
70
+ </element>
71
+ </define>
72
+ <define name="IsoWorkgroup">
73
+ <optional>
74
+ <attribute name="number"/>
75
+ </optional>
76
+ <optional>
77
+ <attribute name="type"/>
78
+ </optional>
79
+ <optional>
80
+ <attribute name="identifier"/>
81
+ </optional>
82
+ <optional>
83
+ <attribute name="prefix"/>
84
+ </optional>
85
+ <text/>
86
+ </define>
87
+ <define name="ics">
88
+ <element name="ics">
89
+ <element name="code">
90
+ <text/>
91
+ </element>
92
+ <optional>
93
+ <element name="text">
94
+ <text/>
95
+ </element>
96
+ </optional>
97
+ </element>
98
+ </define>
99
+ <define name="structuredidentifier">
100
+ <element name="structuredidentifier">
101
+ <optional>
102
+ <attribute name="type"/>
103
+ </optional>
104
+ <oneOrMore>
105
+ <element name="agency">
106
+ <text/>
107
+ </element>
108
+ </oneOrMore>
109
+ <optional>
110
+ <element name="class">
111
+ <text/>
112
+ </element>
113
+ </optional>
114
+ <element name="docnumber">
115
+ <text/>
116
+ </element>
117
+ <optional>
118
+ <element name="partnumber">
119
+ <text/>
120
+ </element>
121
+ </optional>
122
+ <optional>
123
+ <element name="edition">
124
+ <text/>
125
+ </element>
126
+ </optional>
127
+ <optional>
128
+ <element name="version">
129
+ <text/>
130
+ </element>
131
+ </optional>
132
+ <optional>
133
+ <element name="supplementtype">
134
+ <text/>
135
+ </element>
136
+ </optional>
137
+ <optional>
138
+ <element name="supplementnumber">
139
+ <text/>
140
+ </element>
141
+ </optional>
142
+ <optional>
143
+ <element name="amendment">
144
+ <text/>
145
+ </element>
146
+ </optional>
147
+ <optional>
148
+ <element name="corrigendum">
149
+ <text/>
150
+ </element>
151
+ </optional>
152
+ <optional>
153
+ <element name="language">
154
+ <text/>
155
+ </element>
156
+ </optional>
157
+ <optional>
158
+ <element name="year">
159
+ <text/>
160
+ </element>
161
+ </optional>
162
+ </element>
163
+ </define>
164
+ </grammar>
@@ -33,9 +33,10 @@
33
33
  <param name="pattern">([\+\-]?\d{4})((-?)((0[1-9]|1[0-2])((-?)([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6]))))?</param>
34
34
  </data>
35
35
  </define>
36
- <start>
37
- <ref name="bibitem"/>
38
- </start>
36
+ <!-- start = bibitem -->
37
+ <define name="BibData">
38
+ <ref name="BibliographicItem"/>
39
+ </define>
39
40
  <define name="status">
40
41
  <element name="status">
41
42
  <ref name="stage"/>
@@ -170,27 +171,30 @@
170
171
  </define>
171
172
  <define name="contributor">
172
173
  <element name="contributor">
173
- <zeroOrMore>
174
+ <oneOrMore>
174
175
  <ref name="role"/>
175
- </zeroOrMore>
176
+ </oneOrMore>
176
177
  <ref name="ContributorInfo"/>
177
178
  </element>
178
179
  </define>
179
180
  <define name="role">
180
181
  <element name="role">
181
- <optional>
182
- <attribute name="type">
183
- <choice>
184
- <value>author</value>
185
- <value>performer</value>
186
- <value>publisher</value>
187
- <value>editor</value>
188
- <value>adapter</value>
189
- <value>translator</value>
190
- <value>distributor</value>
191
- </choice>
192
- </attribute>
193
- </optional>
182
+ <attribute name="type">
183
+ <choice>
184
+ <value>author</value>
185
+ <value>performer</value>
186
+ <value>publisher</value>
187
+ <value>editor</value>
188
+ <value>adapter</value>
189
+ <value>translator</value>
190
+ <value>distributor</value>
191
+ <value>realizer</value>
192
+ <value>owner</value>
193
+ <value>authorizer</value>
194
+ <value>enabler</value>
195
+ <value>subject</value>
196
+ </choice>
197
+ </attribute>
194
198
  <zeroOrMore>
195
199
  <ref name="roledescription"/>
196
200
  </zeroOrMore>
@@ -512,6 +516,17 @@
512
516
  </define>
513
517
  <define name="localityStack">
514
518
  <element name="localityStack">
519
+ <optional>
520
+ <attribute name="connective">
521
+ <choice>
522
+ <value>and</value>
523
+ <value>or</value>
524
+ <value>from</value>
525
+ <value>to</value>
526
+ <value/>
527
+ </choice>
528
+ </attribute>
529
+ </optional>
515
530
  <zeroOrMore>
516
531
  <ref name="locality"/>
517
532
  </zeroOrMore>
@@ -524,6 +539,17 @@
524
539
  </define>
525
540
  <define name="sourceLocalityStack">
526
541
  <element name="sourceLocalityStack">
542
+ <optional>
543
+ <attribute name="connective">
544
+ <choice>
545
+ <value>and</value>
546
+ <value>or</value>
547
+ <value>from</value>
548
+ <value>to</value>
549
+ <value/>
550
+ </choice>
551
+ </attribute>
552
+ </optional>
527
553
  <zeroOrMore>
528
554
  <ref name="sourceLocality"/>
529
555
  </zeroOrMore>
@@ -626,6 +652,9 @@
626
652
  <ref name="BibItemType"/>
627
653
  </attribute>
628
654
  </optional>
655
+ <optional>
656
+ <attribute name="schema-version"/>
657
+ </optional>
629
658
  <optional>
630
659
  <ref name="fetched"/>
631
660
  </optional>
@@ -720,6 +749,9 @@
720
749
  <ref name="BibItemType"/>
721
750
  </attribute>
722
751
  </optional>
752
+ <optional>
753
+ <attribute name="schema-version"/>
754
+ </optional>
723
755
  <optional>
724
756
  <ref name="fetched"/>
725
757
  </optional>
@@ -1,63 +1,11 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar ns="https://www.metanorma.org/ns/iec" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
3
  <!-- default namespace = "https://www.metanorma.com/ns/iec" -->
4
+ <include href="relaton-iec.rng"/>
4
5
  <include href="isostandard.rng">
5
6
  <start>
6
7
  <ref name="iec-standard"/>
7
8
  </start>
8
- <define name="DocumentType">
9
- <choice>
10
- <value>international-standard</value>
11
- <value>technical-specification</value>
12
- <value>technical-report</value>
13
- <value>publicly-available-specification</value>
14
- <value>international-workshop-agreement</value>
15
- <value>guide</value>
16
- <value>industry-technical-agreement</value>
17
- <value>system-reference-delivrabble</value>
18
- </choice>
19
- </define>
20
- <define name="BibDataExtensionType">
21
- <ref name="doctype"/>
22
- <optional>
23
- <ref name="docsubtype"/>
24
- </optional>
25
- <optional>
26
- <ref name="horizontal"/>
27
- </optional>
28
- <optional>
29
- <ref name="function"/>
30
- </optional>
31
- <ref name="editorialgroup"/>
32
- <zeroOrMore>
33
- <ref name="ics"/>
34
- </zeroOrMore>
35
- <ref name="structuredidentifier"/>
36
- <optional>
37
- <ref name="stagename"/>
38
- </optional>
39
- <optional>
40
- <ref name="updates_document_type"/>
41
- </optional>
42
- <optional>
43
- <ref name="accessibility-color-inside"/>
44
- </optional>
45
- <optional>
46
- <ref name="price-code"/>
47
- </optional>
48
- <optional>
49
- <ref name="cen-processing"/>
50
- </optional>
51
- <optional>
52
- <ref name="secretary"/>
53
- </optional>
54
- <optional>
55
- <ref name="interest-to-committees"/>
56
- </optional>
57
- <optional>
58
- <ref name="tc-sc-officers-note"/>
59
- </optional>
60
- </define>
61
9
  <define name="term">
62
10
  <element name="term">
63
11
  <optional>
@@ -108,48 +56,6 @@
108
56
  </define>
109
57
  </include>
110
58
  <!-- end overrides -->
111
- <define name="function">
112
- <element name="function">
113
- <choice>
114
- <value>emc</value>
115
- <value>safety</value>
116
- <value>environment</value>
117
- <value>quality-assurance</value>
118
- </choice>
119
- </element>
120
- </define>
121
- <define name="accessibility-color-inside">
122
- <element name="accessibility-color-inside">
123
- <data type="boolean"/>
124
- </element>
125
- </define>
126
- <define name="price-code">
127
- <element name="price-code">
128
- <text/>
129
- </element>
130
- </define>
131
- <define name="cen-processing">
132
- <element name="cen-processing">
133
- <data type="boolean"/>
134
- </element>
135
- </define>
136
- <define name="secretary">
137
- <element name="secretary">
138
- <text/>
139
- </element>
140
- </define>
141
- <define name="interest-to-committees">
142
- <element name="interest-to-committees">
143
- <text/>
144
- </element>
145
- </define>
146
- <define name="tc-sc-officers-note">
147
- <element name="tc-sc-officers-note">
148
- <zeroOrMore>
149
- <ref name="BasicBlock"/>
150
- </zeroOrMore>
151
- </element>
152
- </define>
153
59
  <!--
154
60
  We display the Normative References between scope and terms; but to keep the
155
61
  grammar simple, we keep the references together
@@ -186,9 +92,4 @@
186
92
  </zeroOrMore>
187
93
  </element>
188
94
  </define>
189
- <define name="updates_document_type">
190
- <element name="updates-document-type">
191
- <ref name="DocumentType"/>
192
- </element>
193
- </define>
194
95
  </grammar>
@@ -9,24 +9,23 @@
9
9
  for any other purpose without permission in writing from IEC.
10
10
  {% else %}
11
11
  <p id="boilerplate-year">
12
- © {{ agency }} {{ docyear }}, Published in Switzerland
12
+ Copyright © {{ docyear }} {{ agency }}, Geneva, Switzerland
13
13
  </p>
14
14
  <p id="boilerplate-message">
15
- All rights
16
- reserved. Unless otherwise specified, no part of this publication may be
17
- reproduced or utilized otherwise in any form or by any means, electronic or
18
- mechanical, including photocopying, or posting on the internet or an intranet,
19
- without prior written permission. Permission can be requested from either IEC
20
- at the address below or IEC's member body in the country of the requester.
15
+ All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form
16
+ or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from
17
+ either IEC or IEC's member National Committee in the country of the requester. If you have any questions about
18
+ {{ agency }} copyright or have an enquiry about obtaining additional rights to this publication, please contact the address
19
+ below or your local IEC member National Committee for further information.
21
20
  </p>
22
21
  <p id="boilerplate-name">IEC Central Office</p>
23
22
  <p id="boilerplate-address" align="left">
24
23
  3, rue de Varembé<br/>
25
- CH-1211 Geneva 20, Switzerland<br/>
26
- Tel.&#xa0;&#xa0;+ 41 22 919 02 11<br/>
27
- Fax&#xa0;&#xa0;+ 41 22 919 03 00<br/>
28
- info@iec.ch<br/>
29
- www.iec.ch
24
+ CH-1211 Geneva 20<br/>
25
+ Switzerland<br/>
26
+ Tel.:&#xa0;+41 22 919 02 11<br/>
27
+ <link target="mailto:info@iec.ch">info@iec.ch</link><br/>
28
+ <link target="https://www.iec.ch">www.iec.ch</link>
30
29
  {% endif %}
31
30
  </p>
32
31
  </clause>
@@ -9,26 +9,26 @@
9
9
  for any other purpose without permission in writing from IEC.
10
10
  {% else %}
11
11
  <p id="boilerplate-year">
12
- © {{ agency }} {{ docyear }}, Publié en Suisse
12
+ Copyright © {{ docyear }} {{ agency }}, Geneva, Switzerland
13
13
  </p>
14
14
 
15
15
  <p id="boilerplate-message">
16
- Droits de reproduction réservés. Sauf indication contraire, aucune partie de cette publication ne
17
- peut être reproduite ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique
18
- ou mécanique, y compris la photocopie, l’affichage sur l’internet ou sur un Intranet, sans
19
- autorisation écrite préalable. Les demandes d’autorisation peuvent être adressées à l’IEC à
20
- l’adresse ci-après ou au comité membre de lIEC dans le pays du demandeur.
16
+ Droits de reproduction réservés. Sauf indication contraire, aucune partie de cette publication ne peut être reproduite
17
+ ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique ou mécanique, y compris la photocopie
18
+ et les microfilms, sans l'accord écrit de l'IEC ou du Comité national de l'IEC du pays du demandeur. Si vous avez des
19
+ questions sur le copyright de l'{{ agency }} ou si vous désirez obtenir des droits supplémentaires sur cette publication, utilisez
20
+ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pays de résidence.
21
21
  </p>
22
22
 
23
23
  <p id="boilerplate-name">IEC Central Office</p>
24
24
 
25
25
  <p id="boilerplate-address" align="left">
26
26
  3, rue de Varembé<br/>
27
- CH-1211 Geneva 20, Switzerland<br/>
28
- Tel.&#xa0;&#xa0;+ 41 22 919 02 11<br/>
29
- Fax&#xa0;&#xa0;+ 41 22 919 03 00<br/>
30
- info@iec.ch<br/>
31
- www.iec.ch
27
+ CH-1211 Geneva 20<br/>
28
+ Switzerland<br/>
29
+ Tel.:&#xa0;+41 22 919 02 11<br/>
30
+ <link target="mailto:info@iec.ch">info@iec.ch</link><br/>
31
+ <link target="https://www.iec.ch">www.iec.ch</link>
32
32
  </p>
33
33
  {% endif %}
34
34
  </clause>