metanorma-standoc 1.6.0 → 1.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +66 -0
  3. data/README.adoc +1 -3
  4. data/lib/asciidoctor/standoc/base.rb +8 -16
  5. data/lib/asciidoctor/standoc/basicdoc.rng +32 -0
  6. data/lib/asciidoctor/standoc/cleanup.rb +52 -4
  7. data/lib/asciidoctor/standoc/cleanup_block.rb +41 -4
  8. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +14 -0
  9. data/lib/asciidoctor/standoc/cleanup_footnotes.rb +25 -0
  10. data/lib/asciidoctor/standoc/cleanup_inline.rb +6 -2
  11. data/lib/asciidoctor/standoc/cleanup_ref.rb +18 -25
  12. data/lib/asciidoctor/standoc/cleanup_terms.rb +3 -0
  13. data/lib/asciidoctor/standoc/converter.rb +61 -3
  14. data/lib/asciidoctor/standoc/front.rb +9 -3
  15. data/lib/asciidoctor/standoc/front_contributor.rb +34 -10
  16. data/lib/asciidoctor/standoc/isodoc.rng +29 -44
  17. data/lib/asciidoctor/standoc/lists.rb +4 -2
  18. data/lib/asciidoctor/standoc/macros.rb +45 -63
  19. data/lib/asciidoctor/standoc/macros_terms.rb +82 -0
  20. data/lib/asciidoctor/standoc/ref.rb +24 -36
  21. data/lib/asciidoctor/standoc/ref_sect.rb +16 -8
  22. data/lib/asciidoctor/standoc/section.rb +5 -9
  23. data/lib/asciidoctor/standoc/table.rb +12 -0
  24. data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +86 -0
  25. data/lib/liquid/custom_blocks/with_json_nested_context.rb +18 -0
  26. data/lib/liquid/custom_blocks/with_yaml_nested_context.rb +19 -0
  27. data/lib/metanorma/standoc/version.rb +1 -1
  28. data/metanorma-standoc.gemspec +6 -3
  29. data/spec/asciidoctor-standoc/base_spec.rb +127 -8
  30. data/spec/asciidoctor-standoc/blocks_spec.rb +8 -8
  31. data/spec/asciidoctor-standoc/cleanup_sections_spec.rb +1514 -0
  32. data/spec/asciidoctor-standoc/cleanup_spec.rb +450 -1554
  33. data/spec/asciidoctor-standoc/isobib_cache_spec.rb +22 -31
  34. data/spec/asciidoctor-standoc/lists_spec.rb +10 -1
  35. data/spec/asciidoctor-standoc/macros_json2text_spec.rb +1 -1
  36. data/spec/asciidoctor-standoc/macros_lutaml_spec.rb +80 -0
  37. data/spec/asciidoctor-standoc/macros_plantuml_spec.rb +307 -0
  38. data/spec/asciidoctor-standoc/macros_spec.rb +378 -169
  39. data/spec/asciidoctor-standoc/macros_yaml2text_spec.rb +1 -1
  40. data/spec/asciidoctor-standoc/refs_dl_spec.rb +8 -8
  41. data/spec/asciidoctor-standoc/refs_spec.rb +350 -101
  42. data/spec/asciidoctor-standoc/section_spec.rb +11 -11
  43. data/spec/asciidoctor-standoc/table_spec.rb +86 -0
  44. data/spec/asciidoctor-standoc/validate_spec.rb +26 -0
  45. data/spec/fixtures/diagram_definitions.lutaml +22 -0
  46. data/spec/fixtures/test.exp +121 -0
  47. data/spec/spec_helper.rb +33 -0
  48. data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +156 -4
  49. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +49 -233
  50. data/spec/vcr_cassettes/isobib_get_123.yml +12 -58
  51. data/spec/vcr_cassettes/isobib_get_123_1.yml +27 -119
  52. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +361 -0
  53. data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -58
  54. data/spec/vcr_cassettes/isobib_get_124.yml +11 -57
  55. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +8 -8
  56. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +276 -158
  57. metadata +61 -14
  58. data/.github/workflows/macos.yml +0 -41
  59. data/.github/workflows/ubuntu.yml +0 -45
  60. data/.github/workflows/windows.yml +0 -43
  61. data/lib/asciidoctor/standoc/base_structured_text_preprocessor.rb +0 -123
  62. data/lib/asciidoctor/standoc/json2_text_preprocessor.rb +0 -44
  63. data/lib/asciidoctor/standoc/yaml2_text_preprocessor.rb +0 -46
@@ -16,8 +16,7 @@ module Asciidoctor
16
16
  insert = refs&.at("./bibitem")&.previous_element
17
17
  refs.xpath("./bibitem").each { |b| b.remove }
18
18
  bib.reverse.each do |b|
19
- insert and insert.next = b.to_xml or
20
- refs.children.first.add_previous_sibling b.to_xml
19
+ insert and insert.next = b.to_xml or refs.children.first.add_previous_sibling b.to_xml
21
20
  end
22
21
  extract_notes_from_biblio(refs)
23
22
  refs.xpath("./references").each { |r| biblio_reorder1(r) }
@@ -49,12 +48,14 @@ module Asciidoctor
49
48
  # consecutively, but that standards codes are preserved as is:
50
49
  # only numeric references are renumbered
51
50
  def biblio_renumber(xmldoc)
52
- r = xmldoc.at("//references | //clause[.//references] | "\
53
- "//annex[.//references]") or return
54
- r.xpath(".//bibitem[not(ancestor::bibitem)]").each_with_index do |b, i|
55
- next unless docid = b.at("./docidentifier[@type = 'metanorma']")
56
- next unless /^\[\d+\]$/.match(docid.text)
57
- docid.children = "[#{i + 1}]"
51
+ i = 0
52
+ xmldoc.xpath("//bibliography//references | //clause//references | //annex//references").each do |r|
53
+ r.xpath("./bibitem").each do |b|
54
+ i += 1
55
+ next unless docid = b.at("./docidentifier[@type = 'metanorma']")
56
+ next unless /^\[\d+\]$/.match(docid.text)
57
+ docid.children = "[#{i}]"
58
+ end
58
59
  end
59
60
  end
60
61
 
@@ -123,10 +124,9 @@ module Asciidoctor
123
124
  xmldoc.xpath("//clause[@bibitem = 'true']").each do |c|
124
125
  bib = dl_bib_extract(c) or next
125
126
  validate_ref_dl(bib, c)
126
- bibitemxml = RelatonBib::BibliographicItem.new(
127
- RelatonBib::HashConverter::hash_to_bib(bib)).to_xml or next
127
+ bibitemxml = RelatonBib::BibliographicItem.new(RelatonBib::HashConverter::hash_to_bib(bib)).to_xml or next
128
128
  bibitem = Nokogiri::XML(bibitemxml)
129
- bibitem["id"] = c["id"] if c["id"]
129
+ bibitem.root["id"] = c["id"] if c["id"] && !/^_/.match(c["id"])
130
130
  c.replace(bibitem.root)
131
131
  end
132
132
  end
@@ -135,14 +135,11 @@ module Asciidoctor
135
135
  id = bib["id"]
136
136
  id ||= c["id"] unless /^_/.match(c["id"]) # do not accept implicit id
137
137
  unless id
138
- @log.add("Anchors", c, "The following reference is missing "\
139
- "an anchor:\n" + c.to_xml)
138
+ @log.add("Anchors", c, "The following reference is missing an anchor:\n" + c.to_xml)
140
139
  return
141
140
  end
142
- bib["title"] or @log.add("Bibliography", c, "Reference #{id} "\
143
- "is missing a title")
144
- bib["docid"] or @log.add("Bibliography", c, "Reference #{id} "\
145
- "is missing a document identifier (docid)")
141
+ bib["title"] or @log.add("Bibliography", c, "Reference #{id} is missing a title")
142
+ bib["docid"] or @log.add("Bibliography", c, "Reference #{id} is missing a document identifier (docid)")
146
143
  end
147
144
 
148
145
  def extract_from_p(tag, bib, key)
@@ -173,8 +170,7 @@ module Asciidoctor
173
170
  return nil if dtd.children.empty?
174
171
  dtd.at("./dl") and return dl_bib_extract(dtd)
175
172
  elems = dtd.remove.elements
176
- return p_unwrap(dtd) unless elems.size == 1 &&
177
- %w(ol ul).include?(elems[0].name)
173
+ return p_unwrap(dtd) unless elems.size == 1 && %w(ol ul).include?(elems[0].name)
178
174
  ret = []
179
175
  elems[0].xpath("./li").each do |li|
180
176
  ret << p_unwrap(li)
@@ -192,8 +188,7 @@ module Asciidoctor
192
188
  bib = {}
193
189
  key = ""
194
190
  dl.xpath("./dt | ./dd").each do |dtd|
195
- dtd.name == "dt" and key = dtd.text.sub(/:+$/, "") or
196
- add_to_hash(bib, key, dd_bib_extract(dtd))
191
+ dtd.name == "dt" and key = dtd.text.sub(/:+$/, "") or add_to_hash(bib, key, dd_bib_extract(dtd))
197
192
  end
198
193
  c.xpath("./clause").each do |c1|
199
194
  key = c1&.at("./title")&.text&.downcase&.strip
@@ -221,8 +216,7 @@ module Asciidoctor
221
216
  File.file?(file) or return nil
222
217
  xml = Nokogiri::XML(File.read(file, encoding: "utf-8"))
223
218
  ret = xml.at("//*[local-name() = 'bibdata']") or return nil
224
- ret = Nokogiri::XML(ret.to_xml.sub(
225
- %r{(<bibdata[^>]*?) xmlns=("[^"]+"|'[^']+')}, "\\1")).root
219
+ ret = Nokogiri::XML(ret.to_xml.sub(%r{(<bibdata[^>]*?) xmlns=("[^"]+"|'[^']+')}, "\\1")).root
226
220
  ret.name = "bibitem"
227
221
  ins = ret.at("./*[local-name() = 'docidentifier']") or return nil
228
222
  ins.previous = %{<uri type="citation">#{uri}</uri>}
@@ -232,8 +226,7 @@ module Asciidoctor
232
226
 
233
227
  # if citation uri points to local file, get bibitem from it
234
228
  def fetch_local_bibitem(xmldoc)
235
- xmldoc.xpath("//bibitem[formattedref]"\
236
- "[uri[@type = 'citation']]").each do |b|
229
+ xmldoc.xpath("//bibitem[formattedref][uri[@type = 'citation']]").each do |b|
237
230
  uri = b&.at("./uri[@type = 'citation']")&.text
238
231
  bibitem = read_local_bibitem(uri) or next
239
232
  bibitem["id"] = b["id"]
@@ -1,3 +1,5 @@
1
+ require_relative "term_lookup_cleanup"
2
+
1
3
  module Asciidoctor
2
4
  module Standoc
3
5
  module Cleanup
@@ -86,6 +88,7 @@ module Asciidoctor
86
88
  end
87
89
 
88
90
  def termdef_cleanup(xmldoc)
91
+ Asciidoctor::Standoc::TermLookupCleanup.new(xmldoc, @log).call
89
92
  termdef_from_termbase(xmldoc)
90
93
  termdef_unnest_cleanup(xmldoc)
91
94
  termdef_stem_cleanup(xmldoc)
@@ -1,4 +1,7 @@
1
1
  require "asciidoctor"
2
+ require "fontist"
3
+ require "fontist/manifest/install"
4
+ require "metanorma/util"
2
5
  require "metanorma/standoc/version"
3
6
  require "asciidoctor/standoc/base"
4
7
  require "asciidoctor/standoc/front"
@@ -23,8 +26,10 @@ module Asciidoctor
23
26
  Asciidoctor::Extensions.register do
24
27
  preprocessor Asciidoctor::Standoc::Datamodel::AttributesTablePreprocessor
25
28
  preprocessor Asciidoctor::Standoc::Datamodel::DiagramPreprocessor
26
- preprocessor Asciidoctor::Standoc::Yaml2TextPreprocessor
27
- preprocessor Asciidoctor::Standoc::Json2TextPreprocessor
29
+ preprocessor Metanorma::Plugin::Datastruct::Json2TextPreprocessor
30
+ preprocessor Metanorma::Plugin::Datastruct::Yaml2TextPreprocessor
31
+ preprocessor Metanorma::Plugin::Lutaml::LutamlPreprocessor
32
+ preprocessor Metanorma::Plugin::Lutaml::LutamlUmlAttributesTablePreprocessor
28
33
  inline_macro Asciidoctor::Standoc::AltTermInlineMacro
29
34
  inline_macro Asciidoctor::Standoc::DeprecatedTermInlineMacro
30
35
  inline_macro Asciidoctor::Standoc::DomainTermInlineMacro
@@ -32,9 +37,14 @@ module Asciidoctor
32
37
  inline_macro Asciidoctor::Standoc::HTML5RubyMacro
33
38
  inline_macro Asciidoctor::Standoc::ConceptInlineMacro
34
39
  inline_macro Asciidoctor::Standoc::AutonumberInlineMacro
40
+ inline_macro Asciidoctor::Standoc::VariantInlineMacro
41
+ inline_macro Asciidoctor::Standoc::FootnoteBlockInlineMacro
42
+ inline_macro Asciidoctor::Standoc::TermRefInlineMacro
43
+ inline_macro Asciidoctor::Standoc::IndexInlineMacro
35
44
  block Asciidoctor::Standoc::ToDoAdmonitionBlock
36
45
  treeprocessor Asciidoctor::Standoc::ToDoInlineAdmonitionBlock
37
46
  block Asciidoctor::Standoc::PlantUMLBlockMacro
47
+ block Metanorma::Plugin::Lutaml::LutamlDiagramBlock
38
48
  block Asciidoctor::Standoc::PseudocodeBlockMacro
39
49
  end
40
50
 
@@ -44,6 +54,7 @@ module Asciidoctor
44
54
  include ::Asciidoctor::Standoc::Base
45
55
  include ::Asciidoctor::Standoc::Front
46
56
  include ::Asciidoctor::Standoc::Lists
57
+ include ::Asciidoctor::Standoc::Refs
47
58
  include ::Asciidoctor::Standoc::Inline
48
59
  include ::Asciidoctor::Standoc::Blocks
49
60
  include ::Asciidoctor::Standoc::Section
@@ -61,6 +72,8 @@ module Asciidoctor
61
72
  basebackend "html"
62
73
  outfilesuffix ".xml"
63
74
  @libdir = File.dirname(self.class::_file || __FILE__)
75
+
76
+ install_fonts(opts)
64
77
  end
65
78
 
66
79
  class << self
@@ -73,7 +86,52 @@ module Asciidoctor
73
86
 
74
87
  # path to isodoc assets in child gems
75
88
  def html_doc_path(file)
76
- File.join(@libdir, File.join("../../isodoc/html", file))
89
+ File.join(@libdir, "../../isodoc/html", file)
90
+ end
91
+
92
+ def flavor_name
93
+ self.class.name.split("::")&.[](-2).downcase
94
+ end
95
+
96
+ def fonts_manifest
97
+ File.expand_path(File.join(@libdir, "../../metanorma/", flavor_name, "fonts_manifest.yaml"))
98
+ end
99
+
100
+ def install_fonts(options={})
101
+ if options[:no_install_fonts]
102
+ Metanorma::Util.log("[fontist] Skip font installation because" \
103
+ " --no-install-fonts argument passed", :debug)
104
+ return
105
+ end
106
+
107
+ if fonts_manifest.nil? || !File.exist?(fonts_manifest)
108
+ Metanorma::Util.log("[fontist] Skip font installation because" \
109
+ " font manifest file doesn't exists/defined", :debug)
110
+ return
111
+ end
112
+
113
+ begin
114
+ Fontist::Manifest::Install.call(
115
+ fonts_manifest,
116
+ confirmation: options[:agree_to_terms] ? "yes" : "no"
117
+ )
118
+ rescue Fontist::Errors::LicensingError
119
+ if !options[:agree_to_terms]
120
+ Metanorma::Util.log("[fontist] --agree-to-terms option missing." \
121
+ " You must accept font licenses to install fonts.", :debug)
122
+ elsif options[:continue_without_fonts]
123
+ Metanorma::Util.log("[fontist] Processing will continue without" \
124
+ " fonts installed", :debug)
125
+ else
126
+ Metanorma::Util.log("[fontist] Aborting without proper fonts" \
127
+ " installed", :fatal)
128
+ end
129
+ rescue Fontist::Errors::NonSupportedFontError
130
+ flavor = flavor_name || "cli"
131
+ Metanorma::Util.log("[fontist] '#{font}' font is not supported. " \
132
+ "Please go to github.com/metanorma/metanorma-#{flavor}/issues" \
133
+ " to report this issue.", :info)
134
+ end
77
135
  end
78
136
 
79
137
  alias_method :embedded, :content
@@ -17,6 +17,11 @@ module Asciidoctor
17
17
  xml.docnumber node.attr("docnumber")
18
18
  end
19
19
 
20
+ def metadata_other_id(node, xml)
21
+ a = node.attr("isbn") and xml.docidentifier a, type: "ISBN"
22
+ a = node.attr("isbn10") and xml.docidentifier a, type: "ISBN10"
23
+ end
24
+
20
25
  def metadata_version(node, xml)
21
26
  xml.edition node.attr("edition") if node.attr("edition")
22
27
  xml.version do |v|
@@ -27,7 +32,7 @@ module Asciidoctor
27
32
 
28
33
  def metadata_status(node, xml)
29
34
  xml.status do |s|
30
- s.stage ( node.attr("status") || node.attr("docstage") || "published" )
35
+ s.stage (node.attr("status") || node.attr("docstage") || "published")
31
36
  node.attr("docsubstage") and s.substage node.attr("docsubstage")
32
37
  node.attr("iteration") and s.iteration node.attr("iteration")
33
38
  end
@@ -138,6 +143,7 @@ module Asciidoctor
138
143
  title node, xml
139
144
  metadata_source(node, xml)
140
145
  metadata_id(node, xml)
146
+ metadata_other_id(node, xml)
141
147
  metadata_date(node, xml)
142
148
  metadata_author(node, xml)
143
149
  metadata_publisher(node, xml)
@@ -180,8 +186,8 @@ module Asciidoctor
180
186
  ["en"].each do |lang|
181
187
  at = { language: lang, format: "text/plain" }
182
188
  xml.title **attr_code(at) do |t|
183
- t << (Utils::asciidoc_sub(node.attr("title") || node.attr("title-en")) ||
184
- node.title)
189
+ t << (Utils::asciidoc_sub(node.attr("title") ||
190
+ node.attr("title-en")) || node.title)
185
191
  end
186
192
  end
187
193
  end
@@ -21,11 +21,27 @@ module Asciidoctor
21
21
  end
22
22
  end
23
23
 
24
- def organization(org, orgname)
24
+ def organization(org, orgname, node = nil, default_org = nil)
25
25
  abbrevs = org_abbrev
26
26
  n = abbrevs.invert[orgname] and orgname = n
27
27
  org.name orgname
28
- a = org_abbrev[orgname] and org.abbreviation a
28
+ default_org and a = node.attr("subdivision") and org.subdivision a
29
+ abbr = org_abbrev[orgname]
30
+ default_org && b = node.attr("subdivision-abbr") and abbr = b
31
+ abbr and org.abbreviation abbr
32
+ default_org and org_address(node, org)
33
+ end
34
+
35
+ def org_address(node, p)
36
+ node.attr("pub-address") and p.address do |ad|
37
+ ad.formattedAddress do |f|
38
+ f << node.attr("pub-address").gsub(/ \+\n/, "<br/>")
39
+ end
40
+ end
41
+ node.attr("pub-phone") and p.phone node.attr("pub-phone")
42
+ node.attr("pub-fax") and p.phone node.attr("pub-fax"), **{type: "fax"}
43
+ node.attr("pub-email") and p.email node.attr("pub-email")
44
+ node.attr("pub-uri") and p.uri node.attr("pub-uri")
29
45
  end
30
46
 
31
47
  # , " => ," : CSV definition does not deal with space followed by quote
@@ -37,10 +53,13 @@ module Asciidoctor
37
53
  end
38
54
 
39
55
  def metadata_author(node, xml)
40
- csv_split(node.attr("publisher") || default_publisher || "")&.each do |p|
56
+ csv_split(node.attr("publisher") || default_publisher || "")&.
57
+ each do |p|
41
58
  xml.contributor do |c|
42
59
  c.role **{ type: "author" }
43
- c.organization { |a| organization(a, p) }
60
+ c.organization do |a|
61
+ organization(a, p, node, !node.attr("publisher"))
62
+ end
44
63
  end
45
64
  end
46
65
  personal_author(node, xml)
@@ -99,7 +118,9 @@ module Asciidoctor
99
118
  abbr = node.attr("affiliation_abbrev#{suffix}") and
100
119
  o.abbreviation abbr
101
120
  node.attr("address#{suffix}") and o.address do |ad|
102
- ad.formattedAddress node.attr("address#{suffix}")
121
+ ad.formattedAddress do |f|
122
+ f << node.attr("address#{suffix}").gsub(/ \+\n/, "<br/>")
123
+ end
103
124
  end
104
125
  end
105
126
  end
@@ -118,19 +139,22 @@ module Asciidoctor
118
139
  csv_split(publishers)&.each do |p|
119
140
  xml.contributor do |c|
120
141
  c.role **{ type: "publisher" }
121
- c.organization { |a| organization(a, p) }
142
+ c.organization do |a|
143
+ organization(a, p, node, !node.attr("publisher"))
144
+ end
122
145
  end
123
146
  end
124
147
  end
125
148
 
126
149
  def metadata_copyright(node, xml)
127
- publishers = node.attr("copyright-holder") || node.attr("publisher") ||
128
- default_publisher || "-"
129
- csv_split(publishers)&.each do |p|
150
+ pub = node.attr("copyright-holder") || node.attr("publisher")
151
+ csv_split(pub || default_publisher || "-")&.each do |p|
130
152
  xml.copyright do |c|
131
153
  c.from (node.attr("copyright-year") || Date.today.year)
132
154
  p.match(/[A-Za-z]/).nil? or c.owner do |owner|
133
- owner.organization { |o| organization(o, p) }
155
+ owner.organization do |a|
156
+ organization(a, p, node, !pub)
157
+ end
134
158
  end
135
159
  end
136
160
  end
@@ -24,6 +24,14 @@
24
24
  <start>
25
25
  <ref name="standard-document"/>
26
26
  </start>
27
+ <define name="doctype">
28
+ <element name="doctype">
29
+ <optional>
30
+ <attribute name="abbreviation"/>
31
+ </optional>
32
+ <ref name="DocumentType"/>
33
+ </element>
34
+ </define>
27
35
  <define name="hyperlink">
28
36
  <element name="link">
29
37
  <attribute name="target">
@@ -42,7 +50,6 @@
42
50
  </define>
43
51
  <define name="xref">
44
52
  <element name="xref">
45
- <!-- attribute target { xsd:IDREF }, -->
46
53
  <attribute name="target">
47
54
  <data type="string">
48
55
  <param name="pattern">\i\c*|\c+#\c+</param>
@@ -142,6 +149,11 @@
142
149
  <data type="boolean"/>
143
150
  </attribute>
144
151
  </optional>
152
+ <optional>
153
+ <attribute name="key">
154
+ <data type="boolean"/>
155
+ </attribute>
156
+ </optional>
145
157
  <oneOrMore>
146
158
  <ref name="dt"/>
147
159
  <ref name="dd"/>
@@ -234,6 +246,9 @@
234
246
  <data type="boolean"/>
235
247
  </attribute>
236
248
  </optional>
249
+ <optional>
250
+ <ref name="colgroup"/>
251
+ </optional>
237
252
  <optional>
238
253
  <ref name="tname"/>
239
254
  </optional>
@@ -752,6 +767,18 @@
752
767
  </define>
753
768
  </include>
754
769
  <!-- end overrides -->
770
+ <define name="colgroup">
771
+ <element name="colgroup">
772
+ <oneOrMore>
773
+ <ref name="col"/>
774
+ </oneOrMore>
775
+ </element>
776
+ </define>
777
+ <define name="col">
778
+ <element name="col">
779
+ <attribute name="width"/>
780
+ </element>
781
+ </define>
755
782
  <define name="TextElement" combine="choice">
756
783
  <ref name="concept"/>
757
784
  </define>
@@ -1165,49 +1192,7 @@
1165
1192
  </define>
1166
1193
  <define name="annex">
1167
1194
  <element name="annex">
1168
- <optional>
1169
- <attribute name="id">
1170
- <data type="ID"/>
1171
- </attribute>
1172
- </optional>
1173
- <optional>
1174
- <attribute name="language"/>
1175
- </optional>
1176
- <optional>
1177
- <attribute name="script"/>
1178
- </optional>
1179
- <optional>
1180
- <attribute name="inline-header">
1181
- <data type="boolean"/>
1182
- </attribute>
1183
- </optional>
1184
- <attribute name="obligation">
1185
- <choice>
1186
- <value>normative</value>
1187
- <value>informative</value>
1188
- </choice>
1189
- </attribute>
1190
- <optional>
1191
- <ref name="section-title"/>
1192
- </optional>
1193
- <group>
1194
- <group>
1195
- <zeroOrMore>
1196
- <ref name="BasicBlock"/>
1197
- </zeroOrMore>
1198
- <zeroOrMore>
1199
- <ref name="note"/>
1200
- </zeroOrMore>
1201
- </group>
1202
- <zeroOrMore>
1203
- <choice>
1204
- <ref name="annex-subsection"/>
1205
- <ref name="terms"/>
1206
- <ref name="definitions"/>
1207
- <ref name="references"/>
1208
- </choice>
1209
- </zeroOrMore>
1210
- </group>
1195
+ <ref name="Annex-Section"/>
1211
1196
  </element>
1212
1197
  </define>
1213
1198
  <define name="terms">