RFC 2629
Writing I-Ds and RFCs using XML
RFC 2629: Writing I-Ds and RFCs using XML π
- Network Working Group, Request for Comments: 2629
- Author: Marshall T. Rose (M. Rose), Invisible Worlds, Inc.
- Category: Informational
- Date: June 1999
- Obsoletes / Updates: none listed in the title block
Part 1 of 4 π¦
Status of this Memo β¨
okay so this memo is just here to give the Internet community some info π it does NOT specify an Internet standard of any kind, so no pressure. and distribution is unlimited, so share the vibes wherever πΈ
Copyright Notice π
Copyright (C) The Internet Society (1999). All Rights Reserved.
Abstract π
this memo is all about using XML (Extensible Markup Language) as a source format for writing documents in the Internet-Drafts (I-Ds) and Request for Comments (RFC) series. basically: write your RFC in XML and let the tools do the rest π₯
Table of Contents π
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . 3
2. Using the DTD to Write I-Ds and RFCs . . . . . . . . . . . 4
2.1 XML basics . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Front matter . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1 The title Element . . . . . . . . . . . . . . . . . . . . 6
2.2.2 The author Element . . . . . . . . . . . . . . . . . . . . 7
2.2.3 The date Element . . . . . . . . . . . . . . . . . . . . . 8
2.2.4 Meta Data Elements . . . . . . . . . . . . . . . . . . . . 8
2.2.5 The abstract Element . . . . . . . . . . . . . . . . . . . 9
2.2.6 The note Element . . . . . . . . . . . . . . . . . . . . . 9
2.2.7 Status, Copyright Notice, Table of Contents . . . . . . . 9
2.2.7.1 Conformance with RFC 2026 . . . . . . . . . . . . . . . . 9
2.2.8 Everything in the Front . . . . . . . . . . . . . . . . . 10
2.3 The Middle . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3.1 The section Element . . . . . . . . . . . . . . . . . . . 11
2.3.1.1 The t Element . . . . . . . . . . . . . . . . . . . . . . 12
2.3.1.2 The list Element . . . . . . . . . . . . . . . . . . . . . 12
2.3.1.3 The figure Element . . . . . . . . . . . . . . . . . . . . 13
2.3.1.4 The xref Element . . . . . . . . . . . . . . . . . . . . . 15
2.3.1.5 The eref Element . . . . . . . . . . . . . . . . . . . . . 15
2.3.1.6 The iref Element . . . . . . . . . . . . . . . . . . . . . 16
2.3.1.7 The vspace Element . . . . . . . . . . . . . . . . . . . . 16
2.4 Back matter . . . . . . . . . . . . . . . . . . . . . . . 17
2.4.1 The references Element . . . . . . . . . . . . . . . . . . 17
2.4.2 Appendices . . . . . . . . . . . . . . . . . . . . . . . . 18
2.4.3 Copyright Status . . . . . . . . . . . . . . . . . . . . . 18
3. Processing the XML Source File . . . . . . . . . . . . . . 19
3.1 Editing . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.1.1 Checking . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.2 Converting to Text Format . . . . . . . . . . . . . . . . 20
3.3 Converting to HTML Format . . . . . . . . . . . . . . . . 20
3.4 Viewing . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.5 Searching . . . . . . . . . . . . . . . . . . . . . . . . 20
4. Security Considerations . . . . . . . . . . . . . . . . . 21
References . . . . . . . . . . . . . . . . . . . . . . . . 22
Author's Address . . . . . . . . . . . . . . . . . . . . . 22
A. The rfc Element . . . . . . . . . . . . . . . . . . . . . 23
B. The RFC DTD . . . . . . . . . . . . . . . . . . . . . . . 24
C. Acknowledgements . . . . . . . . . . . . . . . . . . . . . 29
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Full Copyright Statement . . . . . . . . . . . . . . . . . . . . . 31
1. Introduction π§
this memo explains how to write a document for the I-D and RFC series using the Extensible Markup Language [1] (XML). the memo has three goals π
- to describe a simple XML Document Type Definition (DTD) that is powerful enough to handle the simple formatting needs of RFC-like documents, while still allowing meaningful markup of descriptive qualities β¨
- to describe software that processes XML source files, including a tool that produces documents conforming to RFC 2223 [2], HTML format, and so on π οΈ
- to provide the proof-of-concept for the first two goals (this memo was written using this DTD and produced using that software) π₯
it's beyond the scope of this memo to get into the political ramifications of using XML as a source format for RFC-like documents. instead, just know that adding minimal markup to plain text:
- allows the traditional production of textual RFC-like documents using familiar editors π
- requires some, albeit minimal, additions to existing software environments π·
- permits information to be organized, searched, and retrieved using both unstructured and structured mechanisms π¦
2. Using the DTD to Write I-Ds and RFCs π
we don't give a formal or comprehensive description of XML here. this section just covers enough XML to use a Document Type Declaration (DTD) for writing RFC-like documents, which is honestly all you need π«Ά
if you're already familiar with XML, skip ahead to Appendix B to look at the DTD π
2.1 XML basics πΈ
there are very few rules when writing in XML, because the syntax is simple. there are five terms you'll need to know:
- An "element" usually refers to a start tag, an end tag, and all the characters in between, e.g.,
"<example>text and/or nested elements</example>" - An "empty element" combines the start tag and the end tag, e.g.,
"<empty/>". You don't find these in HTML. π - An "attribute" is part of an element. If present, they occur in the start tag, e.g.,
"<example name='value'>". Of course, they can also appear in empty elements, e.g.,"<empty name='value'/>". - An "entity" is a textual macro that starts with "&". Don't worry about these, you'll only use them whenever you want to put a "&" or a "<" in your text. π
- A "token" is a string of characters. The first character is either a letter or an underscore ("_"). Any characters that follow are either letters, numbers, an underscore, or a period ("."). π
first, start your source file with an XML declaration, a reference to the DTD, and the "rfc" element:
<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<rfc>
...
</rfc>
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. π
second, make sure all elements are properly matched and nested. π§
a properly matched element that starts with <example> is eventually followed by </example>. (Empty elements are always matched.) elements are properly nested when they don't overlap.
for example,
<outer>
...
<inner>
...
</inner>
...
</outer>
is properly nested. β
however,
<outer>
...
<inner>
...
</outer>
...
</inner>
overlaps, so the elements aren't properly nested. π
third, never use "<" or "&" in your text. instead, use either "<" or "&", respectively. β
fourth, there are two quoting characters in XML: 'apostrophe' and "quotation". make sure all attribute values are quoted, e.g., "<example name='value'>". if the value contains one of the quoting characters, then use the other one to quote the value, e.g., "<example name='"'>". 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 ''' (apostrophe) or """ (quotation), e.g., "<example name='"'"'>". π
if you want to put a comment in your source file, here's the syntax:
<!-- comments can be multiline,
if you wish -->
finally, XML is case sensitive. π₯
2.2 Front matter π
immediately following the <rfc> tag is the "front" element:
<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<rfc>
<front>
<title ...>
<author ...>
<author ...>
<date ...>
<area ...>
<workgroup ...>
<keyword ...>
<keyword ...>
<abstract ...>
<note ...>
</front>
...
</rfc>
(Note that in all examples, indentation is used only for expository purposes.) π·
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. π«Ά
2.2.1 The title Element π¦
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 [2], if the title is more than 42 characters, then an abbreviation should also be provided, e.g.,
<title abbrev="Much Ado about Nothing">
The IETF's Discussion on "Source Format of RFC Documents"
</title>
2.2.2 The author Element π
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.,
<author initials="M.T." surname="Rose"
fullname="Marshall T. Rose">
the "author" element itself consists of an "organization" element and an optional "address" element. π
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.,
<organization abbrev="ISI">
USC/Information Sciences Institute
</organization>
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. π
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.,
<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>
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. π§
the "phone", "facsimile", "email", and "uri" elements are simple, e.g.,
<phone>+1 415 695 3975</phone>
<email>mrose@not.invisible.net</email>
<uri>http://invisible.net/</uri>
2.2.3 The date Element β¨
the "date" element identifies the publication date of the document. it consists of a month and a year, e.g.,
<date month="February" year="1999" />
the "date" element also has an optional day attribute. π
2.2.4 Meta Data Elements β¨
okay so the front element can hold meta data, and none of it shows up in the printed version of the doc π€« it's like the backstage crew π
a document can have any number of area, workgroup, and keyword elements (they're all optional, so no pressure π
). here's what that looks like:
<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>
so the area is the big-picture category for the doc π. the allowed vibes are "Applications", "General", "Internet", "Management", "Operations", "Routing", "Security", "Transport", or "User" π¦. the workgroup tells you which IETF working groups actually made the doc (the squad behind it π), and the keyword ones are the search terms people will type to find it π literally the SEO of RFCs, iconic.
2.2.5 The abstract Element β¨
a document can have an abstract element, and inside it are one or more t elements (see Section 2.3.1.1). most of the time there's just one t, like this πΈ
<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>
2.2.6 The note Element β¨
a document can have one or more note elements, and each one holds one or more t elements (again, Section 2.3.1.1 π«Ά). the title attribute is mandatory, so don't forget it bestie π usually the note is where the IESG spills the tea, like this:
<note title="IESG Note">
<t>The IESG has something to say.</t>
</note>
2.2.7 Status, Copyright Notice, Table of Contents β¨
ngl this one's a plot twist π the memo's status, copyright notice, and table of contents are NOT typed into your markup. the XML tool adds them automatically when it makes a text or HTML version of the doc π§ so you literally just don't write them.
2.2.7.1 Conformance with RFC 2026 β¨
if you're making an Internet-Draft, the ipr attribute should be in the <rfc> tag at the top of the file π it can be one of three values:
full2026: the doc is in full conformance with all the provisions of Section 10 of RFC 2026 β¨noDerivativeWorks2026: the doc is in full conformance with all the provisions of Section 10 of RFC 2026, except the right to make derivative works is not granted π ββοΈnone: the doc is NOT offered under Section 10 of RFC 2026, and the author doesn't give the IETF any rights beyond publishing it as an Internet-Draft π
in that last case, a copyright notice won't be auto-added when the XML tool processes it π«
check out [3] if you want the full tea on this β
also, if the Internet-Draft is going into an automated process, the docName attribute should be in the <rfc> tag at the top of the file π€ its value is the document name (not the file name) for that Internet-Draft, like this:
<rfc ipr="full" docName="draft-mrose-writing-rfcs-01">
...
</rfc>
2.2.8 Everything in the Front β¨
okay let's put the whole front together, it's giving full glam π π
<front>
<title>Writing I-Ds and RFCs using XML</title>
<author initials="M.T." surname="Rose"
fullname="Marshall T. Rose">
<organization>Invisible Worlds, 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 415 695 3975</phone>
<email>mrose@not.invisible.net</email>
<uri>http://invisible.net/</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>
2.3 The Middle β¨
the middle element holds every section of the doc except the bibliography and appendices π the bibliography and appendices get their own spot later, so the layout looks like this:
...
</front>
<middle>
<section ...>
<section ...>
<section ...>
</middle>
<back>
...
the middle element is made of one or more section elements π¦
2.3.1 The section Element β¨
each section element holds a section of the doc πΈ it has a mandatory title attribute that names the section, and an optional anchor attribute that the xref element (Section 2.3.1.4) uses for cross-referencing π
<section anchor="intro" title="Introduction">
...
</section>
sections are recursive, which is so iconic π each one can hold any number and combo of t, figure, and section elements:
<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 xref Element">...</section>
<section title="The eref Element">...</section>
<section title="The iref Element">...</section>
</section>
</section>
2.3.1.1 The t Element β¨
the t element can hold any number and combination of paragraphs, lists, and figures π if you need to cross-reference a section, figure, or reference, use the xref element (Section 2.3.1.4) π and for an external reference, use the eref element (Section 2.3.1.5) π indexing text is handled by the iref element (Section 2.3.1.6) π
2.3.1.2 The list Element β¨
the list element has one or more items, and each item is a t element, which means lists can nest inside lists πͺ
<list style="numbers">
<t>The pfirst 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>
the list element has an optional style attribute π¨ the options are "numbers" (numeric lists), "symbols" (bulleted lists), "hanging" (hanging lists), or "empty" (indented text). if a list is nested, it takes the default from its closest parent, and if there's no parent to borrow from, the default is "empty" π«Ά
when a t is inside a "hanging" list, it can have an optional hangText attribute, which is the text that gets inserted π here's the example:
<list style="hanging">
<t hangText="full2026:">indicating that the document is in
full conformance with all the provisions of Section 10 of RFC
2026;</t>
<t hangText="noDerivativeWorks2026:">indicating that the
document is in full conformance with all the provisions of
Section 10 of RFC 2026 except that the right to produce
derivative works is not granted; or,</t>
<t hangText="none:">indicating that the document is NOT
offered in accordance with Section 10 of RFC 2026, and the
author does not provide the IETF with any rights other than
to publish as an Internet-Draft.</t>
</list>
2.3.1.3 The figure Element β¨
the figure element bundles together an optional preamble, an artwork element, and an optional postamble π it also has an optional anchor attribute for xref cross-referencing (Section 2.3.1.4), and an optional title attribute for the figure's name π·οΈ
the preamble and postamble are just plain text. same deal as before: use xref (Section 2.3.1.4) for sections, figures, or references, eref (Section 2.3.1.5) for external stuff, and iref (Section 2.3.1.6) for indexing π
the artwork element is the one that MUSTβ¦ wait, it's the one that must be present π€ it holds the "ASCII artwork" π¨ and the big difference from t, preamble, and postamble is that BOTH horizontal and vertical whitespace matter inside artwork π
here's the full glam version:
<figure anchor="figure_example">
<preamble>So,
putting it all together, we have, e.g.,</preamble>
<artwork>
ascii artwork goes here...
be sure to use "<" or "&" instead of "<" and "&",
respectively!
</artwork>
<postamble>which is a very simple example.</postamble>
</figure>
which is a very simple example π
if your artwork has a LOT of "<" characters, there's an XML trick that saves you π§ wrap it in a CDATA block:
<figure>
<preamble>If you have artwork with a lot of "<"
characters, then there's an XML trick you can
use:</preamble>
<artwork><![CDATA[
ascii artwork goes here...
just don't use "]]" in your artwork!
]]></artwork>
<postamble>The "<![CDATA[ ... ]]>" construct is called
a CDATA block -- everything between the innermost brackets
is left alone by the XML application.</postamble>
</figure>
the <![CDATA[ ... ]]> thing is called a CDATA block, and everything between the innermost brackets gets left alone by the XML application π so it's basically a no-touch zone π§
tea time: since a figure is a logical bundle of text and artwork, an XML app making a text version should try to keep those elements on the same page π and because RFC 2223 [2] only allows 69 characters by 49 lines of content per page, XML apps should be ready to add page breaks early so the grouping still looks good π«Ά
last thing: the artwork element has two optional attributes, name and type π name is a suggested filename for saving the artwork's contents, and type is a suggested data type for the content. β¨
2.3.1.4 The xref Element β¨
okay so xref is the element for cross-referencing sections, figures, and references π It has a mandatory target attribute that links back to the anchor attribute of the section, figure, and reference elements. The value of the anchor and target attributes should be formatted according to the token syntax in Section 2.1.
If you use it as an empty element, like this:
according to the token syntax in <xref target="xml_basics" />.
then the XML application inserts an appropriate phrase during processing, such as "Section 2.1" or <a href="#xml_basics">XML Basics</a> πΈ
If you give it content, like this:
conforming to <xref target="refs.RFC2223">RFC 2223</xref>.
then the XML application inserts an appropriate designation during processing, such as "RFC 2223 [2]" or <a href="#refs.RFC2223">RFC 2223</a> π
The application gets to decide what "an appropriate designation" looks like, but its choice stays consistent all the way through processing. no chaos allowed π«Ά
2.3.1.5 The eref Element π¦
The eref element is for referencing external documents. Its mandatory target attribute is a URI [4], like this:
<eref target="http://metalab.unc.edu/xml/">Cafe con Leche</eref>
Here's the tea: even though target is always present, the eref element is allowed to be empty too π
<eref target="http://invisible.net/" />
In that case the XML application inserts an appropriate designation during processing, such as "[9]" or <a href="http://invisible.net/">http://invisible.net/</a> β¨
2.3.1.6 The iref Element π
The iref element adds information to an index. Its mandatory item attribute is the primary key the information gets stored under, whilst the optional subitem attribute is the secondary key π§ For example:
<iref item="indexing" subitem="how to" />
Finally, the iref element is always empty. It never contains any text, so don't even try π
2.3.1.7 The vspace Element π
The vspace element can only show up inside the t element. Authors use it to give formatting guidance to the XML application π It has an attribute called blankLines, which sets how many blank lines get inserted. A physical linebreak comes from the default value, 0.
vspace can also force a brand-new physical paragraph inside a list item, like so:
<list style="numbers">
<t>This is list item.
<vspace blankLines="1" />
This is part of the same list item,
although when displayed, it appears
as a separate physical paragraph.</t>
</list>
A text version of the document needs real care when ablankLinesvalue causes a pagebreak π¨ If avspaceelement causes a pagebreak, then no further blank lines get inserted. This is how authors can "force" a pagebreak by using an arbitrarily large value, such asblankLines='100'.
And yes, the vspace element is always empty too. Never any text π
2.4 Back matter π
Finally, the back element is used for references and appendices, and it looks like this:
...
</middle>
<back>
<references>
<reference ...>
<reference ...>
</references>
<section ...>
<section ...>
</back>
</rfc>
The back element is made of an optional references element and one or more optional section elements. The back element itself is optional too. If your document has no references or appendices, you don't have to include it at all π
2.4.1 The references Element π
The references element holds the document's bibliography. It contains one or more reference elements.
Each reference element contains a front element and one or more optional seriesInfo elements.
We already covered the front element back in Section 2.2 π«Ά
The seriesInfo element has two attributes, name and value. They identify the document series and the series entry, respectively.
The reference element has an optional anchor attribute, which is used for cross-referencing with the xref element (Section 2.3.1.4). Here's an example:
<reference anchor="refs.RFC2200">
<front>
<title>Internet Official Protocol Standards</title>
<author initials="J." surname="Postel"
fullname="Jon Postel">
<organization abbrev="ISI">
USC/Information Sciences Institute
</organization>
</author>
<date month="June" year="1997" />
</front>
<seriesInfo name="RFC" value="2200" />
<seriesInfo name="STD" value="1" />
</reference>
The reference element also has an optional target attribute, which is used for external references (c.f., Section 2.3.1.5). If the XML application produces an HTML version of the document, it will use the target attribute accordingly. However, if the name attribute of the seriesInfo element has the value RFC, then the XML application should automatically provide an appropriate default for the target attribute, such as http://example.com/rfcs/rfc2200.txt β¨
2.4.2 Appendices π·
To include appendices after the bibliography, you just add more section elements. (For an example, look at the example at the beginning of Section 2.4.)
2.4.3 Copyright Status βοΈ
The copyright status for the document isn't part of the document's markup. An XML application that produces a text or HTML version of the document inserts it automatically π
3. Processing the XML Source File π οΈ
This section is all about applications that work on an XML source file. There are loads of XML tools out there, and plenty of lists of XML resources too, such as Cafe con Leche [5] β
There are two kinds of XML tools: validating and non-validating. Both check that the source file follows the rules in Section 2.1. The difference is that, on top of making sure the source file is well-formed, a validating tool also reads the DTD referenced by the source file and checks that the two match. There are plenty of both kinds around π¦
3.1 Editing βοΈ
There are several XML editors out there. Ideally you want one that validates, and that has two big perks:
- the editor guides you in fleshing out the document structure; and,
- the editor checks that the source file matches the rules in the DTD.
Emacs has two major modes that support XML: tdtd [6] and psgml [7]. psgml lets you validate the source file by calling an external program. If you open the source file in Emacs and the major mode isn't "SGML" or "XML", then usually all you need to do is add these lines to your .emacs file:
(setq auto-mode-alist
(cons (cons "\\.xml$" 'sgml-mode) auto-mode-alist))
Then restart Emacs. If that doesn't work, try one of the sources above πΈ
The author uses both sgml-mode in Emacs and a commercial validating editor, Clip! version 1.5 [8], when editing source files π
3.1.1 Checking π
If your editor doesn't validate, then you should run a program to validate the source file.
The author uses the AlphaWorks XML parser [9] for this. It needs your system to have a Java virtual machine. Besides Java, there are validating parsers written in C, Perl, Python, and Tcl π§
3.2 Converting to Text Format π
The author wrote the xml2rfc tool [10], which reads the source file and produces both a text and an HTML version of the document. (This memo was produced using the xml2rfc tool, iykyk π) Note that xml2rfc isn't a validating tool, so it's a good idea to use either a validating editor or a stand-alone validating parser before using the tool π«Ά
3.3 Converting to HTML Format π
The XML Style Language (XSL) describes transformations from the source file into some other structured file. So, ideally, you should use an XSL-capable formatter to convert an XML source file to HTML π
However, as of this writing, XSL is still in considerable flux. (That's why no reference is included in this memo: by the time you read this section, the reference would be outdated π) So in the meantime, the author uses the xml2rfc tool for this purpose, even though it doesn't offer much flexibility in its HTML layout π
3.4 Viewing π
Browsers that support either XSL or Cascading Style Sheets (CSS) can view the source file directly.
At present, the author doesn't use any of these browsers. Instead, the author converts source files to either text or HTML π
3.5 Searching π
Just like with text editors, any text-oriented search tool (such as grep) can be used on the source file. There are also search tools that actually understand structured source, though π§
The author uses sgrep version 1.9 [11] for this, for example:
sgrep -g xml 'ELEMENTS("title") not in ELEMENTS("back")' \
writing-rfcs.xml
which extracts the title element from the source file β¨
4. Security Considerations π
This memo raises no security issues; however, according to [2], your document should contain a section near the end that discusses the security considerations of the protocol or procedures that are the main topic of your document. For example:
<middle>
...
<section title="Security Considerations">
<t>This memo raises no security issues;
however,
according to <xref target="refs.RFC2223" />,
your document should contain a section near the end
that discusses the security considerations of the
protocol or procedures that are the main topic of your
document.</t>
</section>
</middle>
Security considerations are a Big Deal, bestie π¨ Don't skip this section! Your readers depend on it, and so do the people building things from your document π
References π
[1] World Wide Web Consortium, "Extensible Markup Language (XML) 1.0", W3C XML, February 1998.
[2] Postel, J. and J. Reynolds, "Instructions to RFC Authors", RFC 2223, October 1997.
[3] Bradner, S., "The Internet Standards Process -- Revision 3", BCP 9, RFC 2026, October 1996.
[4] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform Resource Identifiers (URI): Generic Syntax", RFC 2396, August 1998.
[5] http://metalab.unc.edu/xml/
[6] http://www.mulberrytech.com/tdtd/
[7] http://www.inria.fr/koala/plh/sxml.html
[9] http://www.alphaworks.ibm.com/formula/xml/
[10] http://memory.palace.org/authoring/
[11] http://www.cs.helsinki.fi/~jjaakkol/sgrep.html
Author's Address ποΈ
Marshall T. Rose
Invisible Worlds, Inc.
660 York Street
San Francisco, CA 94110
US
Phone: +1 415 695 3975
EMail: mrose@not.invisible.net
URI: http://invisible.net/
Appendix A. The rfc Element β¨
Okay so the <rfc> tag at the very top of the file is the starter pack π. If it only has an ipr attribute (Section 2.2.7.1), you get an Internet-Draft. π¦ But once the RFC editor adds more attributes to that tag, boom, you get an actual RFC π
. Something like:
<rfc number="2200"
obsoletes="2000, 1920, 1880, 1800, ..."
category="std"
seriesNo="1">
Ngl the number attribute is the main character here, so at a minimum it should be present π.
The other attributes are:
obsoletes, a comma-separated list of RFC numbers that the document obsoletes π₯;updates, a comma-separated list of RFC numbers that the document updates πΈ;category, which has one of these values:"std", for a Standards-Track document β;- `"bcp", "for a Best Current Practices document; π
"exp", for an Experimental Protocol document π§ͺ;"historic", for a historic document π°οΈ; or,"info", the default, for an Informational document π;
seriesNo, which has the corresponding number in the STD (std), BCP (bcp), or FYI (info) series π’.
And last but not least, there's a special entity, &rfc.number;. Authors writing an RFC should use it whenever they want to mention the RFC's own number inside the doc, because it's literally iconic π«Ά. In printed versions, the right number gets swapped in (or XXXX shows up) β¨.
Appendix B. The RFC DTD
Here's the DTD, the whole rulebook for the RFC document series π. Don't touch a single character, bestie π.
<!--
DTD for the RFC document series, draft of 99-01-30
-->
<!--
Contents
DTD data types
The top-level
Front matter
The Body
Back matter
-->
<!--
DTD data types:
entity description
====== ===============================================
NUMBER [0-9]+
NUMBERS a comma-separated list of NUMBER
DAY the day of the month, e.g., "1"
MONTH the month of the year, e.g., "January"
YEAR a four-digit year, e.g., "1999"
URI e.g., "http://invisible.net/"
ATEXT/CTEXT printable ASCII text (no line-terminators)
TEXT character data
-->
<!ENTITY % NUMBER "CDATA">
<!ENTITY % NUMBERS "CDATA">
<!ENTITY % DAY "CDATA">
<!ENTITY % MONTH "CDATA">
<!ENTITY % YEAR "CDATA">
<!ENTITY % URI "CDATA">
<!ENTITY % ATEXT "CDATA">
<!ENTITY % CTEXT "#PCDATA">
<!ENTITY % TEXT "#PCDATA">
<!ENTITY rfc.number "2629">
<!--
The top-level
-->
<!--
attributes for the "rfc" element are supplied by the RFC
editor. when preparing drafts, authors should leave them blank.
the "seriesNo" attribute is used if the category is, e.g., BCP.
-->
<!ELEMENT rfc (front,middle,back?)>
<!ATTLIST rfc
number %NUMBER; #IMPLIED
obsoletes %NUMBERS; ""
updates %NUMBERS; ""
category (std|bcp|info|exp|historic)
"info"
seriesNo %NUMBER; #IMPLIED
ipr (full2026|noDerivativeWorks2026|none)
#IMPLIED
docName %ATEXT; #IMPLIED>
<!--
Front matter
-->
<!ELEMENT front (title,author+,date,area*,workgroup*,keyword*,
abstract?,note*)>
<!-- the "abbrev" attribute is used for headers, etc. -->
<!ELEMENT title (%CTEXT;)>
<!ATTLIST title
abbrev %ATEXT; #IMPLIED>
<!ELEMENT author (organization,address?)>
<!ATTLIST author
initials %ATEXT; #IMPLIED
surname %ATEXT; #IMPLIED
fullname %ATEXT; #IMPLIED>
<!ELEMENT organization
(%CTEXT;)>
<!ATTLIST organization
abbrev %ATEXT; #IMPLIED>
<!ELEMENT address (postal?,phone?,facsimile?,email?,uri?)>
<!-- at most one of each the city, region, code, and country
elements may be present -->
<!ELEMENT postal (street+,(city|region|code|country)*)>
<!ELEMENT street (%CTEXT;)>
<!ELEMENT city (%CTEXT;)>
<!ELEMENT region (%CTEXT;)>
<!ELEMENT code (%CTEXT;)>
<!ELEMENT country (%CTEXT;)>
<!ELEMENT phone (%CTEXT;)>
<!ELEMENT facsimile (%CTEXT;)>
<!ELEMENT email (%CTEXT;)>
<!ELEMENT uri (%CTEXT;)>
<!ELEMENT date EMPTY>
<!ATTLIST date
day %DAY; #IMPLIED
month %MONTH; #REQUIRED
year %YEAR; #REQUIRED>
<!-- meta-data... -->
<!ELEMENT area (%CTEXT;)>
<!ELEMENT workgroup (%CTEXT;)>
<!ELEMENT keyword (%CTEXT;)>
<!ELEMENT abstract (t)+>
<!ELEMENT note (t)+>
<!ATTLIST note
title %ATEXT; #REQUIRED>
<!--
The body
-->
<!ELEMENT middle (section)+>
<!ELEMENT section (t|figure|section)*>
<!ATTLIST section
anchor ID #IMPLIED
title %ATEXT; #REQUIRED>
<!ELEMENT t (%TEXT;|list|figure|xref|eref|iref|vspace)*>
<!ATTLIST t
hangText %ATEXT; #IMPLIED>
<!-- the value of the style attribute is inherited from the closest
parent -->
<!ELEMENT list (t+)>
<!ATTLIST list
style (numbers|symbols|hanging|empty)
"empty">
<!ELEMENT xref (%CTEXT;)>
<!ATTLIST xref
target IDREF #REQUIRED
pageno (true|false) "false">
<!ELEMENT eref (%CTEXT;)>
<!ATTLIST eref
target %URI; #REQUIRED>
<!ELEMENT iref EMPTY>
<!ATTLIST iref
item %ATEXT; #REQUIRED
subitem %ATEXT; "">
<!ELEMENT vspace EMPTY>
<!ATTLIST vspace
blankLines %NUMBER; "0">
<!ELEMENT figure (preamble?,artwork,postamble?)>
<!ATTLIST figure
anchor ID #IMPLIED
title %ATEXT; "">
<!ELEMENT preamble (%TEXT;|xref|eref|iref)*>
<!ELEMENT artwork (%TEXT;)*>
<!ATTLIST artwork
xml:space (default|preserve) "preserve">
<!ELEMENT postamble (%TEXT;|xref|eref|iref)*>
<!--
Back matter
-->
<!-- sections, if present, are appendices -->
<!ELEMENT back (references?,section*)>
<!ELEMENT references (reference+)>
<!ELEMENT reference (front,seriesInfo*)>
<!ATTLIST reference
anchor ID #IMPLIED
target %URI; #IMPLIED>
<!ELEMENT seriesInfo EMPTY>
<!ATTLIST seriesInfo
name %ATEXT; #REQUIRED
value %ATEXT; #REQUIRED>
Appendix C. Acknowledgements π«Ά
The author gives a huge thank-you to: Alan Barrett, Brad Burdick, Brian Carpenter, Steve Deering, Patrik Faltstrom, Jim Gettys, Carl Malamud, Chris Newman, Kurt Starsinic, and, Frank Strauss π.
Index π§
I
indexing
how to 16
Full Copyright Statement βοΈ
Copyright (C) The Internet Society (1999). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement π
Funding for the RFC Editor function is currently provided by the Internet Society π.
π¦ where this page comes from
- ietf: rfc2629 1999-06
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms