metanorma-generic 1.6.2 → 1.7.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4051c5aaaa0b9eb7a8830a501f63f0d31ac188bcf2da6eff4a2569370c191798
4
- data.tar.gz: cff9b18009cd0b594bde8789c05318e5ec357f1c5e31fe2d7e20ef58c2cede1d
3
+ metadata.gz: c325e9aa02cddaf26372e0199b21c55338e5abff1b8a1e8a25007567fb03b799
4
+ data.tar.gz: b6fc284631a359dc78e4f83744d1fbda26211b1692d74417b5a45af254b0266b
5
5
  SHA512:
6
- metadata.gz: 9602b51e4a9b97efeddbe0f844bb189cc9f1f251266a88ef9ba3fa5efb534aa35991f079248f4669c59800cc7b2e3910b20c3c8ee14b3df49a57cf4478ff0b9c
7
- data.tar.gz: 6bc8966b060289541a0702cdee8ad9be5d8707b03d6812673bbea05fedb3748d8b381c7115ecdb5c341bd4aa847b7c3122740a03d6ef6200b87d83e7145867a8
6
+ metadata.gz: a0496b1c8cb2ef30e8265d08eaf4c0206f110a6687f6e2acc7d9e172e2e1975e266f9740ac628fa492d5b151ecad4a171653f9cc8704625e76359676231b6364
7
+ data.tar.gz: 3a4fd80dfd4fd4540950837182bf860676d4ea15f6a09cc207f64ab2025c2a54b0fa9aa84ba324585f6dcee41632ff38117b00a1dc8594c6d215e8b6779cc0e8
@@ -0,0 +1,63 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: rake
4
+
5
+ on:
6
+ push:
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
9
+ pull_request:
10
+
11
+ jobs:
12
+ rake:
13
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
+ runs-on: ${{ matrix.os }}
15
+ continue-on-error: ${{ matrix.experimental }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby: [ '2.6', '2.5', '2.4' ]
20
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
21
+ experimental: [ false ]
22
+ include:
23
+ - ruby: '2.7'
24
+ os: 'ubuntu-latest'
25
+ experimental: true
26
+ - ruby: '2.7'
27
+ os: 'windows-latest'
28
+ experimental: true
29
+ - ruby: '2.7'
30
+ os: 'macos-latest'
31
+ experimental: true
32
+ steps:
33
+ - uses: actions/checkout@master
34
+
35
+ - uses: ruby/setup-ruby@v1
36
+ with:
37
+ ruby-version: ${{ matrix.ruby }}
38
+
39
+ - uses: actions/cache@v1
40
+ with:
41
+ path: vendor/bundle
42
+ key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
43
+ restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
44
+
45
+ - run: bundle config set path 'vendor/bundle'
46
+
47
+ - run: bundle install --jobs 4 --retry 3
48
+
49
+ - run: bundle exec rake
50
+
51
+ notify:
52
+ name: Trigger notify workflow
53
+ needs: rake
54
+ runs-on: ubuntu-latest
55
+ steps:
56
+ - name: Trigger notify workflow
57
+ uses: Sibz/github-status-action@v1
58
+ with:
59
+ authToken: ${{ secrets.GITHUB_TOKEN }}
60
+ context: 'tests-passed-successfully'
61
+ description: 'Tests passed successfully'
62
+ state: 'success'
63
+ sha: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -3,9 +3,7 @@
3
3
  Formerly known as metanorma-acme
4
4
 
5
5
  image:https://img.shields.io/gem/v/metanorma-generic.svg["Gem Version", link="https://rubygems.org/gems/metanorma-generic"]
6
- image:https://github.com/metanorma/metanorma-generic/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/metanorma/metanorma-generic/actions?workflow=macos"]
7
- image:https://github.com/metanorma/metanorma-generic/workflows/ubuntu/badge.svg["Build Status (ubuntu)", link="https://github.com/metanorma/metanorma-generic/actions?workflow=ubuntu"]
8
- image:https://github.com/metanorma/metanorma-generic/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/metanorma/metanorma-generic/actions?workflow=windows"]
6
+ image:https://github.com/metanorma/metanorma-generic/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-generic/actions?workflow=rake"]
9
7
  image:https://codeclimate.com/github/metanorma/metanorma-acme/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-acme"]
10
8
  image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-generic.svg["Pull Requests", link="https://github.com/metanorma/metanorma-generic/pulls"]
11
9
  image:https://img.shields.io/github/commits-since/metanorma/metanorma-generic/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-generic/releases"]
@@ -402,6 +402,16 @@
402
402
  </choice>
403
403
  </attribute>
404
404
  </optional>
405
+ <optional>
406
+ <attribute name="valign">
407
+ <choice>
408
+ <value>top</value>
409
+ <value>middle</value>
410
+ <value>bottom</value>
411
+ <value>baseline</value>
412
+ </choice>
413
+ </attribute>
414
+ </optional>
405
415
  <choice>
406
416
  <zeroOrMore>
407
417
  <ref name="TextElement"/>
@@ -429,6 +439,16 @@
429
439
  </choice>
430
440
  </attribute>
431
441
  </optional>
442
+ <optional>
443
+ <attribute name="valign">
444
+ <choice>
445
+ <value>top</value>
446
+ <value>middle</value>
447
+ <value>bottom</value>
448
+ <value>baseline</value>
449
+ </choice>
450
+ </attribute>
451
+ </optional>
432
452
  <choice>
433
453
  <zeroOrMore>
434
454
  <ref name="TextElement"/>
@@ -998,6 +1018,9 @@
998
1018
  <value>alphabet_upper</value>
999
1019
  </choice>
1000
1020
  </attribute>
1021
+ <optional>
1022
+ <attribute name="start"/>
1023
+ </optional>
1001
1024
  <oneOrMore>
1002
1025
  <ref name="li"/>
1003
1026
  </oneOrMore>
@@ -1,13 +1,10 @@
1
1
  require "asciidoctor"
2
2
  require "asciidoctor/standoc/converter"
3
3
  require "fileutils"
4
+ require_relative "front"
4
5
 
5
6
  module Asciidoctor
6
7
  module Generic
7
-
8
- # A {Converter} implementation that generates RSD output, and a document
9
- # schema encapsulation of the document for validation
10
- #
11
8
  class Converter < Standoc::Converter
12
9
  XML_ROOT_TAG = "generic-standard".freeze
13
10
  XML_NAMESPACE = "https://www.metanorma.org/ns/generic".freeze
@@ -28,33 +25,6 @@ module Asciidoctor
28
25
  self.class::_file || __FILE__), "..", "..", "..", loc))
29
26
  end
30
27
 
31
- def default_publisher
32
- configuration.organization_name_long
33
- end
34
-
35
- def metadata_committee(node, xml)
36
- return unless node.attr("committee")
37
- xml.editorialgroup do |a|
38
- a.committee node.attr("committee"),
39
- **attr_code(type: node.attr("committee-type"))
40
- i = 2
41
- while node.attr("committee_#{i}") do
42
- a.committee node.attr("committee_#{i}"),
43
- **attr_code(type: node.attr("committee-type_#{i}"))
44
- i += 1
45
- end
46
- end
47
- end
48
-
49
- def metadata_status(node, xml)
50
- xml.status do |s|
51
- s.stage ( node.attr("status") || node.attr("docstage") ||
52
- configuration.default_stage || "published" )
53
- x = node.attr("substage") and s.substage x
54
- x = node.attr("iteration") and s.iteration x
55
- end
56
- end
57
-
58
28
  def docidentifier_cleanup(xmldoc)
59
29
  template = configuration.docid_template ||
60
30
  "{{ organization_name_short }} {{ docnumeric }}"
@@ -63,30 +33,16 @@ module Asciidoctor
63
33
  id.empty? and docid.remove or docid.children = id
64
34
  end
65
35
 
66
- def metadata_id(node, xml)
67
- xml.docidentifier **{ type:
68
- configuration.organization_name_short } do |i|
69
- i << "DUMMY"
70
- end
71
- xml.docnumber { |i| i << node.attr("docnumber") }
72
- end
73
-
74
- def metadata_ext(node, ext)
75
- super
76
- Array(configuration.metadata_extensions).each do |e|
77
- a = node.attr(e) and ext.send e, a
78
- end
79
- end
80
-
81
36
  def doctype(node)
82
37
  d = super
83
- configuration.doctypes or return d == "article" ? "standard" : d
84
- default = configuration.default_doctype || Array(configuration.doctypes).dig(0) ||
85
- "standard"
86
- unless Array(configuration.doctypes).include? d
38
+ configuration.doctypes or return d == "article" ?
39
+ (configuration.default_doctype || "standard") : d
40
+ type = configuration.default_doctype ||
41
+ configuration.doctypes.keys.dig(0) || "standard"
42
+ unless configuration.doctypes.keys.include? d
87
43
  @log.add("Document Attributes", nil,
88
- "#{d} is not a legal document type: reverting to '#{default}'")
89
- d = default
44
+ "#{d} is not a legal document type: reverting to '#{type}'")
45
+ d = type
90
46
  end
91
47
  d
92
48
  end
@@ -97,13 +53,13 @@ module Asciidoctor
97
53
  end
98
54
 
99
55
  def sectiontype_streamline(ret)
100
- if configuration.termsdefs_titles.map(&:downcase).include? (ret)
56
+ if configuration&.termsdefs_titles&.map(&:downcase)&.include? (ret)
101
57
  "terms and definitions"
102
- elsif configuration.symbols_titles.map(&:downcase).include? (ret)
58
+ elsif configuration&.symbols_titles&.map(&:downcase)&.include? (ret)
103
59
  "symbols and abbreviated terms"
104
- elsif configuration.normref_titles.map(&:downcase).include? (ret)
60
+ elsif configuration&.normref_titles&.map(&:downcase)&.include? (ret)
105
61
  "normative references"
106
- elsif configuration.bibliography_titles.map(&:downcase).include? (ret)
62
+ elsif configuration&.bibliography_titles&.map(&:downcase)&.include? (ret)
107
63
  "bibliography"
108
64
  else
109
65
  ret
@@ -117,11 +73,11 @@ module Asciidoctor
117
73
 
118
74
  def outputs(node, ret)
119
75
  File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
120
- presentation_xml_converter(node).convert(@filename + ".xml")
121
- html_converter(node).convert(@filename + ".presentation.xml",
122
- nil, false, "#{@filename}.html")
123
- doc_converter(node).convert(@filename + ".presentation.xml",
124
- nil, false, "#{@filename}.doc")
76
+ presentation_xml_converter(node)&.convert(@filename + ".xml")
77
+ html_converter(node)&.convert(@filename + ".presentation.xml",
78
+ nil, false, "#{@filename}.html")
79
+ doc_converter(node)&.convert(@filename + ".presentation.xml",
80
+ nil, false, "#{@filename}.doc")
125
81
  pdf_converter(node)&.convert(@filename + ".presentation.xml",
126
82
  nil, false, "#{@filename}.pdf")
127
83
 
@@ -141,6 +97,7 @@ module Asciidoctor
141
97
 
142
98
  def bibdata_validate(doc)
143
99
  stage_validate(doc)
100
+ committee_validate(doc)
144
101
  end
145
102
 
146
103
  def stage_validate(xmldoc)
@@ -151,6 +108,15 @@ module Asciidoctor
151
108
  @log.add("Document Attributes", nil, "#{stage} is not a recognised status")
152
109
  end
153
110
 
111
+ def committee_validate(xmldoc)
112
+ committees = Array(configuration&.committees) || return
113
+ committees.empty? and return
114
+ xmldoc.xpath("//bibdata/ext/editorialgroup/committee").each do |c|
115
+ committees.include? c.text or
116
+ @log.add("Document Attributes", nil, "#{c.text} is not a recognised committee")
117
+ end
118
+ end
119
+
154
120
  def sections_cleanup(x)
155
121
  super
156
122
  x.xpath("//*[@inline-header]").each do |h|
@@ -187,6 +153,26 @@ module Asciidoctor
187
153
  end
188
154
  conv
189
155
  end
156
+
157
+ def boilerplate_file(xmldoc)
158
+ f = configuration.boilerplate
159
+ f.nil? and return super
160
+ f.is_a? String and return baselocation(f)
161
+ f.is_a? Hash and f[@lang] and return baselocation(f[@lang])
162
+ super
163
+ end
164
+
165
+ def cleanup(xmldoc)
166
+ super
167
+ empty_metadata_cleanup(xmldoc)
168
+ xmldoc
169
+ end
170
+
171
+ def empty_metadata_cleanup(xmldoc)
172
+ xmldoc.xpath("//bibdata/ext//*").each do |x|
173
+ x.remove if x.children.empty?
174
+ end
175
+ end
190
176
  end
191
177
  end
192
178
  end
@@ -0,0 +1,108 @@
1
+ module Asciidoctor
2
+ module Generic
3
+ class Converter < Standoc::Converter
4
+ def default_publisher
5
+ configuration.organization_name_long
6
+ end
7
+
8
+ def org_abbrev
9
+ if !configuration.organization_name_long.empty? &&
10
+ !configuration.organization_name_short.empty? &&
11
+ configuration.organization_name_long !=
12
+ configuration.organization_name_short
13
+ { configuration.organization_name_long =>
14
+ configuration.organization_name_short }
15
+ else
16
+ super
17
+ end
18
+ end
19
+
20
+ def relaton_relations
21
+ Array(configuration.relations) || []
22
+ end
23
+
24
+ def metadata_committee(node, xml)
25
+ return unless node.attr("committee")
26
+ xml.editorialgroup do |a|
27
+ a.committee node.attr("committee"),
28
+ **attr_code(type: node.attr("committee-type"))
29
+ i = 2
30
+ while node.attr("committee_#{i}") do
31
+ a.committee node.attr("committee_#{i}"),
32
+ **attr_code(type: node.attr("committee-type_#{i}"))
33
+ i += 1
34
+ end
35
+ end
36
+ end
37
+
38
+ def metadata_status(node, xml)
39
+ xml.status do |s|
40
+ s.stage ( node.attr("status") || node.attr("docstage") ||
41
+ configuration.default_stage || "published" )
42
+ x = node.attr("substage") and s.substage x
43
+ x = node.attr("iteration") and s.iteration x
44
+ end
45
+ end
46
+
47
+ def metadata_id(node, xml)
48
+ xml.docidentifier **{ type:
49
+ configuration.organization_name_short } do |i|
50
+ i << "DUMMY"
51
+ end
52
+ xml.docnumber { |i| i << node.attr("docnumber") }
53
+ end
54
+
55
+ def metadata_ext(node, ext)
56
+ super
57
+ if configuration.metadata_extensions.is_a? Hash
58
+ metadata_ext_hash(node, ext, configuration.metadata_extensions)
59
+ else
60
+ Array(configuration.metadata_extensions).each do |e|
61
+ a = node.attr(e) and ext.send e, a
62
+ end
63
+ end
64
+ end
65
+
66
+ def metadata_doctype(node, xml)
67
+ d = doctype(node)
68
+ xml.doctype d, attr_code(abbreviation: configuration&.doctypes&.dig(d))
69
+ end
70
+
71
+ EXT_STRUCT = %w(_output _attribute _list).freeze
72
+
73
+ def metadata_ext_hash(node, ext, hash)
74
+ hash.each do |k, v|
75
+ next if EXT_STRUCT.include?(k) || !v&.is_a?(Hash) && !node.attr(k)
76
+ if v&.is_a?(Hash) && v["_list"]
77
+ csv_split(node.attr(k)).each do |val|
78
+ metadata_ext_hash1(k, val, ext, v, node)
79
+ end
80
+ else
81
+ metadata_ext_hash1(k, node.attr(k), ext, v, node)
82
+ end
83
+ end
84
+ end
85
+
86
+ def metadata_ext_hash1(key, value, ext, hash, node)
87
+ return if hash&.is_a?(Hash) && hash["_attribute"]
88
+ is_hash = hash&.is_a?(Hash) &&
89
+ !hash.keys.reject { |n| EXT_STRUCT.include?(n) }.empty?
90
+ return if !is_hash && (value.nil? || value.empty?)
91
+ name = hash&.is_a?(Hash) ? (hash["_output"] || key) : key
92
+ ext.send name, **attr_code(metadata_ext_attrs(hash, node)) do |e|
93
+ is_hash ? metadata_ext_hash(node, e, hash) : (e << value)
94
+ end
95
+ end
96
+
97
+ def metadata_ext_attrs(hash, node)
98
+ return {} unless hash.is_a?(Hash)
99
+ ret = {}
100
+ hash.each do |k, v|
101
+ next unless v.is_a?(Hash) && v["_attribute"]
102
+ ret[(v["_output"] || k).to_sym] = node.attr(k)
103
+ end
104
+ ret
105
+ end
106
+ end
107
+ end
108
+ end
@@ -59,6 +59,13 @@
59
59
  </define>
60
60
  <define name="generic-standard">
61
61
  <element name="generic-standard">
62
+ <attribute name="version"/>
63
+ <attribute name="type">
64
+ <choice>
65
+ <value>semantic</value>
66
+ <value>presentation</value>
67
+ </choice>
68
+ </attribute>
62
69
  <ref name="bibdata"/>
63
70
  <zeroOrMore>
64
71
  <ref name="termdocsource"/>
@@ -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>
@@ -64,6 +71,11 @@
64
71
  </choice>
65
72
  </attribute>
66
73
  </optional>
74
+ <optional>
75
+ <attribute name="droploc">
76
+ <data type="boolean"/>
77
+ </attribute>
78
+ </optional>
67
79
  <text/>
68
80
  </element>
69
81
  </define>
@@ -137,6 +149,11 @@
137
149
  <data type="boolean"/>
138
150
  </attribute>
139
151
  </optional>
152
+ <optional>
153
+ <attribute name="key">
154
+ <data type="boolean"/>
155
+ </attribute>
156
+ </optional>
140
157
  <oneOrMore>
141
158
  <ref name="dt"/>
142
159
  <ref name="dd"/>
@@ -581,6 +598,8 @@
581
598
  <ref name="ol"/>
582
599
  <ref name="dl"/>
583
600
  <ref name="formula"/>
601
+ <ref name="quote"/>
602
+ <ref name="sourcecode"/>
584
603
  </choice>
585
604
  </oneOrMore>
586
605
  </element>
@@ -664,6 +683,16 @@
664
683
  </choice>
665
684
  </attribute>
666
685
  </optional>
686
+ <optional>
687
+ <attribute name="valign">
688
+ <choice>
689
+ <value>top</value>
690
+ <value>middle</value>
691
+ <value>bottom</value>
692
+ <value>baseline</value>
693
+ </choice>
694
+ </attribute>
695
+ </optional>
667
696
  <choice>
668
697
  <zeroOrMore>
669
698
  <choice>
@@ -700,6 +729,16 @@
700
729
  </choice>
701
730
  </attribute>
702
731
  </optional>
732
+ <optional>
733
+ <attribute name="valign">
734
+ <choice>
735
+ <value>top</value>
736
+ <value>middle</value>
737
+ <value>bottom</value>
738
+ <value>baseline</value>
739
+ </choice>
740
+ </attribute>
741
+ </optional>
703
742
  <choice>
704
743
  <zeroOrMore>
705
744
  <choice>
@@ -837,6 +876,13 @@
837
876
  </define>
838
877
  <define name="standard-document">
839
878
  <element name="standard-document">
879
+ <attribute name="version"/>
880
+ <attribute name="type">
881
+ <choice>
882
+ <value>semantic</value>
883
+ <value>presentation</value>
884
+ </choice>
885
+ </attribute>
840
886
  <ref name="bibdata"/>
841
887
  <optional>
842
888
  <ref name="boilerplate"/>
@@ -858,7 +904,7 @@
858
904
  <oneOrMore>
859
905
  <choice>
860
906
  <ref name="content"/>
861
- <ref name="preface_abstract"/>
907
+ <ref name="abstract"/>
862
908
  <ref name="foreword"/>
863
909
  <ref name="introduction"/>
864
910
  <ref name="acknowledgements"/>
@@ -1052,14 +1098,17 @@
1052
1098
  <ref name="section-title"/>
1053
1099
  </optional>
1054
1100
  <group>
1055
- <group>
1056
- <zeroOrMore>
1057
- <ref name="BasicBlock"/>
1058
- </zeroOrMore>
1059
- <zeroOrMore>
1060
- <ref name="note"/>
1061
- </zeroOrMore>
1062
- </group>
1101
+ <choice>
1102
+ <group>
1103
+ <zeroOrMore>
1104
+ <ref name="BasicBlock"/>
1105
+ </zeroOrMore>
1106
+ <zeroOrMore>
1107
+ <ref name="note"/>
1108
+ </zeroOrMore>
1109
+ </group>
1110
+ <ref name="amend"/>
1111
+ </choice>
1063
1112
  <zeroOrMore>
1064
1113
  <choice>
1065
1114
  <ref name="clause-subsection"/>
@@ -1128,49 +1177,7 @@
1128
1177
  </define>
1129
1178
  <define name="annex">
1130
1179
  <element name="annex">
1131
- <optional>
1132
- <attribute name="id">
1133
- <data type="ID"/>
1134
- </attribute>
1135
- </optional>
1136
- <optional>
1137
- <attribute name="language"/>
1138
- </optional>
1139
- <optional>
1140
- <attribute name="script"/>
1141
- </optional>
1142
- <optional>
1143
- <attribute name="inline-header">
1144
- <data type="boolean"/>
1145
- </attribute>
1146
- </optional>
1147
- <attribute name="obligation">
1148
- <choice>
1149
- <value>normative</value>
1150
- <value>informative</value>
1151
- </choice>
1152
- </attribute>
1153
- <optional>
1154
- <ref name="section-title"/>
1155
- </optional>
1156
- <group>
1157
- <group>
1158
- <zeroOrMore>
1159
- <ref name="BasicBlock"/>
1160
- </zeroOrMore>
1161
- <zeroOrMore>
1162
- <ref name="note"/>
1163
- </zeroOrMore>
1164
- </group>
1165
- <zeroOrMore>
1166
- <choice>
1167
- <ref name="annex-subsection"/>
1168
- <ref name="terms"/>
1169
- <ref name="definitions"/>
1170
- <ref name="references"/>
1171
- </choice>
1172
- </zeroOrMore>
1173
- </group>
1180
+ <ref name="Annex-Section"/>
1174
1181
  </element>
1175
1182
  </define>
1176
1183
  <define name="terms">
@@ -1456,11 +1463,6 @@
1456
1463
  </optional>
1457
1464
  </element>
1458
1465
  </define>
1459
- <define name="preface_abstract">
1460
- <element name="abstract">
1461
- <ref name="Basic-Section"/>
1462
- </element>
1463
- </define>
1464
1466
  <define name="term-clause">
1465
1467
  <element name="clause">
1466
1468
  <optional>
@@ -1510,4 +1512,79 @@
1510
1512
  <ref name="CitationType"/>
1511
1513
  </element>
1512
1514
  </define>
1515
+ <define name="amend">
1516
+ <element name="amend">
1517
+ <optional>
1518
+ <attribute name="id">
1519
+ <data type="ID"/>
1520
+ </attribute>
1521
+ </optional>
1522
+ <attribute name="change">
1523
+ <choice>
1524
+ <value>add</value>
1525
+ <value>modify</value>
1526
+ <value>delete</value>
1527
+ </choice>
1528
+ </attribute>
1529
+ <optional>
1530
+ <attribute name="path"/>
1531
+ </optional>
1532
+ <optional>
1533
+ <attribute name="path_end"/>
1534
+ </optional>
1535
+ <optional>
1536
+ <attribute name="title"/>
1537
+ </optional>
1538
+ <optional>
1539
+ <element name="location">
1540
+ <zeroOrMore>
1541
+ <ref name="locality"/>
1542
+ </zeroOrMore>
1543
+ </element>
1544
+ </optional>
1545
+ <zeroOrMore>
1546
+ <ref name="autonumber"/>
1547
+ </zeroOrMore>
1548
+ <optional>
1549
+ <element name="description">
1550
+ <zeroOrMore>
1551
+ <ref name="BasicBlock"/>
1552
+ </zeroOrMore>
1553
+ </element>
1554
+ </optional>
1555
+ <optional>
1556
+ <element name="newcontent">
1557
+ <zeroOrMore>
1558
+ <ref name="BasicBlock"/>
1559
+ </zeroOrMore>
1560
+ </element>
1561
+ </optional>
1562
+ <optional>
1563
+ <element name="description">
1564
+ <zeroOrMore>
1565
+ <ref name="BasicBlock"/>
1566
+ </zeroOrMore>
1567
+ </element>
1568
+ </optional>
1569
+ </element>
1570
+ </define>
1571
+ <define name="autonumber">
1572
+ <element name="autonumber">
1573
+ <attribute name="type">
1574
+ <choice>
1575
+ <value>requirement</value>
1576
+ <value>recommendation</value>
1577
+ <value>permission</value>
1578
+ <value>table</value>
1579
+ <value>figure</value>
1580
+ <value>admonition</value>
1581
+ <value>formula</value>
1582
+ <value>sourcecode</value>
1583
+ <value>example</value>
1584
+ <value>note</value>
1585
+ </choice>
1586
+ </attribute>
1587
+ <text/>
1588
+ </element>
1589
+ </define>
1513
1590
  </grammar>