forked from jcgregorio/uri-templates
-
Notifications
You must be signed in to change notification settings - Fork 2
/
draft-mrose-writing-rfcs.html
2239 lines (2072 loc) · 86 KB
/
draft-mrose-writing-rfcs.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en"><head><title>Writing I-Ds and RFCs using XML (revised)</title>
<meta http-equiv="Expires" content="Thu, 28 Feb 2008 19:06:07 +0000">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="Writing I-Ds and RFCs using XML (revised)">
<meta name="keywords" content="RFC, Request for Comments, I-D, Internet-Draft, XML, Extensible Markup Language">
<meta name="generator" content="xml2rfc v1.33 (http://xml.resource.org/)">
<style type='text/css'><!--
body {
font-family: verdana, charcoal, helvetica, arial, sans-serif;
font-size: small; color: #000; background-color: #FFF;
margin: 2em;
}
h1, h2, h3, h4, h5, h6 {
font-family: helvetica, monaco, "MS Sans Serif", arial, sans-serif;
font-weight: bold; font-style: normal;
}
h1 { color: #900; background-color: transparent; text-align: right; }
h3 { color: #333; background-color: transparent; }
td.RFCbug {
font-size: x-small; text-decoration: none;
width: 30px; height: 30px; padding-top: 2px;
text-align: justify; vertical-align: middle;
background-color: #000;
}
td.RFCbug span.RFC {
font-family: monaco, charcoal, geneva, "MS Sans Serif", helvetica, verdana, sans-serif;
font-weight: bold; color: #666;
}
td.RFCbug span.hotText {
font-family: charcoal, monaco, geneva, "MS Sans Serif", helvetica, verdana, sans-serif;
font-weight: normal; text-align: center; color: #FFF;
}
table.TOCbug { width: 30px; height: 15px; }
td.TOCbug {
text-align: center; width: 30px; height: 15px;
color: #FFF; background-color: #900;
}
td.TOCbug a {
font-family: monaco, charcoal, geneva, "MS Sans Serif", helvetica, sans-serif;
font-weight: bold; font-size: x-small; text-decoration: none;
color: #FFF; background-color: transparent;
}
td.header {
font-family: arial, helvetica, sans-serif; font-size: x-small;
vertical-align: top; width: 33%;
color: #FFF; background-color: #666;
}
td.author { font-weight: bold; font-size: x-small; margin-left: 4em; }
td.author-text { font-size: x-small; }
/* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */
a.info {
/* This is the key. */
position: relative;
z-index: 24;
text-decoration: none;
}
a.info:hover {
z-index: 25;
color: #FFF; background-color: #900;
}
a.info span { display: none; }
a.info:hover span.info {
/* The span will display just on :hover state. */
display: block;
position: absolute;
font-size: smaller;
top: 2em; left: -5em; width: 15em;
padding: 2px; border: 1px solid #333;
color: #900; background-color: #EEE;
text-align: left;
}
a { font-weight: bold; }
a:link { color: #900; background-color: transparent; }
a:visited { color: #633; background-color: transparent; }
a:active { color: #633; background-color: transparent; }
p { margin-left: 2em; margin-right: 2em; }
p.copyright { font-size: x-small; }
p.toc { font-size: small; font-weight: bold; margin-left: 3em; }
table.toc { margin: 0 0 0 3em; padding: 0; border: 0; vertical-align: text-top; }
td.toc { font-size: small; font-weight: bold; vertical-align: text-top; }
ol.text { margin-left: 2em; margin-right: 2em; }
ul.text { margin-left: 2em; margin-right: 2em; }
li { margin-left: 3em; }
/* RFC-2629 <spanx>s and <artwork>s. */
em { font-style: italic; }
strong { font-weight: bold; }
dfn { font-weight: bold; font-style: normal; }
cite { font-weight: normal; font-style: normal; }
tt { color: #036; }
tt, pre, pre dfn, pre em, pre cite, pre span {
font-family: "Courier New", Courier, monospace; font-size: small;
}
pre {
text-align: left; padding: 4px;
color: #000; background-color: #CCC;
}
pre dfn { color: #900; }
pre em { color: #66F; background-color: #FFC; font-weight: normal; }
pre .key { color: #33C; font-weight: bold; }
pre .id { color: #900; }
pre .str { color: #000; background-color: #CFF; }
pre .val { color: #066; }
pre .rep { color: #909; }
pre .oth { color: #000; background-color: #FCF; }
pre .err { background-color: #FCC; }
/* RFC-2629 <texttable>s. */
table.all, table.full, table.headers, table.none {
font-size: small; text-align: center; border-width: 2px;
vertical-align: top; border-collapse: collapse;
}
table.all, table.full { border-style: solid; border-color: black; }
table.headers, table.none { border-style: none; }
th {
font-weight: bold; border-color: black;
border-width: 2px 2px 3px 2px;
}
table.all th, table.full th { border-style: solid; }
table.headers th { border-style: none none solid none; }
table.none th { border-style: none; }
table.all td {
border-style: solid; border-color: #333;
border-width: 1px 2px;
}
table.full td, table.headers td, table.none td { border-style: none; }
hr { height: 1px; }
hr.insert {
width: 80%; border-style: none; border-width: 0;
color: #CCC; background-color: #CCC;
}
--></style>
</head>
<body>
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<table summary="layout" width="66%" border="0" cellpadding="0" cellspacing="0"><tr><td><table summary="layout" width="100%" border="0" cellpadding="2" cellspacing="1">
<tr><td class="header"> </td><td class="header">M. Rose</td></tr>
<tr><td class="header"> </td><td class="header">Dover Beach Consulting, Inc.</td></tr>
<tr><td class="header"> </td><td class="header">February 28, 2008</td></tr>
</table></td></tr></table>
<h1><br />Writing I-Ds and RFCs using XML (revised)</h1>
<h3>Abstract</h3>
<p>This memo presents a technique for using XML
(Extensible Markup Language)
as a source format for documents in the Internet-Drafts (I-Ds) and
Request for Comments (RFC) series.
This memo is an upwards-compatible revision to RFC 2629.
</p><a name="toc"></a><br /><hr />
<h3>Table of Contents</h3>
<p class="toc">
<a href="#anchor1">1.</a>
Introduction<br />
<a href="#anchor2">2.</a>
Using the DTD to Write I-Ds and RFCs<br />
<a href="#xml_basics">2.1.</a>
XML basics<br />
<a href="#front_matter">2.2.</a>
Front matter<br />
<a href="#anchor3">2.2.1.</a>
The title Element<br />
<a href="#author">2.2.2.</a>
The author Element<br />
<a href="#date">2.2.3.</a>
The date Element<br />
<a href="#anchor4">2.2.4.</a>
Meta Data Elements<br />
<a href="#anchor5">2.2.5.</a>
The abstract Element<br />
<a href="#anchor6">2.2.6.</a>
The note Element<br />
<a href="#anchor7">2.2.7.</a>
Status, Copyright Notice, Table of Contents<br />
<a href="#anchor8">2.2.8.</a>
Everything in the Front<br />
<a href="#anchor9">2.3.</a>
The Middle<br />
<a href="#section">2.3.1.</a>
The section Element<br />
<a href="#appendix">2.3.2.</a>
The appendix Element<br />
<a href="#back_matter">2.4.</a>
Back matter<br />
<a href="#references">2.4.1.</a>
The references Element<br />
<a href="#anchor12">2.4.2.</a>
Appendices<br />
<a href="#anchor13">2.4.3.</a>
Copyright Status<br />
<a href="#anchor14">3.</a>
Processing the XML Source File<br />
<a href="#anchor15">3.1.</a>
Editing<br />
<a href="#anchor16">3.1.1.</a>
Checking<br />
<a href="#xml2rfc">3.2.</a>
Converting to Text Format<br />
<a href="#anchor17">3.3.</a>
Converting to HTML Format<br />
<a href="#anchor18">3.4.</a>
Searching<br />
<a href="#rfc">Appendix A.</a>
The rfc Element<br />
<a href="#rfc2629.dtd">Appendix B.</a>
The DTD<br />
<a href="#anchor19">Appendix C.</a>
Changes from RFC 2629<br />
<a href="#anchor20">Appendix D.</a>
Conformance with RFC 2026 or RFC 3667 (Historic)<br />
<a href="#anchor21">Appendix E.</a>
Acknowledgements<br />
<a href="#anchor22">4.</a>
Security Considerations<br />
<a href="#rfc.references1">5.</a>
References<br />
<a href="#rfc.index">§</a>
Index<br />
<a href="#rfc.authors">§</a>
Author's Address<br />
</p>
<br clear="all" />
<a name="anchor1"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.1"></a><h3>1.
Introduction</h3>
<p>This memo describes how to write a document for the I-D and RFC series
using <a class='info' href='#W3C.REC-xml-20001006'>the Extensible Markup Language<span> (</span><span class='info'>Paoli, J., Maler, E., Bray, T., and C. Sperberg-McQueen, “Extensible Markup Language (XML) 1.0 (Second Edition),” October 2000.</span><span>)</span></a> [1]
(XML).
This memo has three goals:
</p>
<ol class="text">
<li>To describe a simple XML Document Type Definition (DTD) that is
powerful enough to handle the simple formatting requirements of RFC-like
documents whilst allowing for meaningful markup of descriptive
qualities.
</li>
<li>To describe software that processes XML source files,
including a tool that produces documents
conforming to <a class='info' href='#RFC2223'>RFC 2223<span> (</span><span class='info'>Postel, J. and J. Reynolds, “Instructions to RFC Authors,” October 1997.</span><span>)</span></a> [2],
HTML format, and so on.
</li>
<li>To provide the proof-of-concept for the first two goals
(this memo was written using this DTD and produced using that
software).
</li>
</ol>
<p>It is beyond the scope of this memo to discuss the political
ramifications of using XML as a source format for RFC-like documents.
Rather,
it is simply noted that adding minimal markup to plain text:
</p>
<ul class="text">
<li>allows the traditional production of textual RFC-like documents using
familiar editors;
</li>
<li>requires some, albeit minimal, additions to existing software
environments; and,
</li>
<li>permits information to be organized, searched, and retrieved
using both unstructured and structured mechanisms.
</li>
</ul>
<a name="anchor2"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2"></a><h3>2.
Using the DTD to Write I-Ds and RFCs</h3>
<p>We do not provide a formal or comprehensive description of XML.
Rather,
this section discusses just enough XML to use a Document Type
Declaration (DTD) to write RFC-like documents.
</p>
<p>If you're already familiar with XML,
skip to <a class='info' href='#rfc2629.dtd'>Appendix B<span> (</span><span class='info'>The DTD</span><span>)</span></a> to look at the DTD.
</p>
<a name="xml_basics"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.1"></a><h3>2.1.
XML basics</h3>
<p>There are very few rules when writing in XML,
as the syntax is (deceptively) simple.
There are five terms you'll need to know:
</p>
<ol class="text">
<li>An "element" usually refers to a start tag, an end tag, and all the
characters in between,
e.g.,
<tt><example>text and/or nested elements</example></tt>.
</li>
<li>An "empty element" combines the start tag and the end tag,
e.g.,
<tt><empty/></tt>.
For readability,
I prefer to write this as <tt><empty /></tt> — both are legal XML.
You don't find empty elements in HTML.
</li>
<li>An "attribute" is part of an element.
If present, they occur in the start tag, e.g.,
<tt><example name='value'></tt>.
Of course,
they can also appear in empty elements, e.g.,
<tt><empty name='value' /></tt>.
</li>
<li>An "entity" is a textual macro that starts with <tt>&</tt>.
Usually,
you'll only use them whenever you want to put a <tt>&</tt> or a <tt><</tt> in
your text.
</li>
<li>A "token" is a string of characters.
The first character is either a letter or an underscore (<tt>_</tt>).
Any characters that follow are either letters, numbers, an
underscore, or a period (<tt>.</tt>).
</li>
</ol>
<p>First,
start your source file with an XML declaration,
a reference to the DTD,
and the rfc element:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<?xml version='1.0' ?>
<!DOCTYPE rfc SYSTEM 'rfcXXXX.dtd'>
<rfc>
...
</rfc>
</pre></div>
<p>Ignore the first two lines
— the declaration and the reference —
and simply treat them as opaque strings.
Nothing else should be present after the </rfc> tag.
</p>
<p>Second,
make sure that all elements are properly matched and nested.
A properly matched element that starts with
<tt><example></tt> is eventually followed
with <tt></example></tt>.
(Empty elements are always matched.)
Elements are properly nested when they don't overlap.
</p>
<p>For example,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<outer>
...
<inner>
...
</inner>
...
</outer>
</pre></div>
<p>is properly nested.
</p>
<p>However,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<outer>
...
<inner>
...
</outer>
...
</inner>
</pre></div>
<p>overlaps, so the elements aren't properly nested.
</p>
<p>Third,
never use <tt><</tt> or <tt>&</tt> in your text.
Instead, use either <tt>&lt;</tt> or <tt>&amp;</tt>, respectively.
</p>
<p>Fourth,
there are two quoting characters in XML,
apostrophe (') and quotation (").
Make sure that all attributes values are quoted,
e.g., <tt><example name='value'></tt>.
If the value contains one of the quoting characters,
then use the other to quote the value,
e.g., <tt><example name='"'></tt>,
If the value contains both quoting characters,
then use one of them to quote the value,
and replace occurrences of that character in the attribute value with
either <tt>&apos;</tt> (apostrophe) or <tt>&quot;</tt> (quotation),
e.g., <tt><example name='"&apos;"'></tt>.
</p>
<p>If you want to put a comment in your source file,
here's the syntax:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<!-- comments can be multiline,
if you wish -->
</pre></div>
<p>Finally,
XML is case sensitive,
which means that <tt><foo></tt> is different
from <tt><Foo></tt>.
</p>
<a name="front_matter"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.2"></a><h3>2.2.
Front matter</h3>
<p>Immediately following the <rfc> tag is the
front element:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<?xml version='1.0'?>
<!DOCTYPE rfc SYSTEM 'rfcXXXX.dtd'>
<rfc>
<front>
<title ...>
<author ...>
<author ...>
<date ...>
<area ...>
<workgroup ...>
<keyword ...>
<keyword ...>
<abstract ...>
<note ...>
</front>
...
</rfc>
</pre></div>
<p>(Note that in all examples,
indentation is used only for expository purposes.)
</p>
<p>The front element consists of a title element,
one or more author elements,
a date element,
one or more optional area elements,
one or more optional workgroup elements,
one or more optional keyword elements,
an optional abstract element.
and,
one or more optional note elements.
</p>
<a name="anchor3"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.2.1"></a><h3>2.2.1.
The title Element</h3>
<p>The title element identifies the title of the document.
Because the title will be used in the headers of the document when formatted
according to <a class='info' href='#RFC2223'>[2]<span> (</span><span class='info'>Postel, J. and J. Reynolds, “Instructions to RFC Authors,” October 1997.</span><span>)</span></a>,
if the title is more than 42 characters,
then an abbreviation should also be provided,
e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<title abbrev='Much Ado about Nothing'>
The IETF's Discussion on "Source Format of RFC Documents"
</title>
</pre></div>
<a name="author"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.2.2"></a><h3>2.2.2.
The author Element</h3>
<p>Each author element identifies a document author.
Since a document may have more than one author,
more than one author element may be present.
If the author is a person,
then three attributes must be present in the <author> tag,
initials, surname, and fullname,
e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<author initials='F.J.' surname='Flintstone'
fullname='Frederick Flintstone'>
</pre></div>
<p>There is also an optional role attribute,
which,
if present,
must take the value "editor".
</p>
<p>The author element itself consists of an organization element,
and,
an optional address element.
</p>
<p>The organization element is similar to the title element,
in that an abbreviation may be paired with a long organization name
using the abbrev attribute, e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<organization abbrev='ISI'>
USC/Information Sciences Institute
</organization>
</pre></div>
<p>The address element consists of an optional postal element,
an optional phone element,
an optional facsimile element,
an optional email element,
and,
an optional uri element.
</p>
<p>The postal element contains one or more street elements,
followed by any combination of city,
region (state or province),
code (zipcode or postal code),
and country elements, e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<postal>
<street>660 York Street</street>
<street>M/S 40</street>
<city>San Francisco</city> <region>CA</region>
<code>94110</code>
<country>US</country>
</postal>
</pre></div>
<p>This flexibility is provided to allow for different national
formats for postal addresses.
Note however,
that although the order of the city,
region,
code,
and country elements isn't specified,
at most one of each may be present.
Regardless,
these elements must not be re-ordered during processing by an XML
application
(e.g., display applications must preserve the ordering of the
information contained in these elements).
Finally,
the value of the country element should be a two-letter
code from ISO 3166.
</p>
<p>The phone,
facsimile,
email,
and uri elements are simple, e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<phone>+1 916 555 1234</phone>
<email>[email protected]</email>
<uri>http://example.com/</uri>
</pre></div>
<a name="date"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.2.3"></a><h3>2.2.3.
The date Element</h3>
<p>The date element identifies the publication date of the
document.
It consists of a month and a year, e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<date month='February' year='1999' />
</pre></div>
<p>The date element also has an optional day attribute.
(Actually,
due to popular demand,
all three attributes are optional.)
</p>
<a name="anchor4"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.2.4"></a><h3>2.2.4.
Meta Data Elements</h3>
<p>The front element may contain meta data —
the content of these elements does not appear in printed versions of
the document.
</p>
<p>A document has one or more optional area,
workgroup,
and keyword elements, e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<area>General</area>
<workgroup>RFC Beautification Working Group</workgroup>
<keyword>RFC</keyword>
<keyword>Request for Comments</keyword>
<keyword>I-D</keyword>
<keyword>Internet-Draft</keyword>
<keyword>XML</keyword>
<keyword>Extensible Markup Language</keyword>
</pre></div>
<p>The area elements identify a general category for the
document
(e.g., one of "Applications", "General", "Internet", "Management",
"Operations", "Routing", "Security", "Transport", or "User"),
while the workgroup elements identify the IETF working groups that
produced the document,
and the keyword elements identify useful search terms.
</p>
<a name="anchor5"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.2.5"></a><h3>2.2.5.
The abstract Element</h3>
<p>A document may have an abstract element,
which contains one or more <a class='info' href='#t'>t elements<span> (</span><span class='info'>The t Element</span><span>)</span></a>.
In general,
only a single t element is present,
e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<abstract>
<t>This memo presents a technique for using XML
(Extensible Markup Language) as a source format
for documents in the Internet-Drafts (I-Ds) and
Request for Comments (RFC) series.</t>
</abstract>
</pre></div>
<a name="anchor6"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.2.6"></a><h3>2.2.6.
The note Element</h3>
<p>A document may have one or more note elements,
each of which contains one or more <a class='info' href='#t'>t elements<span> (</span><span class='info'>The t Element</span><span>)</span></a>.
There is a mandatory title attribute.
In general,
the note element contains text from the IESG,
e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<note title='IESG Note'>
<t>The IESG has something to say.</t>
</note>
</pre></div>
<a name="anchor7"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.2.7"></a><h3>2.2.7.
Status, Copyright Notice, Table of Contents</h3>
<p>Note that text relating to the memo's status, copyright notice, or
table of contents is not included in the document's markup — this is
automatically inserted by an XML application when it produces either
a text or HTML version of the document.
</p>
<a name="ipr"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.2.7.1"></a><h3>2.2.7.1.
Conformance with RFC 3978</h3>
<p>If an Internet-Draft is being produced,
then the ipr attribute should be present in the <tt><rfc></tt> tag
at the beginning of the file.
The value of the attribute should be one of:
<tt>full3978</tt>,
<tt>noModification3978</tt>,
or
<tt>noDerivatives3978</tt>.
For the latter two options,
an additional attribute, iprExtract, will be consulted.
If present,
its value is an anchor that is used to cross-reference the section of
the document that may be extracted as-is for separate use.
</p>
<p>Consult <a class='info' href='#RFC3978'>[3]<span> (</span><span class='info'>Bradner, S., “IETF Rights in Contributions,” March 2005.</span><span>)</span></a> for further details.
</p>
<p>If the Internet-Draft is being submitted to an automated process,
then the docName attribute should be present in the
<rfc> tag at the beginning of the file.
The value of this attribute contains the document (not file) name
associated with this Internet-Draft, e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<rfc ipr='full3978' docName='draft-mrose-writing-rfcs-01'>
...
</rfc>
</pre></div>
<p>Finally,
an xml:lang attribute may be present to indicate that the document is
written in some language other than English
(for writing things other than RFCs).
</p>
<a name="anchor8"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.2.8"></a><h3>2.2.8.
Everything in the Front</h3>
<p>So,
putting it all together, we have, e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<front>
<title>Writing I-Ds and RFCs using XML</title>
<author initials='F.J.' surname='Flintstone'
fullname='Frederick Flintstone'>
<organization>Slate Construction, Inc.</organization>
<address>
<postal>
<street>660 York Street</street>
<street>M/S 40</street>
<city>San Francisco</city> <region>CA</region>
<code>94110</code>
<country>US</country>
</postal>
<phone>+1 916 555 1234</phone>
<email>[email protected]</email>
<uri>http://example.com/</uri>
</address>
</author>
<date month='February' year='1999' />
<area>General</area>
<workgroup>RFC Beautification Working Group</workgroup>
<keyword>RFC</keyword>
<keyword>Request for Comments</keyword>
<keyword>I-D</keyword>
<keyword>Internet-Draft</keyword>
<keyword>XML</keyword>
<keyword>Extensible Markup Language</keyword>
<abstract>
<t>This memo presents a technique for using XML
(Extensible Markup Language) as a source format
for documents in the Internet-Drafts (I-Ds) and
Request for Comments (RFC) series.</t>
</abstract>
</front>
</pre></div>
<a name="anchor9"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.3"></a><h3>2.3.
The Middle</h3>
<p></p>
<blockquote class="text"><dl>
<dt>Note well:</dt>
<dd>
Although this draft refers to the appendix element,
the text referring to that element is entirely speculative
(until such time as this advisory is removed).
</dd>
</dl></blockquote>
<p>The middle element contains all the sections
of the document except for the bibliography and the boilerplate:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
...
</front>
<middle>
<section ...>
<section ...>
<section ...>
<appendix ...>
<appendix ...>
</middle>
<back>
...
</pre></div>
<p>The middle element consists of one or more
section elements,
optionally followed by one or more appendix elements,
optionally followed by one or more section elements.
</p>
<a name="section"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.3.1"></a><h3>2.3.1.
The section Element</h3>
<p>Each section element contains a section of the document.
There is a mandatory attribute,
title,
that identifies the title of the section.
There are also two optional attributes,
anchor,
that is used for cross-referencing with
<a class='info' href='#xref'>the xref element<span> (</span><span class='info'>The xref Element</span><span>)</span></a>,
e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<section anchor='intro' title='Introduction'>
...
</section>
</pre></div>
<p>
and the toc attribute,
which is used to indicate whether the section should appear in the
table of contents.
(The choices are "exclude", "include", and "default").
</p>
<p>The section element is recursive —
each contains any number and combination of t,
figure,
texttable,
iref,
and section elements, e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<section title='The Middle'>
...
<section title='The section Element'>
...
<section title='The t Element'>...</section>
<section title='The list Element'>...</section>
<section title='The figure Element'>...</section>
<section title='The texttable Element'>...</section>
<section title='The xref Element'>...</section>
<section title='The eref Element'>...</section>
<section title='The iref Element'>...</section>
<section title='The cref Element'>...</section>
<section title='The spanx Element'>...</section>
<section title='The vspace Element'>...</section>
</section>
</section>
</pre></div>
<p>Note that the section element is tail-recursive.
</p>
<a name="t"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.3.1.1"></a><h3>2.3.1.1.
The t Element</h3>
<p>Paragraphs are contained in t elements.
A paragraph can consist of text,
lists,
figures,
and other t element-delimited
paragraphs,
in any number or combination.
</p>
<p>If a cross-reference is needed to a section, figure, table, or reference,
<a class='info' href='#xref'>the xref element<span> (</span><span class='info'>The xref Element</span><span>)</span></a> is used;
similarly,
if an external-reference is needed,
<a class='info' href='#eref'>the eref element<span> (</span><span class='info'>The eref Element</span><span>)</span></a> is used.
Indexing of text is provided by the
<a class='info' href='#iref'>the iref element<span> (</span><span class='info'>The iref Element</span><span>)</span></a>.
</p>
<p></p>
<blockquote class="text"><dl>
<dt>Note well:</dt>
<dd>
Although RFC2629 allows the figure element to be nested within the
t element,
authors are strongly encouraged to avoid this usage —
it is always preferable to place the figure element as a direct
subordinate of the section element.
</dd>
</dl></blockquote>
<a name="list"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.3.1.2"></a><h3>2.3.1.2.
The list Element</h3>
<p>The list element contains one or more items.
Each item is a t element,
allowing for recursion, e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<list style='numbers'>
<t>The first item.</t>
<t>The second item, which contains two bulleted sub-items:
<list style='symbols'>
<t>The first sub-item.</t>
<t>The second sub-item.</t>
</list>
</t>
</list>
</pre></div>
<p>The list element has an optional attribute,
style,
having the value "numbers" (for numeric lists),
"letters" (for alphabetic lists),
"symbols" (for bulleted lists),
"hanging" (for hanging lists),
"format" (for auto-formatted lists),
or,
"empty" (for indented text).
If a list element is nested,
the default value is taken from its closest parent;
otherwise,
the default value is "empty".
</p>
<p>When nested within a hanging list element,
the t element has an optional attribute,
hangText that specifies the text to be inserted, e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<list style='hanging'>
<t hangText="counter:">the "counting designation" is
rendered
(e.g., "2.1" or "A.2");</t>
<t hangText="title:">the title attribute of the
corresponding element is rendered
(e.g., "XML Basics");</t>
<t hangText="none:">no additional designation is rendered;
or,</t>
<t hangText="default:">a suitable designation is rendered,
e.g., "Section 2.1" or
"&lt;a href='#xml_basics'>XML Basics&lt;/a>"
(the default).</t>
</list>
</pre></div>
<p>The style attribute value for an auto-formatted list
starts with the seven letters "format ",
and is followed by a string which must contain exactly one instance of "%d"
and "%c".
Hanging text is automatically generated for each nested t element,
e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<list style='format R%d:'>
<t>Text for R1.</t>
<t>Text for R2.</t>
</list>
...
<list style='format Directive %c:'>
<t>Text for Directive A.</t>
<t>Text for Directive B.</t>
</list>
...
<list style='format R%d:'>
<t>Text for R3.</t>
</list>
</pre></div>
<p>If the list is auto-formatted,
then
the optional counter attribute is consulted,
which controls the numbering.
By default,
the value of this attribute is the same as the formatting string,
e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<list style='format R%d:' counter='Requirements'>
<t>Text for R1.</t>
<t>Text for R2.</t>
</list>
...
<list style='format Directive %c:' counter='Directives'>
<t>Text for Directive A.</t>
<t>Text for Directive B.</t>
</list>
...
<list style='format R%d:' counter='Requirements'>
<t>Text for R3.</t>
</list>
</pre></div>
<p>If the style attribute has the value "hanging" or "format",
then a second, optional, attribute called hangIndent is consulted.
This overrides the default indentation used for the text of each t element,
ensuring that each t element has the same indentation, e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<list style='format R%d:' hangIndent='5'>
<t>Text for R1.</t>
<t>Text for R2.</t>
...
<t>Text for R12.</t>
</list>
</pre></div>
<p>The final item will read "R12: Text for R12."
</p>
<a name="figure"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2.3.1.3"></a><h3>2.3.1.3.
The figure Element</h3>
<p>The figure element groups an optional preamble element,
an artwork element,
and an optional postamble element together.
The figure element also has an optional anchor attribute that is
used for cross-referencing with
<a class='info' href='#xref'>the xref element<span> (</span><span class='info'>The xref Element</span><span>)</span></a>.
There is also an optional title attribute that identifies the title
of the figure.
</p>
<p>The preamble and postamble elements,
if present,
are simply text.
If a cross-reference is needed to a section, figure, table, or reference,
<a class='info' href='#xref'>the xref element<span> (</span><span class='info'>The xref Element</span><span>)</span></a> is used;
similarly,
if an external-reference is needed,
<a class='info' href='#eref'>the eref element<span> (</span><span class='info'>The eref Element</span><span>)</span></a> is used.
Indexing of text is provided by the
<a class='info' href='#iref'>the iref element<span> (</span><span class='info'>The iref Element</span><span>)</span></a>.
</p>
<p>The artwork element,
which must be present,
contains "ASCII artwork".
Unlike text contained in the t,
preamble,
or postamble elements,
both horizontal and vertical whitespace is significant in the
artwork element.
</p>
<p>So,
putting it all together, we have, e.g.,
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
<figure anchor='figure_example'>
<preamble>So,
putting it all together, we have, e.g.,</preamble>
<artwork>
ascii artwork goes here...
be sure to use "&lt;" or "&amp;" instead of "<" and "&",