1namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
2namespace ns1 = "http://www.w3.org/2000/svg"
3
4# xml2rfc Version 3 grammar
5rfc =
6  element rfc {
7    attribute xml:base { text }?,
8    attribute xml:lang { text }?,
9    attribute number { text }?,
10    [ a:defaultValue = "" ] attribute obsoletes { text }?,
11    [ a:defaultValue = "" ] attribute updates { text }?,
12    attribute category { text }?,
13    attribute mode { text }?,
14    [ a:defaultValue = "false" ]
15    attribute consensus { "no" | "yes" | "false" | "true" }?,
16    attribute seriesNo { text }?,
17    attribute ipr {
18      "full2026"
19      | "noDerivativeWorks2026"
20      | "none"
21      | "full3667"
22      | "noModification3667"
23      | "noDerivatives3667"
24      | "full3978"
25      | "noModification3978"
26      | "noDerivatives3978"
27      | "trust200811"
28      | "noModificationTrust200811"
29      | "noDerivativesTrust200811"
30      | "trust200902"
31      | "noModificationTrust200902"
32      | "noDerivativesTrust200902"
33      | "pre5378Trust200902"
34    }?,
35    attribute iprExtract { xsd:IDREF }?,
36    [ a:defaultValue = "IETF" ]
37    attribute submissionType {
38      "IETF" | "IAB" | "IRTF" | "independent"
39    }?,
40    attribute docName { text }?,
41    [ a:defaultValue = "false" ]
42    attribute sortRefs { "true" | "false" }?,
43    [ a:defaultValue = "true" ]
44    attribute symRefs { "true" | "false" }?,
45    [ a:defaultValue = "true" ]
46    attribute tocInclude { "true" | "false" }?,
47    [ a:defaultValue = "3" ] attribute tocDepth { text }?,
48    attribute prepTime { text }?,
49    [ a:defaultValue = "true" ]
50    attribute indexInclude { "true" | "false" }?,
51    attribute version { text }?,
52    [ a:defaultValue = "Common,Latin" ] attribute scripts { text }?,
53    attribute expiresDate { text }?,
54    link*,
55    front,
56    middle,
57    back?
58  }
59link =
60  element link {
61    attribute xml:base { text }?,
62    attribute xml:lang { text }?,
63    attribute href { text },
64    attribute rel { text }?
65  }
66front =
67  element front {
68    attribute xml:base { text }?,
69    attribute xml:lang { text }?,
70    title,
71    author+,
72    date?,
73    area*,
74    workgroup*,
75    keyword*,
76    abstract?,
77    seriesInfo*,
78    note*,
79    boilerplate?
80  }
81title =
82  element title {
83    attribute xml:base { text }?,
84    attribute xml:lang { text }?,
85    attribute abbrev { text }?,
86    attribute ascii { text }?,
87    text
88  }
89author =
90  element author {
91    attribute xml:base { text }?,
92    attribute xml:lang { text }?,
93    attribute initials { text }?,
94    attribute asciiInitials { text }?,
95    attribute surname { text }?,
96    attribute asciiSurname { text }?,
97    attribute fullname { text }?,
98    attribute role { "editor" }?,
99    attribute asciiFullname { text }?,
100    organization?,
101    address?
102  }
103organization =
104  element organization {
105    attribute xml:base { text }?,
106    attribute xml:lang { text }?,
107    attribute abbrev { text }?,
108    attribute ascii { text }?,
109    text
110  }
111address =
112  element address {
113    attribute xml:base { text }?,
114    attribute xml:lang { text }?,
115    postal?,
116    phone?,
117    facsimile?,
118    email?,
119    uri?
120  }
121postal =
122  element postal {
123    attribute xml:base { text }?,
124    attribute xml:lang { text }?,
125    ((city | code | country | region | street)* | postalLine+)
126  }
127street =
128  element street {
129    attribute xml:base { text }?,
130    attribute xml:lang { text }?,
131    attribute ascii { text }?,
132    text
133  }
134city =
135  element city {
136    attribute xml:base { text }?,
137    attribute xml:lang { text }?,
138    attribute ascii { text }?,
139    text
140  }
141region =
142  element region {
143    attribute xml:base { text }?,
144    attribute xml:lang { text }?,
145    attribute ascii { text }?,
146    text
147  }
148code =
149  element code {
150    attribute xml:base { text }?,
151    attribute xml:lang { text }?,
152    attribute ascii { text }?,
153    text
154  }
155country =
156  element country {
157    attribute xml:base { text }?,
158    attribute xml:lang { text }?,
159    attribute ascii { text }?,
160    text
161  }
162postalLine =
163  element postalLine {
164    attribute xml:base { text }?,
165    attribute xml:lang { text }?,
166    attribute ascii { text }?,
167    text
168  }
169phone =
170  element phone {
171    attribute xml:base { text }?,
172    attribute xml:lang { text }?,
173    text
174  }
175facsimile =
176  element facsimile {
177    attribute xml:base { text }?,
178    attribute xml:lang { text }?,
179    text
180  }
181email =
182  element email {
183    attribute xml:base { text }?,
184    attribute xml:lang { text }?,
185    attribute ascii { text }?,
186    text
187  }
188uri =
189  element uri {
190    attribute xml:base { text }?,
191    attribute xml:lang { text }?,
192    text
193  }
194date =
195  element date {
196    attribute xml:base { text }?,
197    attribute xml:lang { text }?,
198    attribute day { text }?,
199    attribute month { text }?,
200    attribute year { text }?,
201    empty
202  }
203area =
204  element area {
205    attribute xml:base { text }?,
206    attribute xml:lang { text }?,
207    text
208  }
209workgroup =
210  element workgroup {
211    attribute xml:base { text }?,
212    attribute xml:lang { text }?,
213    text
214  }
215keyword =
216  element keyword {
217    attribute xml:base { text }?,
218    attribute xml:lang { text }?,
219    text
220  }
221abstract =
222  element abstract {
223    attribute xml:base { text }?,
224    attribute xml:lang { text }?,
225    attribute anchor { xsd:ID }?,
226    attribute pn { text }?,
227    (dl | ol | t | ul)+
228  }
229note =
230  element note {
231    attribute xml:base { text }?,
232    attribute xml:lang { text }?,
233    attribute title { text }?,
234    attribute pn { text }?,
235    [ a:defaultValue = "false" ]
236    attribute removeInRFC { "true" | "false" }?,
237    name?,
238    (dl | ol | t | ul)+
239  }
240boilerplate =
241  element boilerplate {
242    attribute xml:base { text }?,
243    attribute xml:lang { text }?,
244    attribute pn { text }?,
245    section+
246  }
247middle =
248  element middle {
249    attribute xml:base { text }?,
250    attribute xml:lang { text }?,
251    section+
252  }
253section =
254  element section {
255    attribute xml:base { text }?,
256    attribute xml:lang { text }?,
257    attribute anchor { xsd:ID }?,
258    attribute pn { text }?,
259    attribute title { text }?,
260    [ a:defaultValue = "true" ]
261    attribute numbered { "true" | "false" }?,
262    [ a:defaultValue = "default" ]
263    attribute toc { "include" | "exclude" | "default" }?,
264    [ a:defaultValue = "false" ]
265    attribute removeInRFC { "true" | "false" }?,
266    name?,
267    (artwork
268     | aside
269     | blockquote
270     | dl
271     | figure
272     | iref
273     | ol
274     | sourcecode
275     | t
276     | table
277     | texttable
278     | ul)*,
279    section*
280  }
281name =
282  element name {
283    attribute xml:base { text }?,
284    attribute xml:lang { text }?,
285    attribute slugifiedName { text }?,
286    (text | cref | eref | relref | tt | xref)*
287  }
288t =
289  element t {
290    attribute xml:base { text }?,
291    attribute xml:lang { text }?,
292    attribute anchor { xsd:ID }?,
293    attribute pn { text }?,
294    attribute hangText { text }?,
295    [ a:defaultValue = "false" ]
296    attribute keepWithNext { "false" | "true" }?,
297    [ a:defaultValue = "false" ]
298    attribute keepWithPrevious { "false" | "true" }?,
299    (text
300     | bcp14
301     | cref
302     | em
303     | eref
304     | iref
305     | \list
306     | relref
307     | spanx
308     | strong
309     | sub
310     | sup
311     | tt
312     | vspace
313     | xref)*
314  }
315aside =
316  element aside {
317    attribute xml:base { text }?,
318    attribute xml:lang { text }?,
319    attribute anchor { xsd:ID }?,
320    attribute pn { text }?,
321    (artwork | dl | figure | iref | \list | ol | t | table | ul)*
322  }
323blockquote =
324  element blockquote {
325    attribute xml:base { text }?,
326    attribute xml:lang { text }?,
327    attribute anchor { xsd:ID }?,
328    attribute pn { text }?,
329    attribute cite { text }?,
330    attribute quotedFrom { text }?,
331    ((artwork | dl | figure | ol | sourcecode | t | ul)+
332     | (text
333        | bcp14
334        | cref
335        | em
336        | eref
337        | iref
338        | relref
339        | strong
340        | sub
341        | sup
342        | tt
343        | xref)+)
344  }
345\list =
346  element list {
347    attribute xml:base { text }?,
348    attribute xml:lang { text }?,
349    [ a:defaultValue = "empty" ] attribute style { text }?,
350    attribute hangIndent { text }?,
351    attribute counter { text }?,
352    t+
353  }
354ol =
355  element ol {
356    attribute xml:base { text }?,
357    attribute xml:lang { text }?,
358    attribute anchor { xsd:ID }?,
359    attribute pn { text }?,
360    [ a:defaultValue = "1" ] attribute type { text }?,
361    [ a:defaultValue = "1" ] attribute start { text }?,
362    attribute group { text }?,
363    [ a:defaultValue = "normal" ]
364    attribute spacing { "normal" | "compact" }?,
365    li+
366  }
367ul =
368  element ul {
369    attribute xml:base { text }?,
370    attribute xml:lang { text }?,
371    attribute anchor { xsd:ID }?,
372    attribute pn { text }?,
373    [ a:defaultValue = "normal" ]
374    attribute spacing { "normal" | "compact" }?,
375    [ a:defaultValue = "false" ]
376    attribute empty { "false" | "true" }?,
377    li+
378  }
379li =
380  element li {
381    attribute xml:base { text }?,
382    attribute xml:lang { text }?,
383    attribute anchor { xsd:ID }?,
384    attribute pn { text }?,
385    ((artwork | dl | figure | ol | sourcecode | t | ul)+
386     | (text
387        | bcp14
388        | cref
389        | em
390        | eref
391        | iref
392        | relref
393        | strong
394        | sub
395        | sup
396        | tt
397        | xref)+)
398  }
399dl =
400  element dl {
401    attribute xml:base { text }?,
402    attribute xml:lang { text }?,
403    attribute anchor { xsd:ID }?,
404    attribute pn { text }?,
405    [ a:defaultValue = "normal" ]
406    attribute spacing { "normal" | "compact" }?,
407    [ a:defaultValue = "true" ]
408    attribute hanging { "false" | "true" }?,
409    (dt, dd)+
410  }
411dt =
412  element dt {
413    attribute xml:base { text }?,
414    attribute xml:lang { text }?,
415    attribute anchor { xsd:ID }?,
416    attribute pn { text }?,
417    (text
418     | bcp14
419     | cref
420     | em
421     | eref
422     | iref
423     | relref
424     | strong
425     | sub
426     | sup
427     | tt
428     | xref)*
429  }
430dd =
431  element dd {
432    attribute xml:base { text }?,
433    attribute xml:lang { text }?,
434    attribute anchor { xsd:ID }?,
435    attribute pn { text }?,
436    ((artwork | dl | figure | ol | sourcecode | t | ul)+
437     | (text
438        | bcp14
439        | cref
440        | em
441        | eref
442        | iref
443        | relref
444        | strong
445        | sub
446        | sup
447        | tt
448        | xref)+)
449  }
450xref =
451  element xref {
452    attribute xml:base { text }?,
453    attribute xml:lang { text }?,
454    attribute target { xsd:IDREF },
455    [ a:defaultValue = "false" ]
456    attribute pageno { "true" | "false" }?,
457    [ a:defaultValue = "default" ]
458    attribute format { "default" | "title" | "counter" | "none" }?,
459    attribute derivedContent { text }?,
460    text
461  }
462relref =
463  element relref {
464    attribute xml:base { text }?,
465    attribute xml:lang { text }?,
466    attribute target { xsd:IDREF },
467    [ a:defaultValue = "of" ]
468    attribute displayFormat { "of" | "comma" | "parens" | "bare" }?,
469    (attribute section { text },
470     attribute relative { text }?)?,
471    attribute derivedRemoteContent { text }?,
472    attribute derivedLink { text }?,
473    text
474  }
475eref =
476  element eref {
477    attribute xml:base { text }?,
478    attribute xml:lang { text }?,
479    attribute target { text },
480    text
481  }
482iref =
483  element iref {
484    attribute xml:base { text }?,
485    attribute xml:lang { text }?,
486    attribute item { text },
487    [ a:defaultValue = "" ] attribute subitem { text }?,
488    [ a:defaultValue = "false" ]
489    attribute primary { "true" | "false" }?,
490    [ a:defaultValue = "" ] attribute irefid { text }?,
491    empty
492  }
493cref =
494  element cref {
495    attribute xml:base { text }?,
496    attribute xml:lang { text }?,
497    attribute anchor { xsd:ID }?,
498    attribute source { text }?,
499    [ a:defaultValue = "true" ]
500    attribute display { "true" | "false" }?,
501    (text | em | eref | relref | strong | sub | sup | tt | xref)*
502  }
503tt =
504  element tt {
505    attribute xml:base { text }?,
506    attribute xml:lang { text }?,
507    (text
508     | bcp14
509     | cref
510     | em
511     | eref
512     | iref
513     | relref
514     | strong
515     | sub
516     | sup
517     | xref)*
518  }
519strong =
520  element strong {
521    attribute xml:base { text }?,
522    attribute xml:lang { text }?,
523    (text
524     | bcp14
525     | cref
526     | em
527     | eref
528     | iref
529     | relref
530     | sub
531     | sup
532     | tt
533     | xref)*
534  }
535em =
536  element em {
537    attribute xml:base { text }?,
538    attribute xml:lang { text }?,
539    (text
540     | bcp14
541     | cref
542     | eref
543     | iref
544     | relref
545     | strong
546     | sub
547     | sup
548     | tt
549     | xref)*
550  }
551sub =
552  element sub {
553    attribute xml:base { text }?,
554    attribute xml:lang { text }?,
555    (text
556     | bcp14
557     | cref
558     | em
559     | eref
560     | iref
561     | relref
562     | strong
563     | tt
564     | xref)*
565  }
566sup =
567  element sup {
568    attribute xml:base { text }?,
569    attribute xml:lang { text }?,
570    (text
571     | bcp14
572     | cref
573     | em
574     | eref
575     | iref
576     | relref
577     | strong
578     | tt
579     | xref)*
580  }
581spanx =
582  element spanx {
583    attribute xml:base { text }?,
584    attribute xml:lang { text }?,
585    [ a:defaultValue = "preserve" ]
586    attribute xml:space { "default" | "preserve" }?,
587    [ a:defaultValue = "emph" ] attribute style { text }?,
588    text
589  }
590vspace =
591  element vspace {
592    attribute xml:base { text }?,
593    attribute xml:lang { text }?,
594    [ a:defaultValue = "0" ] attribute blankLines { text }?,
595    empty
596  }
597figure =
598  element figure {
599    attribute xml:base { text }?,
600    attribute xml:lang { text }?,
601    attribute anchor { xsd:ID }?,
602    attribute pn { text }?,
603    [ a:defaultValue = "" ] attribute title { text }?,
604    [ a:defaultValue = "false" ]
605    attribute suppress-title { "true" | "false" }?,
606    attribute src { text }?,
607    [ a:defaultValue = "left" ]
608    attribute align { "left" | "center" | "right" }?,
609    [ a:defaultValue = "" ] attribute alt { text }?,
610    [ a:defaultValue = "" ] attribute width { text }?,
611    [ a:defaultValue = "" ] attribute height { text }?,
612    name?,
613    iref*,
614    preamble?,
615    (artwork | sourcecode)+,
616    postamble?
617  }
618table =
619  element table {
620    attribute xml:base { text }?,
621    attribute xml:lang { text }?,
622    attribute anchor { xsd:ID }?,
623    attribute pn { text }?,
624    name?,
625    iref*,
626    thead?,
627    tbody+,
628    tfoot?
629  }
630preamble =
631  element preamble {
632    attribute xml:base { text }?,
633    attribute xml:lang { text }?,
634    (text
635     | bcp14
636     | cref
637     | em
638     | eref
639     | iref
640     | relref
641     | spanx
642     | strong
643     | sub
644     | sup
645     | tt
646     | xref)*
647  }
648artwork =
649  element artwork {
650    attribute xml:base { text }?,
651    attribute xml:lang { text }?,
652    attribute anchor { xsd:ID }?,
653    attribute pn { text }?,
654    attribute xml:space { text }?,
655    [ a:defaultValue = "" ] attribute name { text }?,
656    [ a:defaultValue = "" ] attribute type { text }?,
657    attribute src { text }?,
658    [ a:defaultValue = "left" ]
659    attribute align { "left" | "center" | "right" }?,
660    [ a:defaultValue = "" ] attribute alt { text }?,
661    [ a:defaultValue = "" ] attribute width { text }?,
662    [ a:defaultValue = "" ] attribute height { text }?,
663    attribute originalSrc { text }?,
664    (text* | svg)
665  }
666svg =
667  element ns1:svg {
668    [ a:defaultValue = "can be found in draft-brownlee-svg-rfc" ]
669    attribute TheRealDefinition { text }*,
670    # temporary added to make my validation work.
671    attribute xml:base { text }?,
672    attribute xml:lang { text }?
673  }
674sourcecode =
675  element sourcecode {
676    attribute xml:base { text }?,
677    attribute xml:lang { text }?,
678    attribute anchor { xsd:ID }?,
679    attribute pn { text }?,
680    [ a:defaultValue = "" ] attribute name { text }?,
681    [ a:defaultValue = "" ] attribute type { text }?,
682    attribute src { text }?,
683    attribute originalSrc { text }?,
684    text
685  }
686thead =
687  element thead {
688    attribute xml:base { text }?,
689    attribute xml:lang { text }?,
690    attribute anchor { xsd:ID }?,
691    attribute pn { text }?,
692    tr+
693  }
694tbody =
695  element tbody {
696    attribute xml:base { text }?,
697    attribute xml:lang { text }?,
698    attribute anchor { xsd:ID }?,
699    attribute pn { text }?,
700    tr+
701  }
702tfoot =
703  element tfoot {
704    attribute xml:base { text }?,
705    attribute xml:lang { text }?,
706    attribute anchor { xsd:ID }?,
707    attribute pn { text }?,
708    tr+
709  }
710tr =
711  element tr {
712    attribute xml:base { text }?,
713    attribute xml:lang { text }?,
714    attribute anchor { xsd:ID }?,
715    attribute pn { text }?,
716    [ a:defaultValue = "0" ] attribute border { text }?,
717    (td | th)+
718  }
719td =
720  element td {
721    attribute xml:base { text }?,
722    attribute xml:lang { text }?,
723    attribute anchor { xsd:ID }?,
724    [ a:defaultValue = "0" ] attribute border { text }?,
725    [ a:defaultValue = "0" ] attribute colspan { text }?,
726    [ a:defaultValue = "0" ] attribute rowspan { text }?,
727    [ a:defaultValue = "left" ]
728    attribute align { "left" | "center" | "right" }?,
729    (t+
730     | (text
731        | artwork
732        | bcp14
733        | br
734        | cref
735        | dl
736        | em
737        | eref
738        | figure
739        | iref
740        | ol
741        | relref
742        | sourcecode
743        | strong
744        | sub
745        | sup
746        | tt
747        | ul
748        | xref)+)
749  }
750th =
751  element th {
752    attribute xml:base { text }?,
753    attribute xml:lang { text }?,
754    attribute anchor { xsd:ID }?,
755    attribute pn { text }?,
756    [ a:defaultValue = "0" ] attribute border { text }?,
757    [ a:defaultValue = "0" ] attribute colspan { text }?,
758    [ a:defaultValue = "0" ] attribute rowspan { text }?,
759    [ a:defaultValue = "left" ]
760    attribute align { "left" | "center" | "right" }?,
761    (t+
762     | (text
763        | artwork
764        | bcp14
765        | br
766        | cref
767        | dl
768        | em
769        | eref
770        | figure
771        | iref
772        | ol
773        | relref
774        | sourcecode
775        | strong
776        | sub
777        | sup
778        | tt
779        | ul
780        | xref)+)
781  }
782postamble =
783  element postamble {
784    attribute xml:base { text }?,
785    attribute xml:lang { text }?,
786    (text | cref | eref | iref | spanx | xref)*
787  }
788texttable =
789  element texttable {
790    attribute xml:base { text }?,
791    attribute xml:lang { text }?,
792    attribute anchor { xsd:ID }?,
793    [ a:defaultValue = "" ] attribute title { text }?,
794    [ a:defaultValue = "false" ]
795    attribute suppress-title { "true" | "false" }?,
796    [ a:defaultValue = "center" ]
797    attribute align { "left" | "center" | "right" }?,
798    [ a:defaultValue = "full" ]
799    attribute style { "all" | "none" | "headers" | "full" }?,
800    name?,
801    preamble?,
802    ttcol+,
803    c*,
804    postamble?
805  }
806ttcol =
807  element ttcol {
808    attribute xml:base { text }?,
809    attribute xml:lang { text }?,
810    attribute width { text }?,
811    [ a:defaultValue = "left" ]
812    attribute align { "left" | "center" | "right" }?,
813    (cref | eref | iref | xref | text)*
814  }
815c =
816  element c {
817    attribute xml:base { text }?,
818    attribute xml:lang { text }?,
819    (text | cref | eref | iref | spanx | xref)*
820  }
821bcp14 =
822  element bcp14 {
823    attribute xml:base { text }?,
824    attribute xml:lang { text }?,
825    text
826  }
827br =
828  element br {
829    attribute xml:base { text }?,
830    attribute xml:lang { text }?,
831    empty
832  }
833back =
834  element back {
835    attribute xml:base { text }?,
836    attribute xml:lang { text }?,
837    displayreference*,
838    references*,
839    section*
840  }
841displayreference =
842  element displayreference {
843    attribute xml:base { text }?,
844    attribute xml:lang { text }?,
845    attribute target { xsd:IDREF },
846    attribute to { text }
847  }
848references =
849  element references {
850    attribute xml:base { text }?,
851    attribute xml:lang { text }?,
852    attribute anchor { xsd:ID }?,
853    attribute title { text }?,
854    name?,
855    (reference | referencegroup)*
856  }
857reference =
858  element reference {
859    attribute xml:base { text }?,
860    attribute xml:lang { text }?,
861    attribute anchor { xsd:ID },
862    attribute target { text }?,
863    [ a:defaultValue = "true" ]
864    attribute quoteTitle { "true" | "false" }?,
865    front,
866    (annotation | format | refcontent | seriesInfo)*
867  }
868referencegroup =
869  element referencegroup {
870    attribute xml:base { text }?,
871    attribute xml:lang { text }?,
872    attribute anchor { xsd:ID },
873    reference+
874  }
875seriesInfo =
876  element seriesInfo {
877    attribute xml:base { text }?,
878    attribute xml:lang { text }?,
879    attribute name { text },
880    attribute value { text },
881    attribute asciiName { text }?,
882    attribute asciiValue { text }?,
883    empty
884  }
885format =
886  element format {
887    attribute xml:base { text }?,
888    attribute xml:lang { text }?,
889    attribute target { text }?,
890    attribute type { text },
891    attribute octets { text }?,
892    empty
893  }
894annotation =
895  element annotation {
896    attribute xml:base { text }?,
897    attribute xml:lang { text }?,
898    (text
899     | bcp14
900     | cref
901     | em
902     | eref
903     | iref
904     | relref
905     | spanx
906     | strong
907     | sub
908     | sup
909     | tt
910     | xref)*
911  }
912refcontent =
913  element refcontent {
914    attribute xml:base { text }?,
915    attribute xml:lang { text }?,
916    (text | bcp14 | em | strong | sub | sup | tt)*
917  }
918start = rfc
919