metanorma-un 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/macos.yml +39 -0
  3. data/.github/workflows/ubuntu.yml +39 -0
  4. data/.github/workflows/windows.yml +42 -0
  5. data/.gitignore +1 -0
  6. data/.hound.yml +3 -0
  7. data/.rubocop.yml +10 -0
  8. data/CODE_OF_CONDUCT.md +74 -0
  9. data/Gemfile +11 -0
  10. data/LICENSE +25 -0
  11. data/README.adoc +141 -0
  12. data/Rakefile +6 -0
  13. data/bin/console +14 -0
  14. data/bin/rspec +17 -0
  15. data/bin/setup +8 -0
  16. data/lib/asciidoctor/un.rb +7 -0
  17. data/lib/asciidoctor/un/basicdoc.rng +1059 -0
  18. data/lib/asciidoctor/un/biblio.rng +1142 -0
  19. data/lib/asciidoctor/un/boilerplate.xml +57 -0
  20. data/lib/asciidoctor/un/converter.rb +209 -0
  21. data/lib/asciidoctor/un/isodoc.rng +1028 -0
  22. data/lib/asciidoctor/un/reqt.rng +171 -0
  23. data/lib/asciidoctor/un/un.rng +242 -0
  24. data/lib/asciidoctor/un/validate.rb +22 -0
  25. data/lib/isodoc/un.rb +10 -0
  26. data/lib/isodoc/un/base_convert.rb +227 -0
  27. data/lib/isodoc/un/html/header.html +225 -0
  28. data/lib/isodoc/un/html/html_unece_intro.html +15 -0
  29. data/lib/isodoc/un/html/html_unece_plenary_titlepage.html +100 -0
  30. data/lib/isodoc/un/html/html_unece_titlepage.html +81 -0
  31. data/lib/isodoc/un/html/htmlstyle.scss +1174 -0
  32. data/lib/isodoc/un/html/logo.jpg +0 -0
  33. data/lib/isodoc/un/html/scripts.html +84 -0
  34. data/lib/isodoc/un/html/scripts.pdf.html +72 -0
  35. data/lib/isodoc/un/html/unece.scss +801 -0
  36. data/lib/isodoc/un/html/word_unece_intro.html +15 -0
  37. data/lib/isodoc/un/html/word_unece_plenary_titlepage.html +160 -0
  38. data/lib/isodoc/un/html/word_unece_titlepage.html +30 -0
  39. data/lib/isodoc/un/html/wordstyle.scss +1141 -0
  40. data/lib/isodoc/un/html_convert.rb +121 -0
  41. data/lib/isodoc/un/metadata.rb +115 -0
  42. data/lib/isodoc/un/pdf_convert.rb +133 -0
  43. data/lib/isodoc/un/word_convert.rb +180 -0
  44. data/lib/metanorma-un.rb +8 -0
  45. data/lib/metanorma/un.rb +12 -0
  46. data/lib/metanorma/un/UN_emblem_blue.svg +193 -0
  47. data/lib/metanorma/un/input.rb +18 -0
  48. data/lib/metanorma/un/processor.rb +43 -0
  49. data/lib/metanorma/un/version.rb +5 -0
  50. data/metanorma-unece.gemspec +48 -0
  51. metadata +334 -0
@@ -0,0 +1,57 @@
1
+ <boilerplate>
2
+ <copyright-statement>
3
+ <clause>
4
+ <p id="boilerplate-ECEhdr">ECE/TRADE/437</p>
5
+ <p>Copyright © United Nations {{ docyear }}<br/>
6
+ All rights reserved worldwide<br/>
7
+ United Nations publication issued by the Economic Commission for Europe</p>
8
+ </clause>
9
+ </copyright-statement>
10
+ <license-statement>
11
+ <clause>
12
+ <p>None of the materials provided on this web site may be used,
13
+ reproduced or transmitted, in whole or in part, in any form or by any
14
+ means, electronic or mechanical, including photocopying, recording or
15
+ the use of any information storage and retrieval system, except as
16
+ provided for in the Terms and Conditions of Use of United Nations Web
17
+ Sites, without permission in writing from the publisher.</p>
18
+
19
+ <p>News-related material can be used as long as the appropriate credit is given and the United Nations is advised.</p>
20
+ <p>To request such permission or for further enquires, please visit:
21
+ <link target="https://shop.un.org/rights-permissions">United Nations Publications: Rights and Permissions.</link></p>
22
+ </clause>
23
+ </license-statement>
24
+ <legal-statement>
25
+ <clause>
26
+ <clause>
27
+ <title>Note</title>
28
+ <p>The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations concerning the legal status of any country, territory, city or area, or of its authorities, or concerning the delimitation of its frontiers or boundaries.</p>
29
+ </clause>
30
+
31
+ {% if tc == "United Nations Centre for Trade Facilitation and Electronic Business (UN/CEFACT)" %}
32
+ <clause>
33
+ <title>#{tc}<br/>Simple, Transparent and Effective Processes for Global Commerce</title>
34
+ <p>UN/CEFACT's mission is to improve the ability of business, trade and administrative organizations, from developed, developing and transitional economies, to exchange products and relevant services effectively. Its principal focus is on facilitating national and international transactions, through the simplification and harmonization of processes, procedures and information flows, and so contribute to the growth of global commerce.</p>
35
+ <p>Participation in UN/CEFACT is open to experts from United Nations Member States, Intergovernmental Organizations and Non-Governmental Organizations recognised by the United Nations Economic and Social Council (ECOSOC). Through this participation of government and business representatives from around the world, UN/CEFACT has developed a range of trade facilitation and e-business standards, recommendations and tools that are approved within a broad intergovernmental process and implemented globally.</p>
36
+ <p align="center"><b>www.unece.org/cefact</b></p>
37
+ </clause>
38
+ {% endif %}
39
+ </clause>
40
+ </legal-statement>
41
+ <feedback-statement>
42
+ <clause>
43
+ <p id="boilerplate-feedback-name">UN Economic Commission for Europe: Information Service</p>
44
+ <p id="boilerplate-feedback-address">
45
+ Palais des Nations<br />
46
+ CH-1211 Geneva 10<br />
47
+ Switzerland<br />
48
+ <br />
49
+ <link target="tel:+41(0)229171234">+41 (0) 22 917 12 34 (switchboard)</link><br />
50
+ <link target="mailto:unece_info@un.org">unece_info@un.org</link><br />
51
+ <link target="https://www.unece.org/">www.unece.org/</link>
52
+ </p>
53
+ </clause>
54
+ </feedback-statement>
55
+ </boilerplate>
56
+
57
+
@@ -0,0 +1,209 @@
1
+ require "asciidoctor"
2
+ require "asciidoctor/standoc/converter"
3
+ require "fileutils"
4
+ require_relative "validate"
5
+
6
+ module Asciidoctor
7
+ module UN
8
+
9
+ # A {Converter} implementation that generates RSD output, and a document
10
+ # schema encapsulation of the document for validation
11
+ #
12
+ class Converter < Standoc::Converter
13
+ XML_ROOT_TAG = "un-standard".freeze
14
+ XML_NAMESPACE = "https://www.metanorma.org/ns/un".freeze
15
+
16
+ register_for "un"
17
+
18
+ def metadata_author(node, xml)
19
+ xml.contributor do |c|
20
+ c.role **{ type: "author" }
21
+ c.organization do |a|
22
+ a.name Metanorma::UN::ORGANIZATION_NAME_LONG
23
+ a.abbreviation Metanorma::UN::ORGANIZATION_NAME_SHORT
24
+ end
25
+ end
26
+ end
27
+
28
+ def metadata_publisher(node, xml)
29
+ xml.contributor do |c|
30
+ c.role **{ type: "publisher" }
31
+ c.organization do |a|
32
+ a.name Metanorma::UN::ORGANIZATION_NAME_LONG
33
+ a.abbreviation Metanorma::UN::ORGANIZATION_NAME_SHORT
34
+ end
35
+ end
36
+ end
37
+
38
+ def metadata_committee(node, xml)
39
+ return unless node.attr("committee")
40
+ xml.editorialgroup do |a|
41
+ a.committee node.attr("committee"),
42
+ **attr_code(type: node.attr("committee-type"))
43
+ i = 2
44
+ while node.attr("committee_#{i}") do
45
+ a.committee node.attr("committee_#{i}"),
46
+ **attr_code(type: node.attr("committee-type_#{i}"))
47
+ i += 1
48
+ end
49
+ end
50
+ end
51
+
52
+ def title(node, xml)
53
+ ["en"].each do |lang|
54
+ xml.title **{ type: "main", language: lang, format: "text/plain" } do |t|
55
+ t << Asciidoctor::Standoc::Utils::asciidoc_sub(node.attr("title"))
56
+ end
57
+ node.attr("subtitle") and
58
+ xml.title **{ type: "subtitle", language: lang, format: "text/plain" } do |t|
59
+ t << Asciidoctor::Standoc::Utils::asciidoc_sub(node.attr("subtitle"))
60
+ end
61
+ end
62
+ end
63
+
64
+ def metadata_id(node, xml)
65
+ dn = node.attr("docnumber")
66
+ if docstatus = node.attr("status")
67
+ abbr = IsoDoc::UN::Metadata.new("en", "Latn", {}).stage_abbr(docstatus)
68
+ dn = "#{dn}(#{abbr})" unless abbr.empty?
69
+ end
70
+ xml.docidentifier { |i| i << dn }
71
+ xml.docnumber { |i| i << node.attr("docnumber") }
72
+ end
73
+
74
+ def metadata_copyright(node, xml)
75
+ from = node.attr("copyright-year") || Date.today.year
76
+ xml.copyright do |c|
77
+ c.from from
78
+ c.owner do |owner|
79
+ owner.organization do |o|
80
+ o.name Metanorma::UN::ORGANIZATION_NAME_LONG
81
+ o.abbreviation Metanorma::UN::ORGANIZATION_NAME_SHORT
82
+ end
83
+ end
84
+ end
85
+ end
86
+
87
+ def metadata_distribution(node, xml)
88
+ xml.distribution node.attr("distribution") if node.attr("distribution")
89
+ end
90
+
91
+ def metadata_session(node, xml)
92
+ xml.session do |session|
93
+ session.number node.attr("session") if node.attr("session")
94
+ session.date node.attr("session-date") if node.attr("session-date")
95
+ node&.attr("item-number")&.split(/,[ ]*/)&.each { |i| session.item_number i }
96
+ node&.attr("item-name")&.split(/,[ ]*/)&.each { |i| session.item_name i }
97
+ node&.attr("subitem-name")&.split(/,[ ]*/)&.each { |i| session.subitem_name i }
98
+ session.collaborator node.attr("collaborator") if node.attr("collaborator")
99
+ session.id node.attr("agenda-id") if node.attr("agenda-id")
100
+ session.item_footnote node.attr("item-footnote") if node.attr("item-footnote")
101
+ end
102
+ end
103
+
104
+ def metadata_language(node, xml)
105
+ languages = node&.attr("language")&.split(/,[ ]*/) || %w(ar ru en fr zh es)
106
+ languages.each { |l| xml.language l }
107
+ end
108
+
109
+ def metadata_submission_language(node, xml)
110
+ languages = node&.attr("submissionlanguage")&.split(/,[ ]*/) || []
111
+ languages.each { |l| xml.submissionlanguage l }
112
+ end
113
+
114
+ def metadata_ext(node, xml)
115
+ super
116
+ metadata_distribution(node, xml)
117
+ metadata_session(node, xml)
118
+ metadata_submission_language(node, xml)
119
+ end
120
+
121
+ def title_validate(root)
122
+ nil
123
+ end
124
+
125
+ def makexml(node)
126
+ @draft = node.attributes.has_key?("draft")
127
+ super
128
+ end
129
+
130
+ def doctype(node)
131
+ d = node.attr("doctype")
132
+ unless %w{plenary recommendation addendum communication corrigendum reissue
133
+ agenda budgetary sec-gen-notes expert-report resolution}.include? d
134
+ warn "#{d} is not a legal document type: reverting to 'recommendation'"
135
+ d = "recommendation"
136
+ end
137
+ d
138
+ end
139
+
140
+ def document(node)
141
+ init(node)
142
+ ret1 = makexml(node)
143
+ ret = ret1.to_xml(indent: 2)
144
+ unless node.attr("nodoc") || !node.attr("docfile")
145
+ filename = node.attr("docfile").gsub(/\.adoc/, ".xml").
146
+ gsub(%r{^.*/}, "")
147
+ File.open(filename, "w") { |f| f.write(ret) }
148
+ html_converter(node).convert filename unless node.attr("nodoc")
149
+ word_converter(node).convert filename unless node.attr("nodoc")
150
+ pdf_converter(node).convert filename unless node.attr("nodoc")
151
+ end
152
+ @files_to_delete.each { |f| FileUtils.rm f }
153
+ ret
154
+ end
155
+
156
+ def validate(doc)
157
+ content_validate(doc)
158
+ schema_validate(formattedstr_strip(doc.dup),
159
+ File.join(File.dirname(__FILE__), "un.rng"))
160
+ end
161
+
162
+ def style(n, t)
163
+ return
164
+ end
165
+
166
+ def html_extract_attributes(node)
167
+ super.merge(toc: node.attributes.has_key?("toc"))
168
+ end
169
+
170
+ def doc_extract_attributes(node)
171
+ super.merge(toc: node.attributes.has_key?("toc"))
172
+ end
173
+
174
+ def html_converter(node)
175
+ IsoDoc::UN::HtmlConvert.new(html_extract_attributes(node))
176
+ end
177
+
178
+ def word_converter(node)
179
+ IsoDoc::UN::WordConvert.new(doc_extract_attributes(node))
180
+ end
181
+
182
+ def pdf_converter(node)
183
+ IsoDoc::UN::PdfConvert.new(doc_extract_attributes(node))
184
+ end
185
+
186
+ def sections_cleanup(xmldoc)
187
+ super
188
+ xmldoc.xpath("//clause/p | //annex/p").each do |p|
189
+ cl = Nokogiri::XML::Node.new("clause", xmldoc)
190
+ cl["id"] = p["id"]
191
+ cl["inline-header"]="true"
192
+ p["id"] = "_" + UUIDTools::UUID.random_create
193
+ p.replace(cl)
194
+ p.parent = cl
195
+ while n = cl.next_element and !%w(p clause).include? n.name
196
+ n.parent = cl
197
+ end
198
+ end
199
+ end
200
+
201
+ def admonition_attrs(node)
202
+ attr_code(super.merge(
203
+ "unnumbered": node.option?("unnumbered"),
204
+ "subsequence": node.attr("subsequence"),
205
+ ))
206
+ end
207
+ end
208
+ end
209
+ end
@@ -0,0 +1,1028 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ instantiations of this grammar may replace leaf strings
4
+ with more elaborated types; e.g. title (text) replaced with
5
+ title-main, title-intro, title-part; type replaced with
6
+ enum.
7
+
8
+ some renaming at leaf nodes is permissible
9
+
10
+ obligations can change both from optional to mandatory,
11
+ and from mandatory to optional; optional elements may
12
+ be omitted; freely positioned alternatives may be replaced
13
+ with strict ordering
14
+
15
+ DO NOT introduce a namespace here. We do not want a distinct namespace
16
+ for these elements, and a distinct namespace for any grammar inheriting
17
+ these elements; we just want one namespace for any child grammars
18
+ of this.
19
+ -->
20
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
21
+ <include href="reqt.rng"/>
22
+ <!-- include "biblio.rnc" { } -->
23
+ <include href="basicdoc.rng">
24
+ <start>
25
+ <ref name="standard-document"/>
26
+ </start>
27
+ <define name="hyperlink">
28
+ <element name="link">
29
+ <attribute name="target">
30
+ <data type="anyURI"/>
31
+ </attribute>
32
+ <optional>
33
+ <attribute name="type">
34
+ <ref name="ReferenceFormat"/>
35
+ </attribute>
36
+ </optional>
37
+ <optional>
38
+ <attribute name="alt"/>
39
+ </optional>
40
+ <text/>
41
+ </element>
42
+ </define>
43
+ <define name="xref">
44
+ <element name="xref">
45
+ <attribute name="target">
46
+ <data type="IDREF"/>
47
+ </attribute>
48
+ <optional>
49
+ <attribute name="type">
50
+ <ref name="ReferenceFormat"/>
51
+ </attribute>
52
+ </optional>
53
+ <optional>
54
+ <attribute name="alt"/>
55
+ </optional>
56
+ <text/>
57
+ </element>
58
+ </define>
59
+ <define name="example">
60
+ <element name="example">
61
+ <attribute name="id">
62
+ <data type="ID"/>
63
+ </attribute>
64
+ <optional>
65
+ <attribute name="unnumbered">
66
+ <data type="boolean"/>
67
+ </attribute>
68
+ </optional>
69
+ <optional>
70
+ <attribute name="subsequence"/>
71
+ </optional>
72
+ <optional>
73
+ <ref name="tname"/>
74
+ </optional>
75
+ <oneOrMore>
76
+ <choice>
77
+ <ref name="formula"/>
78
+ <ref name="ul"/>
79
+ <ref name="ol"/>
80
+ <ref name="dl"/>
81
+ <ref name="quote"/>
82
+ <ref name="sourcecode"/>
83
+ <ref name="paragraph-with-footnote"/>
84
+ <ref name="figure"/>
85
+ </choice>
86
+ </oneOrMore>
87
+ <zeroOrMore>
88
+ <ref name="note"/>
89
+ </zeroOrMore>
90
+ </element>
91
+ </define>
92
+ <define name="BibDataExtensionType">
93
+ <ref name="doctype"/>
94
+ <optional>
95
+ <ref name="editorialgroup"/>
96
+ </optional>
97
+ <zeroOrMore>
98
+ <ref name="ics"/>
99
+ </zeroOrMore>
100
+ <zeroOrMore>
101
+ <ref name="structuredidentifier"/>
102
+ </zeroOrMore>
103
+ </define>
104
+ <define name="TitleType">
105
+ <text/>
106
+ </define>
107
+ <define name="sections">
108
+ <element name="sections">
109
+ <oneOrMore>
110
+ <choice>
111
+ <ref name="clause"/>
112
+ <ref name="terms"/>
113
+ <ref name="term-clause"/>
114
+ <ref name="definitions"/>
115
+ </choice>
116
+ </oneOrMore>
117
+ </element>
118
+ </define>
119
+ <define name="references">
120
+ <element name="references">
121
+ <optional>
122
+ <attribute name="id">
123
+ <data type="ID"/>
124
+ </attribute>
125
+ </optional>
126
+ <optional>
127
+ <attribute name="obligation">
128
+ <choice>
129
+ <value>normative</value>
130
+ <value>informative</value>
131
+ </choice>
132
+ </attribute>
133
+ </optional>
134
+ <optional>
135
+ <ref name="section-title"/>
136
+ </optional>
137
+ <zeroOrMore>
138
+ <ref name="BasicBlock"/>
139
+ </zeroOrMore>
140
+ <zeroOrMore>
141
+ <ref name="note"/>
142
+ </zeroOrMore>
143
+ <zeroOrMore>
144
+ <ref name="bibitem"/>
145
+ <zeroOrMore>
146
+ <ref name="note"/>
147
+ </zeroOrMore>
148
+ </zeroOrMore>
149
+ <zeroOrMore>
150
+ <ref name="references"/>
151
+ </zeroOrMore>
152
+ </element>
153
+ </define>
154
+ <define name="note">
155
+ <element name="note">
156
+ <attribute name="id">
157
+ <data type="ID"/>
158
+ </attribute>
159
+ <oneOrMore>
160
+ <choice>
161
+ <ref name="paragraph"/>
162
+ <ref name="ul"/>
163
+ <ref name="ol"/>
164
+ <ref name="dl"/>
165
+ <ref name="formula"/>
166
+ </choice>
167
+ </oneOrMore>
168
+ </element>
169
+ </define>
170
+ <define name="Basic-Section">
171
+ <optional>
172
+ <attribute name="id">
173
+ <data type="ID"/>
174
+ </attribute>
175
+ </optional>
176
+ <optional>
177
+ <attribute name="language"/>
178
+ </optional>
179
+ <optional>
180
+ <attribute name="script"/>
181
+ </optional>
182
+ <optional>
183
+ <attribute name="obligation">
184
+ <choice>
185
+ <value>normative</value>
186
+ <value>informative</value>
187
+ </choice>
188
+ </attribute>
189
+ </optional>
190
+ <optional>
191
+ <ref name="section-title"/>
192
+ </optional>
193
+ <group>
194
+ <oneOrMore>
195
+ <ref name="BasicBlock"/>
196
+ </oneOrMore>
197
+ <zeroOrMore>
198
+ <ref name="note"/>
199
+ </zeroOrMore>
200
+ </group>
201
+ </define>
202
+ <define name="li">
203
+ <element name="li">
204
+ <group>
205
+ <optional>
206
+ <attribute name="id">
207
+ <data type="ID"/>
208
+ </attribute>
209
+ </optional>
210
+ <oneOrMore>
211
+ <ref name="BasicBlock"/>
212
+ </oneOrMore>
213
+ </group>
214
+ <!-- exclude figures? -->
215
+ </element>
216
+ </define>
217
+ <define name="dd">
218
+ <element name="dd">
219
+ <zeroOrMore>
220
+ <!-- exclude figures? -->
221
+ <ref name="BasicBlock"/>
222
+ </zeroOrMore>
223
+ </element>
224
+ </define>
225
+ <define name="thead">
226
+ <element name="thead">
227
+ <oneOrMore>
228
+ <ref name="tr"/>
229
+ </oneOrMore>
230
+ </element>
231
+ </define>
232
+ <define name="td">
233
+ <element name="td">
234
+ <optional>
235
+ <attribute name="colspan"/>
236
+ </optional>
237
+ <optional>
238
+ <attribute name="rowspan"/>
239
+ </optional>
240
+ <optional>
241
+ <attribute name="align">
242
+ <choice>
243
+ <value>left</value>
244
+ <value>right</value>
245
+ <value>center</value>
246
+ </choice>
247
+ </attribute>
248
+ </optional>
249
+ <choice>
250
+ <zeroOrMore>
251
+ <choice>
252
+ <ref name="TextElement"/>
253
+ <ref name="fn"/>
254
+ </choice>
255
+ </zeroOrMore>
256
+ <oneOrMore>
257
+ <choice>
258
+ <ref name="paragraph-with-footnote"/>
259
+ <ref name="dl"/>
260
+ <ref name="ul"/>
261
+ <ref name="ol"/>
262
+ <ref name="figure"/>
263
+ </choice>
264
+ </oneOrMore>
265
+ </choice>
266
+ </element>
267
+ </define>
268
+ <define name="th">
269
+ <element name="th">
270
+ <optional>
271
+ <attribute name="colspan"/>
272
+ </optional>
273
+ <optional>
274
+ <attribute name="rowspan"/>
275
+ </optional>
276
+ <optional>
277
+ <attribute name="align">
278
+ <choice>
279
+ <value>left</value>
280
+ <value>right</value>
281
+ <value>center</value>
282
+ </choice>
283
+ </attribute>
284
+ </optional>
285
+ <choice>
286
+ <zeroOrMore>
287
+ <choice>
288
+ <ref name="TextElement"/>
289
+ <ref name="fn"/>
290
+ </choice>
291
+ </zeroOrMore>
292
+ <oneOrMore>
293
+ <ref name="paragraph-with-footnote"/>
294
+ </oneOrMore>
295
+ </choice>
296
+ </element>
297
+ </define>
298
+ <define name="table-note">
299
+ <element name="note">
300
+ <optional>
301
+ <attribute name="id">
302
+ <data type="ID"/>
303
+ </attribute>
304
+ </optional>
305
+ <ref name="paragraph"/>
306
+ </element>
307
+ </define>
308
+ </include>
309
+ <!-- end overrides -->
310
+ <define name="BasicBlock" combine="choice">
311
+ <choice>
312
+ <ref name="requirement"/>
313
+ <ref name="recommendation"/>
314
+ <ref name="permission"/>
315
+ </choice>
316
+ </define>
317
+ <define name="bibliography">
318
+ <element name="bibliography">
319
+ <oneOrMore>
320
+ <choice>
321
+ <ref name="references"/>
322
+ <ref name="reference-clause"/>
323
+ </choice>
324
+ </oneOrMore>
325
+ </element>
326
+ </define>
327
+ <define name="reference-clause">
328
+ <element name="clause">
329
+ <optional>
330
+ <attribute name="id">
331
+ <data type="ID"/>
332
+ </attribute>
333
+ </optional>
334
+ <optional>
335
+ <attribute name="language"/>
336
+ </optional>
337
+ <optional>
338
+ <attribute name="script"/>
339
+ </optional>
340
+ <optional>
341
+ <attribute name="inline-header">
342
+ <data type="boolean"/>
343
+ </attribute>
344
+ </optional>
345
+ <optional>
346
+ <attribute name="obligation">
347
+ <choice>
348
+ <value>normative</value>
349
+ <value>informative</value>
350
+ </choice>
351
+ </attribute>
352
+ </optional>
353
+ <optional>
354
+ <ref name="section-title"/>
355
+ </optional>
356
+ <zeroOrMore>
357
+ <ref name="BasicBlock"/>
358
+ </zeroOrMore>
359
+ <zeroOrMore>
360
+ <ref name="note"/>
361
+ </zeroOrMore>
362
+ <choice>
363
+ <oneOrMore>
364
+ <ref name="reference-clause"/>
365
+ </oneOrMore>
366
+ <zeroOrMore>
367
+ <ref name="references"/>
368
+ </zeroOrMore>
369
+ </choice>
370
+ </element>
371
+ </define>
372
+ <define name="editorialgroup">
373
+ <element name="editorialgroup">
374
+ <oneOrMore>
375
+ <ref name="technical-committee"/>
376
+ </oneOrMore>
377
+ </element>
378
+ </define>
379
+ <define name="technical-committee">
380
+ <element name="technical-committee">
381
+ <ref name="IsoWorkgroup"/>
382
+ </element>
383
+ </define>
384
+ <define name="IsoWorkgroup">
385
+ <optional>
386
+ <attribute name="number">
387
+ <data type="int"/>
388
+ </attribute>
389
+ </optional>
390
+ <optional>
391
+ <attribute name="type"/>
392
+ </optional>
393
+ <text/>
394
+ </define>
395
+ <define name="ics">
396
+ <element name="ics">
397
+ <element name="code">
398
+ <text/>
399
+ </element>
400
+ <element name="text">
401
+ <text/>
402
+ </element>
403
+ </element>
404
+ </define>
405
+ <define name="standard-document">
406
+ <element name="standard-document">
407
+ <ref name="bibdata"/>
408
+ <optional>
409
+ <ref name="boilerplate"/>
410
+ </optional>
411
+ <optional>
412
+ <ref name="preface"/>
413
+ </optional>
414
+ <ref name="sections"/>
415
+ <zeroOrMore>
416
+ <ref name="annex"/>
417
+ </zeroOrMore>
418
+ <zeroOrMore>
419
+ <ref name="references"/>
420
+ </zeroOrMore>
421
+ </element>
422
+ </define>
423
+ <define name="preface">
424
+ <element name="preface">
425
+ <oneOrMore>
426
+ <choice>
427
+ <ref name="content"/>
428
+ <ref name="preface_abstract"/>
429
+ <ref name="foreword"/>
430
+ <ref name="introduction"/>
431
+ <ref name="acknowledgements"/>
432
+ </choice>
433
+ </oneOrMore>
434
+ </element>
435
+ </define>
436
+ <define name="foreword">
437
+ <element name="foreword">
438
+ <ref name="Content-Section"/>
439
+ </element>
440
+ </define>
441
+ <define name="introduction">
442
+ <element name="introduction">
443
+ <ref name="Content-Section"/>
444
+ </element>
445
+ </define>
446
+ <define name="boilerplate">
447
+ <element name="boilerplate">
448
+ <optional>
449
+ <ref name="copyright-statement"/>
450
+ </optional>
451
+ <optional>
452
+ <ref name="license-statement"/>
453
+ </optional>
454
+ <optional>
455
+ <ref name="legal-statement"/>
456
+ </optional>
457
+ <optional>
458
+ <ref name="feedback-statement"/>
459
+ </optional>
460
+ </element>
461
+ </define>
462
+ <define name="copyright-statement">
463
+ <element name="copyright-statement">
464
+ <ref name="Content-Section"/>
465
+ </element>
466
+ </define>
467
+ <define name="license-statement">
468
+ <element name="license-statement">
469
+ <ref name="Content-Section"/>
470
+ </element>
471
+ </define>
472
+ <define name="legal-statement">
473
+ <element name="legal-statement">
474
+ <ref name="Content-Section"/>
475
+ </element>
476
+ </define>
477
+ <define name="feedback-statement">
478
+ <element name="feedback-statement">
479
+ <ref name="Content-Section"/>
480
+ </element>
481
+ </define>
482
+ <define name="definitions">
483
+ <element name="definitions">
484
+ <optional>
485
+ <attribute name="id">
486
+ <data type="ID"/>
487
+ </attribute>
488
+ </optional>
489
+ <optional>
490
+ <attribute name="language"/>
491
+ </optional>
492
+ <optional>
493
+ <attribute name="script"/>
494
+ </optional>
495
+ <optional>
496
+ <attribute name="obligation">
497
+ <choice>
498
+ <value>normative</value>
499
+ <value>informative</value>
500
+ </choice>
501
+ </attribute>
502
+ </optional>
503
+ <optional>
504
+ <ref name="section-title"/>
505
+ </optional>
506
+ <oneOrMore>
507
+ <zeroOrMore>
508
+ <ref name="BasicBlock"/>
509
+ </zeroOrMore>
510
+ <zeroOrMore>
511
+ <ref name="note"/>
512
+ </zeroOrMore>
513
+ <ref name="dl"/>
514
+ </oneOrMore>
515
+ </element>
516
+ </define>
517
+ <define name="content">
518
+ <element name="clause">
519
+ <ref name="Content-Section"/>
520
+ </element>
521
+ </define>
522
+ <define name="abstract">
523
+ <element name="abstract">
524
+ <ref name="Content-Section"/>
525
+ </element>
526
+ </define>
527
+ <define name="acknowledgements">
528
+ <element name="acknowledgements">
529
+ <ref name="Content-Section"/>
530
+ </element>
531
+ </define>
532
+ <define name="content-subsection">
533
+ <element name="clause">
534
+ <optional>
535
+ <attribute name="type"/>
536
+ </optional>
537
+ <ref name="Content-Section"/>
538
+ </element>
539
+ </define>
540
+ <define name="Content-Section">
541
+ <optional>
542
+ <attribute name="id">
543
+ <data type="ID"/>
544
+ </attribute>
545
+ </optional>
546
+ <optional>
547
+ <attribute name="language"/>
548
+ </optional>
549
+ <optional>
550
+ <attribute name="script"/>
551
+ </optional>
552
+ <optional>
553
+ <attribute name="inline-header">
554
+ <data type="boolean"/>
555
+ </attribute>
556
+ </optional>
557
+ <optional>
558
+ <attribute name="obligation">
559
+ <choice>
560
+ <value>normative</value>
561
+ <value>informative</value>
562
+ </choice>
563
+ </attribute>
564
+ </optional>
565
+ <optional>
566
+ <ref name="section-title"/>
567
+ </optional>
568
+ <group>
569
+ <group>
570
+ <zeroOrMore>
571
+ <ref name="BasicBlock"/>
572
+ </zeroOrMore>
573
+ <zeroOrMore>
574
+ <ref name="note"/>
575
+ </zeroOrMore>
576
+ </group>
577
+ <zeroOrMore>
578
+ <ref name="content-subsection"/>
579
+ </zeroOrMore>
580
+ </group>
581
+ </define>
582
+ <define name="clause">
583
+ <element name="clause">
584
+ <optional>
585
+ <attribute name="type"/>
586
+ </optional>
587
+ <ref name="Clause-Section"/>
588
+ </element>
589
+ </define>
590
+ <define name="Clause-Section">
591
+ <optional>
592
+ <attribute name="id">
593
+ <data type="ID"/>
594
+ </attribute>
595
+ </optional>
596
+ <optional>
597
+ <attribute name="language"/>
598
+ </optional>
599
+ <optional>
600
+ <attribute name="script"/>
601
+ </optional>
602
+ <optional>
603
+ <attribute name="inline-header">
604
+ <data type="boolean"/>
605
+ </attribute>
606
+ </optional>
607
+ <optional>
608
+ <attribute name="obligation">
609
+ <choice>
610
+ <value>normative</value>
611
+ <value>informative</value>
612
+ </choice>
613
+ </attribute>
614
+ </optional>
615
+ <optional>
616
+ <ref name="section-title"/>
617
+ </optional>
618
+ <group>
619
+ <group>
620
+ <zeroOrMore>
621
+ <ref name="BasicBlock"/>
622
+ </zeroOrMore>
623
+ <zeroOrMore>
624
+ <ref name="note"/>
625
+ </zeroOrMore>
626
+ </group>
627
+ <zeroOrMore>
628
+ <choice>
629
+ <ref name="clause-subsection"/>
630
+ <ref name="terms"/>
631
+ <ref name="definitions"/>
632
+ </choice>
633
+ </zeroOrMore>
634
+ </group>
635
+ </define>
636
+ <define name="Annex-Section">
637
+ <optional>
638
+ <attribute name="id">
639
+ <data type="ID"/>
640
+ </attribute>
641
+ </optional>
642
+ <optional>
643
+ <attribute name="language"/>
644
+ </optional>
645
+ <optional>
646
+ <attribute name="script"/>
647
+ </optional>
648
+ <optional>
649
+ <attribute name="obligation">
650
+ <choice>
651
+ <value>normative</value>
652
+ <value>informative</value>
653
+ </choice>
654
+ </attribute>
655
+ </optional>
656
+ <optional>
657
+ <ref name="section-title"/>
658
+ </optional>
659
+ <group>
660
+ <group>
661
+ <zeroOrMore>
662
+ <ref name="BasicBlock"/>
663
+ </zeroOrMore>
664
+ <zeroOrMore>
665
+ <ref name="note"/>
666
+ </zeroOrMore>
667
+ </group>
668
+ <zeroOrMore>
669
+ <choice>
670
+ <ref name="annex-subsection"/>
671
+ <ref name="terms"/>
672
+ <ref name="definitions"/>
673
+ <ref name="references"/>
674
+ </choice>
675
+ </zeroOrMore>
676
+ </group>
677
+ </define>
678
+ <define name="clause-subsection">
679
+ <element name="clause">
680
+ <ref name="Clause-Section"/>
681
+ </element>
682
+ </define>
683
+ <define name="annex-subsection">
684
+ <element name="clause">
685
+ <ref name="Annex-Section"/>
686
+ </element>
687
+ </define>
688
+ <define name="annex">
689
+ <element name="annex">
690
+ <optional>
691
+ <attribute name="id">
692
+ <data type="ID"/>
693
+ </attribute>
694
+ </optional>
695
+ <optional>
696
+ <attribute name="language"/>
697
+ </optional>
698
+ <optional>
699
+ <attribute name="script"/>
700
+ </optional>
701
+ <optional>
702
+ <attribute name="inline-header">
703
+ <data type="boolean"/>
704
+ </attribute>
705
+ </optional>
706
+ <attribute name="obligation">
707
+ <choice>
708
+ <value>normative</value>
709
+ <value>informative</value>
710
+ </choice>
711
+ </attribute>
712
+ <optional>
713
+ <ref name="section-title"/>
714
+ </optional>
715
+ <group>
716
+ <group>
717
+ <zeroOrMore>
718
+ <ref name="BasicBlock"/>
719
+ </zeroOrMore>
720
+ <zeroOrMore>
721
+ <ref name="note"/>
722
+ </zeroOrMore>
723
+ </group>
724
+ <zeroOrMore>
725
+ <choice>
726
+ <ref name="annex-subsection"/>
727
+ <ref name="terms"/>
728
+ <ref name="definitions"/>
729
+ <ref name="references"/>
730
+ </choice>
731
+ </zeroOrMore>
732
+ </group>
733
+ </element>
734
+ </define>
735
+ <define name="terms">
736
+ <element name="terms">
737
+ <optional>
738
+ <attribute name="id">
739
+ <data type="ID"/>
740
+ </attribute>
741
+ </optional>
742
+ <optional>
743
+ <attribute name="language"/>
744
+ </optional>
745
+ <optional>
746
+ <attribute name="script"/>
747
+ </optional>
748
+ <optional>
749
+ <attribute name="obligation">
750
+ <choice>
751
+ <value>normative</value>
752
+ <value>informative</value>
753
+ </choice>
754
+ </attribute>
755
+ </optional>
756
+ <optional>
757
+ <ref name="section-title"/>
758
+ </optional>
759
+ <zeroOrMore>
760
+ <ref name="BasicBlock"/>
761
+ </zeroOrMore>
762
+ <zeroOrMore>
763
+ <ref name="note"/>
764
+ </zeroOrMore>
765
+ <choice>
766
+ <oneOrMore>
767
+ <ref name="term"/>
768
+ </oneOrMore>
769
+ <group>
770
+ <zeroOrMore>
771
+ <ref name="terms"/>
772
+ </zeroOrMore>
773
+ <optional>
774
+ <ref name="definitions"/>
775
+ </optional>
776
+ </group>
777
+ </choice>
778
+ </element>
779
+ </define>
780
+ <define name="term">
781
+ <element name="term">
782
+ <optional>
783
+ <attribute name="id">
784
+ <data type="ID"/>
785
+ </attribute>
786
+ </optional>
787
+ <oneOrMore>
788
+ <ref name="preferred"/>
789
+ </oneOrMore>
790
+ <zeroOrMore>
791
+ <ref name="admitted"/>
792
+ </zeroOrMore>
793
+ <zeroOrMore>
794
+ <ref name="related"/>
795
+ </zeroOrMore>
796
+ <zeroOrMore>
797
+ <ref name="deprecates"/>
798
+ </zeroOrMore>
799
+ <optional>
800
+ <ref name="termdomain"/>
801
+ </optional>
802
+ <zeroOrMore>
803
+ <ref name="termgrammar"/>
804
+ </zeroOrMore>
805
+ <ref name="definition"/>
806
+ <zeroOrMore>
807
+ <ref name="termnote"/>
808
+ </zeroOrMore>
809
+ <zeroOrMore>
810
+ <ref name="termexample"/>
811
+ </zeroOrMore>
812
+ <zeroOrMore>
813
+ <ref name="termsource"/>
814
+ </zeroOrMore>
815
+ </element>
816
+ </define>
817
+ <define name="preferred">
818
+ <element name="preferred">
819
+ <oneOrMore>
820
+ <ref name="TextElement"/>
821
+ </oneOrMore>
822
+ </element>
823
+ </define>
824
+ <define name="admitted">
825
+ <element name="admitted">
826
+ <oneOrMore>
827
+ <ref name="TextElement"/>
828
+ </oneOrMore>
829
+ </element>
830
+ </define>
831
+ <define name="related">
832
+ <element name="related">
833
+ <optional>
834
+ <attribute name="type">
835
+ <choice>
836
+ <value>compare</value>
837
+ <value>contrast</value>
838
+ <value>see</value>
839
+ </choice>
840
+ </attribute>
841
+ </optional>
842
+ <oneOrMore>
843
+ <ref name="TextElement"/>
844
+ </oneOrMore>
845
+ </element>
846
+ </define>
847
+ <define name="deprecates">
848
+ <element name="deprecates">
849
+ <oneOrMore>
850
+ <ref name="TextElement"/>
851
+ </oneOrMore>
852
+ </element>
853
+ </define>
854
+ <define name="termdomain">
855
+ <element name="domain">
856
+ <oneOrMore>
857
+ <ref name="TextElement"/>
858
+ </oneOrMore>
859
+ </element>
860
+ </define>
861
+ <define name="termgrammar">
862
+ <element name="grammar">
863
+ <oneOrMore>
864
+ <ref name="TextElement"/>
865
+ </oneOrMore>
866
+ </element>
867
+ </define>
868
+ <define name="definition">
869
+ <element name="definition">
870
+ <oneOrMore>
871
+ <choice>
872
+ <ref name="paragraph"/>
873
+ <ref name="figure"/>
874
+ <ref name="formula"/>
875
+ </choice>
876
+ </oneOrMore>
877
+ </element>
878
+ </define>
879
+ <define name="termnote">
880
+ <element name="termnote">
881
+ <attribute name="id">
882
+ <data type="ID"/>
883
+ </attribute>
884
+ <ref name="paragraph"/>
885
+ </element>
886
+ </define>
887
+ <define name="termexample">
888
+ <element name="termexample">
889
+ <attribute name="id">
890
+ <data type="ID"/>
891
+ </attribute>
892
+ <ref name="paragraph"/>
893
+ </element>
894
+ </define>
895
+ <define name="termsource">
896
+ <element name="termsource">
897
+ <attribute name="status">
898
+ <choice>
899
+ <value>identical</value>
900
+ <value>modified</value>
901
+ </choice>
902
+ </attribute>
903
+ <ref name="origin"/>
904
+ <optional>
905
+ <ref name="modification"/>
906
+ </optional>
907
+ </element>
908
+ </define>
909
+ <define name="origin">
910
+ <element name="origin">
911
+ <ref name="erefType"/>
912
+ </element>
913
+ </define>
914
+ <define name="modification">
915
+ <element name="modification">
916
+ <ref name="paragraph"/>
917
+ </element>
918
+ </define>
919
+ <define name="structuredidentifier">
920
+ <element name="structuredidentifier">
921
+ <optional>
922
+ <attribute name="type"/>
923
+ </optional>
924
+ <oneOrMore>
925
+ <element name="agency">
926
+ <text/>
927
+ </element>
928
+ </oneOrMore>
929
+ <optional>
930
+ <element name="class">
931
+ <text/>
932
+ </element>
933
+ </optional>
934
+ <element name="docnumber">
935
+ <text/>
936
+ </element>
937
+ <optional>
938
+ <element name="partnumber">
939
+ <text/>
940
+ </element>
941
+ </optional>
942
+ <optional>
943
+ <element name="edition">
944
+ <text/>
945
+ </element>
946
+ </optional>
947
+ <optional>
948
+ <element name="version">
949
+ <text/>
950
+ </element>
951
+ </optional>
952
+ <optional>
953
+ <element name="supplementtype">
954
+ <text/>
955
+ </element>
956
+ </optional>
957
+ <optional>
958
+ <element name="supplementnumber">
959
+ <text/>
960
+ </element>
961
+ </optional>
962
+ <optional>
963
+ <element name="language">
964
+ <text/>
965
+ </element>
966
+ </optional>
967
+ <optional>
968
+ <element name="year">
969
+ <text/>
970
+ </element>
971
+ </optional>
972
+ </element>
973
+ </define>
974
+ <define name="preface_abstract">
975
+ <element name="abstract">
976
+ <ref name="Basic-Section"/>
977
+ </element>
978
+ </define>
979
+ <define name="term-clause">
980
+ <element name="clause">
981
+ <optional>
982
+ <attribute name="id">
983
+ <data type="ID"/>
984
+ </attribute>
985
+ </optional>
986
+ <optional>
987
+ <attribute name="language"/>
988
+ </optional>
989
+ <optional>
990
+ <attribute name="script"/>
991
+ </optional>
992
+ <optional>
993
+ <attribute name="inline-header">
994
+ <data type="boolean"/>
995
+ </attribute>
996
+ </optional>
997
+ <optional>
998
+ <attribute name="obligation">
999
+ <choice>
1000
+ <value>normative</value>
1001
+ <value>informative</value>
1002
+ </choice>
1003
+ </attribute>
1004
+ </optional>
1005
+ <optional>
1006
+ <ref name="section-title"/>
1007
+ </optional>
1008
+ <zeroOrMore>
1009
+ <ref name="BasicBlock"/>
1010
+ </zeroOrMore>
1011
+ <zeroOrMore>
1012
+ <ref name="note"/>
1013
+ </zeroOrMore>
1014
+ <zeroOrMore>
1015
+ <choice>
1016
+ <ref name="term-clause"/>
1017
+ <ref name="terms"/>
1018
+ <ref name="definitions"/>
1019
+ </choice>
1020
+ </zeroOrMore>
1021
+ </element>
1022
+ </define>
1023
+ <define name="termdocsource">
1024
+ <element name="termdocsource">
1025
+ <ref name="CitationType"/>
1026
+ </element>
1027
+ </define>
1028
+ </grammar>