asciidoctor-rfc 0.8.0 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/.hound.yml +3 -0
  3. data/.rubocop.ribose.yml +65 -0
  4. data/.rubocop.tb.yml +640 -0
  5. data/.rubocop.yml +13 -30
  6. data/.travis.yml +8 -3
  7. data/CODE_OF_CONDUCT.md +46 -0
  8. data/Gemfile +8 -1
  9. data/LICENSE +21 -17
  10. data/README.adoc +471 -52
  11. data/asciidoctor-rfc.gemspec +14 -13
  12. data/lib/asciidoctor-rfc.rb +4 -4
  13. data/lib/asciidoctor/rfc/common/base.rb +304 -58
  14. data/lib/asciidoctor/rfc/common/front.rb +3 -3
  15. data/lib/asciidoctor/rfc/v2/base.rb +71 -82
  16. data/lib/asciidoctor/rfc/v2/blocks.rb +33 -10
  17. data/lib/asciidoctor/rfc/v2/converter.rb +0 -3
  18. data/lib/asciidoctor/rfc/v2/inline_anchor.rb +35 -20
  19. data/lib/asciidoctor/rfc/v2/lists.rb +11 -13
  20. data/lib/asciidoctor/rfc/v2/table.rb +11 -9
  21. data/lib/asciidoctor/rfc/v2/validate.rb +18 -724
  22. data/lib/asciidoctor/rfc/v3/base.rb +75 -102
  23. data/lib/asciidoctor/rfc/v3/blocks.rb +7 -9
  24. data/lib/asciidoctor/rfc/v3/converter.rb +0 -1
  25. data/lib/asciidoctor/rfc/v3/front.rb +14 -7
  26. data/lib/asciidoctor/rfc/v3/inline_anchor.rb +12 -9
  27. data/lib/asciidoctor/rfc/v3/lists.rb +31 -45
  28. data/lib/asciidoctor/rfc/v3/table.rb +2 -2
  29. data/lib/asciidoctor/rfc/v3/validate.rb +19 -2153
  30. data/lib/asciidoctor/rfc/v3/validate.rng +1 -1
  31. data/lib/asciidoctor/rfc/version.rb +1 -1
  32. data/rfc2629-other.ent +61 -0
  33. data/rfc2629-xhtml.ent +165 -0
  34. data/rfc2629.dtd +312 -0
  35. data/spec/asciidoctor/rfc/v2/biblio_spec.rb +9 -0
  36. data/spec/asciidoctor/rfc/v2/comments_spec.rb +67 -1
  37. data/spec/asciidoctor/rfc/v2/crossref_spec.rb +127 -5
  38. data/spec/asciidoctor/rfc/v2/date_spec.rb +24 -28
  39. data/spec/asciidoctor/rfc/v2/dlist_spec.rb +5 -5
  40. data/spec/asciidoctor/rfc/v2/image_spec.rb +2 -2
  41. data/spec/asciidoctor/rfc/v2/inline_formatting_spec.rb +28 -0
  42. data/spec/asciidoctor/rfc/v2/listing_spec.rb +2 -2
  43. data/spec/asciidoctor/rfc/v2/literal_spec.rb +4 -4
  44. data/spec/asciidoctor/rfc/v2/preamble_spec.rb +1 -1
  45. data/spec/asciidoctor/rfc/v2/quote_spec.rb +1 -1
  46. data/spec/asciidoctor/rfc/v2/references_spec.rb +210 -3
  47. data/spec/asciidoctor/rfc/v2/section_spec.rb +33 -0
  48. data/spec/asciidoctor/rfc/v2/table_spec.rb +40 -1
  49. data/spec/asciidoctor/rfc/v2/text_spec.rb +71 -14
  50. data/spec/asciidoctor/rfc/v2/ulist_spec.rb +1 -1
  51. data/spec/asciidoctor/rfc/v3/biblio_spec.rb +13 -0
  52. data/spec/asciidoctor/rfc/v3/comments_spec.rb +71 -0
  53. data/spec/asciidoctor/rfc/v3/crossref_spec.rb +7 -0
  54. data/spec/asciidoctor/rfc/v3/dlist_spec.rb +4 -4
  55. data/spec/asciidoctor/rfc/v3/literal_spec.rb +1 -1
  56. data/spec/asciidoctor/rfc/v3/preamble_spec.rb +1 -1
  57. data/spec/asciidoctor/rfc/v3/references_spec.rb +208 -3
  58. data/spec/asciidoctor/rfc/v3/series_info_spec.rb +1 -1
  59. data/spec/asciidoctor/rfc/v3/table_spec.rb +70 -1
  60. data/spec/examples/README.adoc +42 -6
  61. data/spec/examples/biblio-insert-v2.adoc +29 -0
  62. data/spec/examples/biblio-insert-v3.adoc +30 -0
  63. data/spec/examples/davies-template-bare-06.adoc +1 -0
  64. data/spec/examples/draft-iab-html-rfc-bis.xml.adoc +2300 -0
  65. data/spec/examples/draft-iab-html-rfc-bis.xml.orig +1999 -0
  66. data/spec/examples/draft-iab-html-rfc-bis.xml.txt +2298 -0
  67. data/spec/examples/draft-iab-rfc-framework-bis.xml.adoc +662 -0
  68. data/spec/examples/draft-iab-rfc-framework-bis.xml.orig +476 -0
  69. data/spec/examples/draft-ietf-core-block-xx.mkd.adoc +8 -33
  70. data/spec/examples/hoffmanv2.xml.adoc +4 -0
  71. data/spec/examples/mib-doc-template-xml-06.adoc +6 -8
  72. data/spec/examples/refs-v2-database.xml +86 -0
  73. data/spec/examples/refs-v2.adoc +49 -0
  74. data/spec/examples/refs-v2.xml +50 -0
  75. data/spec/examples/refs-v2/AsciiDoc.xml +8 -0
  76. data/spec/examples/refs-v2/AsciiMathML.xml +8 -0
  77. data/spec/examples/refs-v2/IETF-BibXML.xml +9 -0
  78. data/spec/examples/refs-v2/MathJax.xml +8 -0
  79. data/spec/examples/refs-v2/NroffEdit.xml +8 -0
  80. data/spec/examples/refs-v2/TeX-LaTeX.xml +8 -0
  81. data/spec/examples/refs-v2/abarth +17 -0
  82. data/spec/examples/refs-v2/asciidoctor-bibliography.xml +19 -0
  83. data/spec/examples/refs-v2/asciidoctor-manual.xml +11 -0
  84. data/spec/examples/refs-v2/asciidoctor-rfc.xml +18 -0
  85. data/spec/examples/refs-v2/asciidoctor.xml +10 -0
  86. data/spec/examples/refs-v2/draftr.xml +8 -0
  87. data/spec/examples/refs-v2/kramdown-rfc2629.xml +8 -0
  88. data/spec/examples/refs-v2/lyx2rfc.xml +8 -0
  89. data/spec/examples/refs-v2/mmark.xml +9 -0
  90. data/spec/examples/refs-v2/pandoc2rfc.xml +8 -0
  91. data/spec/examples/refs-v2/reference.RFC.2119.xml +7 -0
  92. data/spec/examples/refs-v2/reference.RFC.5385.xml +7 -0
  93. data/spec/examples/refs-v2/reference.RFC.7328.xml +7 -0
  94. data/spec/examples/refs-v2/reference.RFC.7749.xml +7 -0
  95. data/spec/examples/refs-v2/reference.RFC.7763.xml +7 -0
  96. data/spec/examples/refs-v2/reference.RFC.7764.xml +7 -0
  97. data/spec/examples/refs-v2/reference.RFC.7990.xml +7 -0
  98. data/spec/examples/refs-v2/reference.RFC.7991.xml +7 -0
  99. data/spec/examples/refs-v3-database.xml +137 -0
  100. data/spec/examples/refs-v3.adoc +57 -0
  101. data/spec/examples/refs-v3.xml +90 -0
  102. data/spec/examples/refs-v3/AsciiDoc.xml +8 -0
  103. data/spec/examples/refs-v3/AsciiMathML.xml +8 -0
  104. data/spec/examples/refs-v3/IETF-BibXML.xml +9 -0
  105. data/spec/examples/refs-v3/MathJax.xml +8 -0
  106. data/spec/examples/refs-v3/NroffEdit.xml +8 -0
  107. data/spec/examples/refs-v3/TeX-LaTeX.xml +8 -0
  108. data/spec/examples/refs-v3/abarth +17 -0
  109. data/spec/examples/refs-v3/asciidoctor-bibliography.xml +19 -0
  110. data/spec/examples/refs-v3/asciidoctor-manual.xml +11 -0
  111. data/spec/examples/refs-v3/asciidoctor-rfc.xml +18 -0
  112. data/spec/examples/refs-v3/asciidoctor.xml +10 -0
  113. data/spec/examples/refs-v3/draftr.xml +8 -0
  114. data/spec/examples/refs-v3/kramdown-rfc2629.xml +8 -0
  115. data/spec/examples/refs-v3/lyx2rfc.xml +8 -0
  116. data/spec/examples/refs-v3/mathrefs.xml +19 -0
  117. data/spec/examples/refs-v3/mmark.xml +9 -0
  118. data/spec/examples/refs-v3/pandoc2rfc.xml +8 -0
  119. data/spec/examples/refs-v3/reference.RFC.2119.xml +7 -0
  120. data/spec/examples/refs-v3/reference.RFC.5385.xml +7 -0
  121. data/spec/examples/refs-v3/reference.RFC.7328.xml +7 -0
  122. data/spec/examples/refs-v3/reference.RFC.7749.xml +7 -0
  123. data/spec/examples/refs-v3/reference.RFC.7763.xml +7 -0
  124. data/spec/examples/refs-v3/reference.RFC.7764.xml +7 -0
  125. data/spec/examples/refs-v3/reference.RFC.7990.xml +7 -0
  126. data/spec/examples/refs-v3/reference.RFC.7991.xml +7 -0
  127. data/spec/examples/rfc2100.md.adoc +57 -44
  128. data/spec/examples/rfc3514.md.adoc +1 -1
  129. data/spec/examples/rfc6350.adoc +701 -695
  130. data/spec/examples/rfc6350.txt.orig +3372 -0
  131. data/spec/examples/rfc6350_refs.xml +774 -0
  132. data/spec/examples/rfc748.md.adoc +1 -1
  133. data/spec/examples/rfc7511.md.adoc +3 -3
  134. data/spec/examples/skel.mkd.adoc +1 -0
  135. data/spec/examples/stupid-s.mkd.adoc +4 -4
  136. metadata +94 -8
  137. data/spec/examples/rfc6350.bib +0 -763
@@ -106,25 +106,23 @@ module Asciidoctor
106
106
  # all but last term have empty dd
107
107
  terms.each_with_index do |term, idx|
108
108
  t_attributes = {
109
- hangText: flatten_rawtext(term.text).join(' '),
109
+ hangText: flatten_rawtext(term.text).join(" "),
110
110
  }
111
111
 
112
112
  if idx < terms.size - 1
113
113
  xml_list.t **attr_code(t_attributes)
114
114
  else
115
115
  xml_list.t **attr_code(t_attributes) do |xml_t|
116
- if !dd.nil?
117
- if dd.text?
118
- # This vspace element is extraneous to the RFC XML spec,
119
- # but is required by IDNITS
120
- xml_t.vspace({blankLines: "1"}) unless $inline_definition_lists
121
- xml_t << dd.text
122
- end
123
- if dd.blocks?
124
- # v2 does not support multi paragraph list items;
125
- # vspace is used to emulate them
126
- xml_t << para_to_vspace(dd.content)
127
- end
116
+ if !dd.nil? && dd.text?
117
+ # This vspace element is extraneous to the RFC XML spec,
118
+ # but is required by IDNITS
119
+ xml_t.vspace(blankLines: "1") unless $inline_definition_lists
120
+ xml_t << dd.text
121
+ end
122
+ if !dd.nil? && dd.blocks?
123
+ # v2 does not support multi paragraph list items;
124
+ # vspace is used to emulate them
125
+ xml_t << para_to_vspace(dd.content)
128
126
  end
129
127
  end
130
128
  end
@@ -10,11 +10,12 @@ module Asciidoctor
10
10
  # |===
11
11
  def table(node)
12
12
  has_body = false
13
+ has_head = false
13
14
  style_value = case node.attr "grid"
14
15
  when "all"
15
16
  "all"
16
17
  when "rows"
17
- "none" # not supported
18
+ "headers"
18
19
  when "cols"
19
20
  "full"
20
21
  when "none"
@@ -22,8 +23,7 @@ module Asciidoctor
22
23
  else
23
24
  "full"
24
25
  end
25
-
26
- warn "asciidoctor: WARNING: grid=rows attribute is not supported on tables" if node.attr("grid") == "rows"
26
+ warn "asciidoctor: WARNING (#{current_location(node)}): grid=rows attribute is not supported on tables" if node.attr("grid") == "rows"
27
27
  texttable_attributes = {
28
28
  anchor: node.id,
29
29
  title: node.title,
@@ -36,8 +36,10 @@ module Asciidoctor
36
36
  xml.texttable **attr_code(texttable_attributes) do |xml_texttable|
37
37
  [:head, :body, :foot].reject { |tblsec| node.rows[tblsec].empty? }.each do |tblsec|
38
38
  has_body = true if tblsec == :body
39
+ has_head = true if tblsec == :head
39
40
  end
40
- warn "asciidoctor: WARNING: tables must have at least one body row" unless has_body
41
+ warn "asciidoctor: WARNING (#{current_location(node)}): tables must have at least one body row" unless has_body
42
+ warn "asciidoctor: WARNING (#{current_location(node)}): tables must have at least one head row" unless has_head
41
43
 
42
44
  # preamble, postamble elements not supported
43
45
  table_head node, xml_texttable
@@ -50,13 +52,13 @@ module Asciidoctor
50
52
 
51
53
  def table_head(node, xml)
52
54
  [:head].reject { |tblsec| node.rows[tblsec].empty? }.each do |tblsec|
53
- warn "asciidoctor: WARNING: RFC XML v2 tables only support a single header row" if node.rows[tblsec].size > 1
55
+ warn "asciidoctor: WARNING (#{current_location(node)}): RFC XML v2 tables only support a single header row" if node.rows[tblsec].size > 1
54
56
  widths = table_widths(node)
55
57
  node.rows[tblsec].each do |row|
56
58
  rowlength = 0
57
59
  row.each_with_index do |cell, i|
58
- warn "asciidoctor: WARNING: RFC XML v2 tables do not support colspan attribute" unless cell.colspan.nil?
59
- warn "asciidoctor: WARNING: RFC XML v2 tables do not support rowspan attribute" unless cell.rowspan.nil?
60
+ warn "asciidoctor: WARNING (#{current_location(node)}): RFC XML v2 tables do not support colspan attribute" unless cell.colspan.nil?
61
+ warn "asciidoctor: WARNING (#{current_location(node)}): RFC XML v2 tables do not support rowspan attribute" unless cell.rowspan.nil?
60
62
  width = if node.option?("autowidth") || i >= widths[:percentage].size || !widths[:named]
61
63
  nil
62
64
  else
@@ -74,7 +76,7 @@ module Asciidoctor
74
76
  # NOT cell.content: v2 does not permit blocks in cells
75
77
  end
76
78
  end
77
- warn "asciidoctor: WARNING: header row of table is longer than 72 ascii characters" if rowlength > 72
79
+ warn "asciidoctor: WARNING (#{current_location(node)}): header row of table is longer than 72 ascii characters" if rowlength > 72
78
80
  end
79
81
  end
80
82
  end
@@ -103,7 +105,7 @@ module Asciidoctor
103
105
  # NOT cell.content: v2 does not permit blocks in cells
104
106
  end
105
107
  end
106
- warn "asciidoctor: WARNING: row #{i} of table is longer than 72 ascii characters" if rowlength > 72
108
+ warn "asciidoctor: WARNING (#{current_location(node)}): row #{i} of table is longer than 72 ascii characters" if rowlength > 72
107
109
  end
108
110
  end
109
111
  end
@@ -1,736 +1,30 @@
1
1
  require "nokogiri"
2
+ require "jing"
2
3
 
3
4
  module Asciidoctor
4
5
  module RFC::V2
5
6
  module Validate
6
7
  class << self
7
8
  def validate(doc)
8
- schemadoc = relaxng
9
- schema = Nokogiri::XML::RelaxNG(schemadoc)
10
- schema.validate(Nokogiri::XML(doc)).each do |error|
11
- $stderr.puts "V2 RELAXNG Validation: #{error.message}"
9
+ filename = File.join(File.dirname(__FILE__), "validate2.rng")
10
+ schema = Jing.new(filename)
11
+
12
+ File.open(".tmp.xml", "w") { |f| f.write(doc.to_xml) }
13
+
14
+ begin
15
+ errors = schema.validate(".tmp.xml")
16
+ rescue Jing::Error => e
17
+ abort "[asciidoctor-rfc] Validation error: #{e}"
18
+ end
19
+
20
+ if errors.none?
21
+ warn "[asciidoctor-rfc] Validation passed."
22
+ else
23
+ errors.each do |error|
24
+ warn "[asciidoctor-rfc] #{error[:message]} @ #{error[:line]}:#{error[:column]}"
25
+ end
12
26
  end
13
- end
14
27
 
15
- def relaxng
16
- <<~RELAXNG
17
- <?xml version="1.0" encoding="UTF-8"?>
18
- <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
19
- <define name="rfc">
20
- <element name="rfc">
21
- <optional>
22
- <attribute name="number"/>
23
- </optional>
24
- <optional>
25
- <attribute name="obsoletes" a:defaultValue=""/>
26
- </optional>
27
- <optional>
28
- <attribute name="updates" a:defaultValue=""/>
29
- </optional>
30
- <optional>
31
- <attribute name="category">
32
- <choice>
33
- <value>std</value>
34
- <value>bcp</value>
35
- <value>info</value>
36
- <value>exp</value>
37
- <value>historic</value>
38
- </choice>
39
- </attribute>
40
- </optional>
41
- <optional>
42
- <attribute name="consensus">
43
- <choice>
44
- <value>no</value>
45
- <value>yes</value>
46
- </choice>
47
- </attribute>
48
- </optional>
49
- <optional>
50
- <attribute name="seriesNo"/>
51
- </optional>
52
- <optional>
53
- <attribute name="ipr">
54
- <choice>
55
- <value>full2026</value>
56
- <value>noDerivativeWorks2026</value>
57
- <value>none</value>
58
- <value>full3667</value>
59
- <value>noModification3667</value>
60
- <value>noDerivatives3667</value>
61
- <value>full3978</value>
62
- <value>noModification3978</value>
63
- <value>noDerivatives3978</value>
64
- <value>trust200811</value>
65
- <value>noModificationTrust200811</value>
66
- <value>noDerivativesTrust200811</value>
67
- <value>trust200902</value>
68
- <value>noModificationTrust200902</value>
69
- <value>noDerivativesTrust200902</value>
70
- <value>pre5378Trust200902</value>
71
- </choice>
72
- </attribute>
73
- </optional>
74
- <optional>
75
- <attribute name="iprExtract">
76
- <data type="IDREF"/>
77
- </attribute>
78
- </optional>
79
- <optional>
80
- <attribute name="submissionType" a:defaultValue="IETF">
81
- <choice>
82
- <value>IETF</value>
83
- <value>IAB</value>
84
- <value>IRTF</value>
85
- <value>independent</value>
86
- </choice>
87
- </attribute>
88
- </optional>
89
- <optional>
90
- <attribute name="docName"/>
91
- </optional>
92
- <optional>
93
- <attribute name="xml:lang" a:defaultValue="en"/>
94
- </optional>
95
- <ref name="front"/>
96
- <ref name="middle"/>
97
- <optional>
98
- <ref name="back"/>
99
- </optional>
100
- </element>
101
- </define>
102
- <define name="front">
103
- <element name="front">
104
- <ref name="title"/>
105
- <oneOrMore>
106
- <ref name="author"/>
107
- </oneOrMore>
108
- <ref name="date"/>
109
- <zeroOrMore>
110
- <ref name="area"/>
111
- </zeroOrMore>
112
- <zeroOrMore>
113
- <ref name="workgroup"/>
114
- </zeroOrMore>
115
- <zeroOrMore>
116
- <ref name="keyword"/>
117
- </zeroOrMore>
118
- <optional>
119
- <ref name="abstract"/>
120
- </optional>
121
- <zeroOrMore>
122
- <ref name="note"/>
123
- </zeroOrMore>
124
- </element>
125
- </define>
126
- <define name="title">
127
- <element name="title">
128
- <optional>
129
- <attribute name="abbrev"/>
130
- </optional>
131
- <text/>
132
- </element>
133
- </define>
134
- <define name="author">
135
- <element name="author">
136
- <optional>
137
- <attribute name="initials"/>
138
- </optional>
139
- <optional>
140
- <attribute name="surname"/>
141
- </optional>
142
- <optional>
143
- <attribute name="fullname"/>
144
- </optional>
145
- <optional>
146
- <attribute name="role">
147
- <value>editor</value>
148
- </attribute>
149
- </optional>
150
- <optional>
151
- <ref name="organization"/>
152
- </optional>
153
- <optional>
154
- <ref name="address"/>
155
- </optional>
156
- </element>
157
- </define>
158
- <define name="organization">
159
- <element name="organization">
160
- <optional>
161
- <attribute name="abbrev"/>
162
- </optional>
163
- <text/>
164
- </element>
165
- </define>
166
- <define name="address">
167
- <element name="address">
168
- <optional>
169
- <ref name="postal"/>
170
- </optional>
171
- <optional>
172
- <ref name="phone"/>
173
- </optional>
174
- <optional>
175
- <ref name="facsimile"/>
176
- </optional>
177
- <optional>
178
- <ref name="email"/>
179
- </optional>
180
- <optional>
181
- <ref name="uri"/>
182
- </optional>
183
- </element>
184
- </define>
185
- <define name="postal">
186
- <element name="postal">
187
- <oneOrMore>
188
- <ref name="street"/>
189
- </oneOrMore>
190
- <zeroOrMore>
191
- <choice>
192
- <ref name="city"/>
193
- <ref name="region"/>
194
- <ref name="code"/>
195
- <ref name="country"/>
196
- </choice>
197
- </zeroOrMore>
198
- </element>
199
- </define>
200
- <define name="street">
201
- <element name="street">
202
- <text/>
203
- </element>
204
- </define>
205
- <define name="city">
206
- <element name="city">
207
- <text/>
208
- </element>
209
- </define>
210
- <define name="region">
211
- <element name="region">
212
- <text/>
213
- </element>
214
- </define>
215
- <define name="code">
216
- <element name="code">
217
- <text/>
218
- </element>
219
- </define>
220
- <define name="country">
221
- <element name="country">
222
- <text/>
223
- </element>
224
- </define>
225
- <define name="phone">
226
- <element name="phone">
227
- <text/>
228
- </element>
229
- </define>
230
- <define name="facsimile">
231
- <element name="facsimile">
232
- <text/>
233
- </element>
234
- </define>
235
- <define name="email">
236
- <element name="email">
237
- <text/>
238
- </element>
239
- </define>
240
- <define name="uri">
241
- <element name="uri">
242
- <text/>
243
- </element>
244
- </define>
245
- <define name="date">
246
- <element name="date">
247
- <optional>
248
- <attribute name="day"/>
249
- </optional>
250
- <optional>
251
- <attribute name="month"/>
252
- </optional>
253
- <optional>
254
- <attribute name="year"/>
255
- </optional>
256
- <empty/>
257
- </element>
258
- </define>
259
- <define name="area">
260
- <element name="area">
261
- <text/>
262
- </element>
263
- </define>
264
- <define name="workgroup">
265
- <element name="workgroup">
266
- <text/>
267
- </element>
268
- </define>
269
- <define name="keyword">
270
- <element name="keyword">
271
- <text/>
272
- </element>
273
- </define>
274
- <define name="abstract">
275
- <element name="abstract">
276
- <oneOrMore>
277
- <ref name="t"/>
278
- </oneOrMore>
279
- </element>
280
- </define>
281
- <define name="note">
282
- <element name="note">
283
- <attribute name="title"/>
284
- <oneOrMore>
285
- <ref name="t"/>
286
- </oneOrMore>
287
- </element>
288
- </define>
289
- <define name="middle">
290
- <element name="middle">
291
- <oneOrMore>
292
- <ref name="section"/>
293
- </oneOrMore>
294
- </element>
295
- </define>
296
- <define name="section">
297
- <element name="section">
298
- <optional>
299
- <attribute name="anchor">
300
- <data type="ID"/>
301
- </attribute>
302
- </optional>
303
- <attribute name="title"/>
304
- <optional>
305
- <attribute name="toc" a:defaultValue="default">
306
- <choice>
307
- <value>include</value>
308
- <value>exclude</value>
309
- <value>default</value>
310
- </choice>
311
- </attribute>
312
- </optional>
313
- <zeroOrMore>
314
- <choice>
315
- <ref name="t"/>
316
- <ref name="figure"/>
317
- <ref name="texttable"/>
318
- <ref name="iref"/>
319
- </choice>
320
- </zeroOrMore>
321
- <zeroOrMore>
322
- <ref name="section"/>
323
- </zeroOrMore>
324
- </element>
325
- </define>
326
- <define name="t">
327
- <element name="t">
328
- <optional>
329
- <attribute name="anchor">
330
- <data type="ID"/>
331
- </attribute>
332
- </optional>
333
- <optional>
334
- <attribute name="hangText"/>
335
- </optional>
336
- <zeroOrMore>
337
- <choice>
338
- <text/>
339
- <ref name="list"/>
340
- <ref name="figure"/>
341
- <ref name="xref"/>
342
- <ref name="eref"/>
343
- <ref name="iref"/>
344
- <ref name="cref"/>
345
- <ref name="spanx"/>
346
- <ref name="vspace"/>
347
- </choice>
348
- </zeroOrMore>
349
- </element>
350
- </define>
351
- <define name="list">
352
- <element name="list">
353
- <optional>
354
- <attribute name="style"/>
355
- </optional>
356
- <optional>
357
- <attribute name="hangIndent"/>
358
- </optional>
359
- <optional>
360
- <attribute name="counter"/>
361
- </optional>
362
- <oneOrMore>
363
- <ref name="t"/>
364
- </oneOrMore>
365
- </element>
366
- </define>
367
- <define name="xref">
368
- <element name="xref">
369
- <attribute name="target">
370
- <data type="IDREF"/>
371
- </attribute>
372
- <optional>
373
- <attribute name="pageno" a:defaultValue="false">
374
- <choice>
375
- <value>true</value>
376
- <value>false</value>
377
- </choice>
378
- </attribute>
379
- </optional>
380
- <optional>
381
- <attribute name="format" a:defaultValue="default">
382
- <choice>
383
- <value>counter</value>
384
- <value>title</value>
385
- <value>none</value>
386
- <value>default</value>
387
- </choice>
388
- </attribute>
389
- </optional>
390
- <text/>
391
- </element>
392
- </define>
393
- <define name="eref">
394
- <element name="eref">
395
- <attribute name="target"/>
396
- <text/>
397
- </element>
398
- </define>
399
- <define name="iref">
400
- <element name="iref">
401
- <attribute name="item"/>
402
- <optional>
403
- <attribute name="subitem" a:defaultValue=""/>
404
- </optional>
405
- <optional>
406
- <attribute name="primary" a:defaultValue="false">
407
- <choice>
408
- <value>true</value>
409
- <value>false</value>
410
- </choice>
411
- </attribute>
412
- </optional>
413
- <empty/>
414
- </element>
415
- </define>
416
- <define name="cref">
417
- <element name="cref">
418
- <optional>
419
- <attribute name="anchor">
420
- <data type="ID"/>
421
- </attribute>
422
- </optional>
423
- <optional>
424
- <attribute name="source"/>
425
- </optional>
426
- <text/>
427
- </element>
428
- </define>
429
- <define name="spanx">
430
- <element name="spanx">
431
- <optional>
432
- <attribute name="xml:space" a:defaultValue="preserve">
433
- <choice>
434
- <value>default</value>
435
- <value>preserve</value>
436
- </choice>
437
- </attribute>
438
- </optional>
439
- <optional>
440
- <attribute name="style" a:defaultValue="emph"/>
441
- </optional>
442
- <text/>
443
- </element>
444
- </define>
445
- <define name="vspace">
446
- <element name="vspace">
447
- <optional>
448
- <attribute name="blankLines" a:defaultValue="0"/>
449
- </optional>
450
- <empty/>
451
- </element>
452
- </define>
453
- <define name="figure">
454
- <element name="figure">
455
- <optional>
456
- <attribute name="anchor">
457
- <data type="ID"/>
458
- </attribute>
459
- </optional>
460
- <optional>
461
- <attribute name="title" a:defaultValue=""/>
462
- </optional>
463
- <optional>
464
- <attribute name="suppress-title" a:defaultValue="false">
465
- <choice>
466
- <value>true</value>
467
- <value>false</value>
468
- </choice>
469
- </attribute>
470
- </optional>
471
- <optional>
472
- <attribute name="src"/>
473
- </optional>
474
- <optional>
475
- <attribute name="align" a:defaultValue="left">
476
- <choice>
477
- <value>left</value>
478
- <value>center</value>
479
- <value>right</value>
480
- </choice>
481
- </attribute>
482
- </optional>
483
- <optional>
484
- <attribute name="alt" a:defaultValue=""/>
485
- </optional>
486
- <optional>
487
- <attribute name="width" a:defaultValue=""/>
488
- </optional>
489
- <optional>
490
- <attribute name="height" a:defaultValue=""/>
491
- </optional>
492
- <zeroOrMore>
493
- <ref name="iref"/>
494
- </zeroOrMore>
495
- <optional>
496
- <ref name="preamble"/>
497
- </optional>
498
- <ref name="artwork"/>
499
- <optional>
500
- <ref name="postamble"/>
501
- </optional>
502
- </element>
503
- </define>
504
- <define name="preamble">
505
- <element name="preamble">
506
- <zeroOrMore>
507
- <choice>
508
- <text/>
509
- <ref name="xref"/>
510
- <ref name="eref"/>
511
- <ref name="iref"/>
512
- <ref name="cref"/>
513
- <ref name="spanx"/>
514
- </choice>
515
- </zeroOrMore>
516
- </element>
517
- </define>
518
- <define name="artwork">
519
- <element name="artwork">
520
- <optional>
521
- <attribute name="xml:space" a:defaultValue="preserve">
522
- <choice>
523
- <value>default</value>
524
- <value>preserve</value>
525
- </choice>
526
- </attribute>
527
- </optional>
528
- <optional>
529
- <attribute name="name" a:defaultValue=""/>
530
- </optional>
531
- <optional>
532
- <attribute name="type" a:defaultValue=""/>
533
- </optional>
534
- <optional>
535
- <attribute name="src"/>
536
- </optional>
537
- <optional>
538
- <attribute name="align" a:defaultValue="left">
539
- <choice>
540
- <value>left</value>
541
- <value>center</value>
542
- <value>right</value>
543
- </choice>
544
- </attribute>
545
- </optional>
546
- <optional>
547
- <attribute name="alt" a:defaultValue=""/>
548
- </optional>
549
- <optional>
550
- <attribute name="width" a:defaultValue=""/>
551
- </optional>
552
- <optional>
553
- <attribute name="height" a:defaultValue=""/>
554
- </optional>
555
- <zeroOrMore>
556
- <text/>
557
- </zeroOrMore>
558
- </element>
559
- </define>
560
- <define name="postamble">
561
- <element name="postamble">
562
- <zeroOrMore>
563
- <choice>
564
- <text/>
565
- <ref name="xref"/>
566
- <ref name="eref"/>
567
- <ref name="iref"/>
568
- <ref name="cref"/>
569
- <ref name="spanx"/>
570
- </choice>
571
- </zeroOrMore>
572
- </element>
573
- </define>
574
- <define name="texttable">
575
- <element name="texttable">
576
- <optional>
577
- <attribute name="anchor">
578
- <data type="ID"/>
579
- </attribute>
580
- </optional>
581
- <optional>
582
- <attribute name="title" a:defaultValue=""/>
583
- </optional>
584
- <optional>
585
- <attribute name="suppress-title" a:defaultValue="false">
586
- <choice>
587
- <value>true</value>
588
- <value>false</value>
589
- </choice>
590
- </attribute>
591
- </optional>
592
- <optional>
593
- <attribute name="align" a:defaultValue="center">
594
- <choice>
595
- <value>left</value>
596
- <value>center</value>
597
- <value>right</value>
598
- </choice>
599
- </attribute>
600
- </optional>
601
- <optional>
602
- <attribute name="style" a:defaultValue="full">
603
- <choice>
604
- <value>all</value>
605
- <value>none</value>
606
- <value>headers</value>
607
- <value>full</value>
608
- </choice>
609
- </attribute>
610
- </optional>
611
- <optional>
612
- <ref name="preamble"/>
613
- </optional>
614
- <oneOrMore>
615
- <ref name="ttcol"/>
616
- </oneOrMore>
617
- <zeroOrMore>
618
- <ref name="c"/>
619
- </zeroOrMore>
620
- <optional>
621
- <ref name="postamble"/>
622
- </optional>
623
- </element>
624
- </define>
625
- <define name="ttcol">
626
- <element name="ttcol">
627
- <optional>
628
- <attribute name="width"/>
629
- </optional>
630
- <optional>
631
- <attribute name="align" a:defaultValue="left">
632
- <choice>
633
- <value>left</value>
634
- <value>center</value>
635
- <value>right</value>
636
- </choice>
637
- </attribute>
638
- </optional>
639
- <text/>
640
- </element>
641
- </define>
642
- <define name="c">
643
- <element name="c">
644
- <zeroOrMore>
645
- <choice>
646
- <text/>
647
- <ref name="xref"/>
648
- <ref name="eref"/>
649
- <ref name="iref"/>
650
- <ref name="cref"/>
651
- <ref name="spanx"/>
652
- </choice>
653
- </zeroOrMore>
654
- </element>
655
- </define>
656
- <define name="back">
657
- <element name="back">
658
- <zeroOrMore>
659
- <ref name="references"/>
660
- </zeroOrMore>
661
- <zeroOrMore>
662
- <ref name="section"/>
663
- </zeroOrMore>
664
- </element>
665
- </define>
666
- <define name="references">
667
- <element name="references">
668
- <optional>
669
- <attribute name="title" a:defaultValue="References"/>
670
- </optional>
671
- <oneOrMore>
672
- <ref name="reference"/>
673
- </oneOrMore>
674
- </element>
675
- </define>
676
- <define name="reference">
677
- <element name="reference">
678
- <attribute name="anchor">
679
- <data type="ID"/>
680
- </attribute>
681
- <optional>
682
- <attribute name="target"/>
683
- </optional>
684
- <ref name="front"/>
685
- <zeroOrMore>
686
- <ref name="seriesInfo"/>
687
- </zeroOrMore>
688
- <zeroOrMore>
689
- <ref name="format"/>
690
- </zeroOrMore>
691
- <zeroOrMore>
692
- <ref name="annotation"/>
693
- </zeroOrMore>
694
- </element>
695
- </define>
696
- <define name="seriesInfo">
697
- <element name="seriesInfo">
698
- <attribute name="name"/>
699
- <attribute name="value"/>
700
- <empty/>
701
- </element>
702
- </define>
703
- <define name="format">
704
- <element name="format">
705
- <optional>
706
- <attribute name="target"/>
707
- </optional>
708
- <attribute name="type"/>
709
- <optional>
710
- <attribute name="octets"/>
711
- </optional>
712
- <empty/>
713
- </element>
714
- </define>
715
- <define name="annotation">
716
- <element name="annotation">
717
- <zeroOrMore>
718
- <choice>
719
- <text/>
720
- <ref name="xref"/>
721
- <ref name="eref"/>
722
- <ref name="iref"/>
723
- <ref name="cref"/>
724
- <ref name="spanx"/>
725
- </choice>
726
- </zeroOrMore>
727
- </element>
728
- </define>
729
- <start>
730
- <ref name="rfc"/>
731
- </start>
732
- </grammar>
733
- RELAXNG
734
28
  end
735
29
  end
736
30
  end