[Docs] [txt|pdf] [Tracker] [Email] [Nits]

Versions: 00 01 RFC 2629

Network Working Group                                          M.T. Rose
Internet-Draft                                    Invisible Worlds, Inc.
Category: Informational                                    February 1999
Expires: August 02, 1999


                    Writing I-Ds and RFCs using XML
                    draft-mrose-writing-rfcs-00.txt

Status of this Memo

   This document is an Internet-Draft and is in full conformance with
   all provisions of Section 10 of RFC2026.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF), its areas, and its working groups. Note that
   other groups may also distribute working documents as
   Internet-Drafts.

   Internet-Drafts are draft documents valid for a maximum of six
   months and may be updated, replaced, or obsoleted by other documents
   at any time. It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   To view the entire list of Internet-Draft Shadow Directories, see
   http://www.ietf.org/shadow.html.

   This Internet-Draft will expire on August 02, 1999.

Abstract

   This memo presents a technique for using XML as a source format for
   documents in the Internet-Drafts and RFC series.

Copyright Notice

   Copyright (C) The Internet Society (1999). All Rights Reserved.

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


Rose                         Informational                      [Page 1]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


   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.1.1 The list Element . . . . . . . . . . . . . . . . . . . . 12
   2.3.1.2   The figure Element . . . . . . . . . . . . . . . . . . . 13
   2.3.1.3   The xref Element . . . . . . . . . . . . . . . . . . . . 14
   2.3.1.4   The eref Element . . . . . . . . . . . . . . . . . . . . 15
   2.3.1.5   The vspace Element . . . . . . . . . . . . . . . . . . . 15
   2.4       Back matter  . . . . . . . . . . . . . . . . . . . . . . 16
   2.4.1     The references Element . . . . . . . . . . . . . . . . . 16
   2.4.2     Appendices . . . . . . . . . . . . . . . . . . . . . . . 17
   2.4.3     Copyright Status . . . . . . . . . . . . . . . . . . . . 17
   3.        Processing the XML Source File . . . . . . . . . . . . . 18
   3.1       Editing  . . . . . . . . . . . . . . . . . . . . . . . . 18
   3.1.1     Checking . . . . . . . . . . . . . . . . . . . . . . . . 18
   3.2       Converting to Text Format  . . . . . . . . . . . . . . . 19
   3.3       Converting to HTML Format  . . . . . . . . . . . . . . . 19
   3.4       Viewing  . . . . . . . . . . . . . . . . . . . . . . . . 19
   3.5       Searching  . . . . . . . . . . . . . . . . . . . . . . . 19
   4.        Security Considerations  . . . . . . . . . . . . . . . . 20
             References . . . . . . . . . . . . . . . . . . . . . . . 21
             Author's Address . . . . . . . . . . . . . . . . . . . . 21
   A.        The rfc Element  . . . . . . . . . . . . . . . . . . . . 22
   B.        The RFC DTD  . . . . . . . . . . . . . . . . . . . . . . 23
























Rose                         Informational                      [Page 2]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


1. Introduction

   This memo describes how to write a document for the I-D and RFC
   series using the Extensible Markup Language[1] (XML). This memo has
   three goals:

   1.  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.

   2.  To describe software that processes XML source files, including
       a tool that produces documents conforming to RFC 2223[2], HTML
       format, and so on.

   3.  To provide the proof-of-concept for the first two goals (this
       memo was written using this DTD and produced using that
       software).

   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:

   o  allows the traditional production of textual RFC-like documents
      using familiar editors;

   o  requires some, albeit minimal, additions to existing software
      environments; and,

   o  permits information to be organized, searched, and retrieved
      using both unstructured and structured mechanisms.



















Rose                         Informational                      [Page 3]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


2. Using the DTD to Write I-Ds and RFCs

   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.

   If you're already familiar with XML, skip to Appendix B to look at
   the DTD.

2.1 XML basics

   There are very few rules when writing in XML, as the syntax is
   simple. There are five terms you'll need to know:

   1.  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>"

   2.  An "empty element" combines the start tag and the end tag, e.g.,
       "<empty/>". You don't find these in HTML.

   3.  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'/>".

   4.  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.

   5.  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 "rfcXXXX.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.

   (NOTE TO READER: when this memo is published as an RFC, the "XXXX"
   above will be replaced with the actual string to use in your source


Rose                         Informational                      [Page 4]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


   file.)

   Second, make sure that all elements are properly matched and nested.
   A properly matched element that starts with "<example>" is
   eventually followed with "</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 "&lt;"
   or "&amp;", respectively.

   Fourth, there are two quoting characters in XML, 'apostrophe' and
   "quotation". Make sure that all attributes values are quoted, e.g.,
   "<example name='value'>", If the value contains one of the quoting
   characters, then use the other 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 occurrances of that
   character in the attribute value with either '&apos;' (apostrophe)
   or "&quot;" (quotation), e.g., "<example name='"&apos;"'>".

   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.


Rose                         Informational                      [Page 5]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


2.2 Front matter

   Immediately following the "<rfc>" tag is the "front" element:

       <?xml version="1.0"?>
       <!DOCTYPE rfc SYSTEM "rfcXXXX.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>










Rose                         Informational                      [Page 6]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


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>950 Charter Street</street>
           <street>M/S 40</street>
           <city>Redwood City</city> <region>CA</region>
           <code>94063</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. Note that the value of the
   "country" element should be a two-letter code from ISO 3166.








Rose                         Informational                      [Page 7]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


   The "phone", "facsimile", "email", and "uri" elements are simple,
   e.g.,

       <phone>+1 650 779 7081</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"/>

2.2.4 Meta Data Elements

   The "front" element may contain meta data -- the content of these
   elements does not appear in printed versions of the document.

   A document has one or more optional "area", "workgroup" and
   "keyword" elements, e.g.,

       <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>

   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.














Rose                         Informational                      [Page 8]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


2.2.5 The abstract Element

   A document may have an "abstract" element, which contains one or
   more "t" elements (Section 2.3.1.1). In general, only a single "t"
   element is present, e.g.,

       <abstract>
           <t>This memo presents a technique for using XML as a
           source format for documents in the Internet-Drafts and RFC
           series.</t>
       </abstract>

2.2.6 The note Element

   A document may have one or more "note" elements, each of which
   contains one or more "t" elements (Section 2.3.1.1). There is a
   mandatory "title" attribute. In general, the "note" element contains
   text from the IESG, e.g.,

       <note title="IESG Note">
           <t>The IESG has something to say.</t>
       </note>

2.2.7 Status, Copyright Notice, Table of Contents

   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.

2.2.7.1 Conformance with RFC 2026

   If an Internet-Draft is being produced, then the "ipr2026" attribute
   should be present in the "<rfc>" tag at the beginning of the file.
   The value of the attribute should be one of:

   full: indicating that the document is in full conformance with all
      the provisions of Section 10 of RFC 2026;

   noDerivativeWorks: 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,

   none: indicating that the document is NOT offerred 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.

   In the latter case, a copyright notice will not be automatically


Rose                         Informational                      [Page 9]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


   inserted during processing by an XML application.

   Consult [3] for further details.

2.2.8 Everything in the Front

   So, putting it all together, we have, e.g.,

       <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>950 Charter Street</street>
                       <street>M/S 40</street>
                       <city>Redwood City</city> <region>CA</region>
                       <code>94063</code>
                       <country>US</country>
                   </postal>

                   <phone>+1 650 779 7081</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 as a
               source format for documents in the Internet-Drafts and RFC
               series.</t>
           </abstract>
       </front>





Rose                         Informational                     [Page 10]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


2.3 The Middle

   The "middle" element contains all the sections of the document
   except for the bibliography and appendices:

       ...
       </front>
       <middle>
           <section ...>
           <section ...>
           <section ...>
       </middle>
       <back>
       ...

   The "middle" element consists of one or more "section" elements.

2.3.1 The section Element

   Each "section" element contains a section of the document. There is
   a mandatory attribute, "title", that identifies the title of the
   section. There is also an optional attribute, "anchor", that is used
   for cross-referencing with the "xref" element (Section 2.3.1.3),
   e.g.,

       <section anchor="intro" title="Introduction">
           ...
       </section>

   The "section" element is recursive -- each contains any number and
   combination of "t", "figure", and "section" elements, e.g.,

       <section title="The Middle">
           ...
           <section title="The section Element">
               ...
               <section title="The t Element">
                   ...
                   <section title="The list Element">...</section>
               </section>
               <section title="The figure Element">...</section>
               <section title="The xref Element">...</section>
               <section title="The eref Element">...</section>
           </section>
       </section>






Rose                         Informational                     [Page 11]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


2.3.1.1 The t Element

   The "t" element contains a paragraph, an item list, or a combination
   of the two. Paragraphs are simply text. If a cross-reference is
   needed to a section, figure, or reference, the "xref" element
   (Section 2.3.1.3) is used; similarly, if an external-reference is
   needed, the "eref" element (Section 2.3.1.4) is used.

2.3.1.1.1 The list Element

   The "list" element contains one or more items. Each item is a "t"
   element, allowing for recursion, e.g.,

       <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>

   The "list" element has an optional attribute, "style", having the
   value "numbers" (for numeric lists), "symbols" (for bulleted lists),
   "hanging" (for hanging 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".

   When nested within a "hanging list" element, the "t" element has an
   optional attribute, "hangText" that specifies the text to be
   inserted, e.g.,

       <list>
           <t hangText="full:">indicating that the document is in full
           conformance with all the provisions of Section 10 of RFC 2026;</t>

           <t hangText="noDerivativeWorks:">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 offerred
           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>



Rose                         Informational                     [Page 12]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


2.3.1.2 The figure Element

   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 the "xref" element (Section
   2.3.1.3). There is also an optional "title" attribute that
   identifies the title of the figure.

   The "preamble" and "postamble" elements, if present, are simply
   text. If a cross-reference is needed to a section, figure, or
   reference, the "xref" element (Section 2.3.1.3) is used; similarly,
   if an external-reference is needed, the "eref" element (Section
   2.3.1.4) is used.

   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.

   So, putting it all together, we have, e.g.,

       <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 "&",
               respectively!
           </artwork>
           <postamble>which is a very simple example.</postamble>
       </figure>

   which is a very simple example.
















Rose                         Informational                     [Page 13]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


   If you have artwork with a lot of "<" characters, then there's an
   XML trick you can use:

       <figure>
           <preamble>If you have artwork with a lot of "&lt;"
           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[ ... ]]>" construct is called a CDATA block --
   everything between the innermost brackets is left alone by the XML
   application.

   Because the "figure" element represents a logical grouping of text
   and artwork, an XML application producing a text version of the
   document should attempt to keep these elements on the same page.
   Because RFC 2223[2] allows no more than 69 characters by 49 lines of
   content on each page, XML applications should be prepared to
   prematurely introduce page breaks to allow for better visual
   grouping.

2.3.1.3 The xref Element

   The "xref" element is used to cross-reference sections, figures, and
   references. The mandatory "target" attribute is used to link 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 used as an empty element, e.g.,

       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>".








Rose                         Informational                     [Page 14]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


   If used with content, e.g.,

       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>". Although the XML application decides what "an appropriate
   designation" might be, its choice is consistent throughout the
   processing of the document.

2.3.1.4 The eref Element

   The "eref" element is used to reference external documents. The
   mandatory "target" attribute is a URI[4], e.g.,

       <eref target="http://metalab.unc.edu/xml/">Cafe con Leche</eref>.

   Note that while the "target" attribute is always present, the "eref"
   element may be empty, e.g.,

       <eref target="http://invisible.net/"/>

   and 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.5 The vspace Element

   The "vspace" element, which may occur only inside the "t" element,
   is used by the author to provide formatting guidance to the XML
   application. There is an attribute, "blankLines", that indicates the
   number of blank lines that should be inserted. A physical linebreak
   is specified by using the default value, "0".

   In addition, the "vspace" element can be used to force a new
   physical paragraph within a list item, e.g.,

       <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>

   An XML application producing a text version of the document should
   exercise care when encountering a value for "blankLines" that causes
   a pagebreak -- in particular, if a "vspace" element causes a
   pagebreak, then no further blank lines should be inserted. This


Rose                         Informational                     [Page 15]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


   allows authors to "force" a pagebreak by using an arbitrarily large
   value, e.g., "blankLines='100'".

   Finally, note that the "vspace" element is always empty -- it never
   contains any text.

2.4 Back matter

   Finally, the "back" element is used for references and appendices:

           ...
           </middle>
           <back>
               <references>
                   <reference ...>
                   <reference ...>
               </references>
               <section ...>
               <section ...>
           </back>
       </rfc>

   The "back" element consists of an optional "references" element,
   and, one or more optional "section" elements. The "back" element
   itself is optional, if your document doesn't have any references or
   appendices, you don't have to include it.

2.4.1 The references Element

   The "references" element contains 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've already discussed the "front" element back in Section 2.2.

   The "seriesInfo" element identifies the document series and number
   of the reference, e.g., "RFC 2200", "STD 1", and so on.












Rose                         Informational                     [Page 16]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


   The "reference" element has an optional "anchor" attribute that is
   used for cross-referencing with the "xref" element (Section
   2.3.1.3), e.g.,

       <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>RFC 2200</seriesInfo>
           <seriesInfo>STD 1</seriesInfo>
       </reference>

   The "reference" element also has an optional "target" attribute that
   is used for external references (c.f., Section 2.3.1.4). The XML
   application, if producing an HTML version of the document will use
   the "target" attribute accordingly; however, if the "seriesInfo"
   element starts with the string "RFC " (e.g., "RFC 2223") the XML
   application should automatically provide an appropriate default for
   the "target" attribute (e.g., "http://example.com/rfcs/rfc2223.txt").

2.4.2 Appendices

   To include appendices after the bibliography, simply 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 is not included in the
   document's markup -- this is automatically inserted by an XML
   application that produces either a text or HTML version of the
   document.











Rose                         Informational                     [Page 17]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


3. Processing the XML Source File

   This section concerns itself with applications that operate on an
   XML source file. A lot of XML tools are available, as are many lists
   of XML resources, e.g., Cafe con Leche[5].

   There are two kinds of XML tools: validating and non-validating.
   Both check that the source file conforms to the rules given in
   Section 2.1. However, in addition to making sure that the source
   file is well-formed, a validating tool also reads the DTD referenced
   by the source file to make sure that they match. There are a number
   of both validating and non-validating tools available.

3.1 Editing

   There are several XML editors available. Ideally, you want an editor
   that validates. This has two advantages:

   o  the editor provides guidance in fleshing-out the document
      structure; and,

   o  the editor validates that the source file matches the rules in
      the DTD.

   There are two major modes in Emacs that support XML: sgml-mode and
   psgml[6]. The latter mode allows you to validate the source file (by
   calling an external program). If you visit the source file in Emacs
   and the major mode isn't "SGML" or "XML", then usually all it takes
   is adding these lines to your ".emacs" file:

       (setq auto-mode-alist
             (cons (cons "\\.xml$" 'sgml-mode) auto-mode-alist))

   and then restarting Emacs.

   The author uses both sgml-mode in Emacs, and a commercial validating
   editor, Clip! version 1.5[7], 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[8] for this purpose. It
   requires that your system have a Java virtual machine. In addition
   to Java, there are validating parsers written in C, Perl, Python,
   and Tcl.




Rose                         Informational                     [Page 18]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


3.2 Converting to Text Format

   The author has written the xml2rfc tool[9], which reads the source
   file and produces both a text and HTML version of the document.
   (This memo was produced using the xml2rfc tool.) Note that xml2rfc
   isn't a validating tool, so it's a good idea to use either a
   validating editor or run a stand-alone validating parser prior to
   using the tool.

3.3 Converting to HTML Format

   The XML Style Language (XSL) is used to describe 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.
   (Hence, no reference was included in this memo, as by the time you
   read this section, the reference would be outdated.) So, in the
   interim, the author uses the xml2rfc tool for this purpose, even
   though this tool doesn't provide much flexibility in its HTML layout.

3.4 Viewing

   Browsers that support either XSL or Cascading Style Sheets (CSS) are
   able to view the source file directly.

   At present, the author doesn't use any of these browsers, instead
   converting source files to either text or HTML.

3.5 Searching

   As with text editors, any text-oriented search tool (e.g., grep) can
   be used on the source file. However, there are search tools
   available that understand structured source.

   The author uses sgrep version 1.9[10] for this purpose, e.g.

       sgrep -g xml 'ELEMENTS("title") not in ELEMENTS("back")' \
           writing-rfcs.xml

   which extracts the title element from the source file.









Rose                         Informational                     [Page 19]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


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, e.g.,

       <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>

































Rose                         Informational                     [Page 20]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


References

   [1]  World Wide Web Consortium, "Extensible Markup Language (XML)
        1.0", February 1998.

   [2]  Postel, J., Reynolds, J., "Instructions to RFC Authors", RFC
        2223, October 1997.

   [3]  Bradner, S.O., "The Internet Standards Process -- Revision 3",
        RFC 2026, BCP 9, October 1996.

   [4]  Berners-Lee, T., Fielding, R.T., Masinter, L., "Uniform
        Resource Identifiers (URI): Generic Syntax", RFC 2396, August
        1998.

   [5]  http://metalab.unc.edu/xml/

   [6]  http://www.inria.fr/koala/plh/sxml.html

   [7]  http://www.t2000-usa.com/

   [8]  http://www.alphaworks.ibm.com/formula/xml/

   [9]  http://memory.palace.org/authoring/

   [10]  http://www.cs.helsinki.fi/~jjaakkol/sgrep.html

Author's Address

   Marshall T. Rose
   Invisible Worlds, Inc.
   950 Charter Street
   North 40
   Redwood City, CA  94063
   US

   Phone: +1 650 779 7081
   EMail: mrose@not.invisible.net
   URI:   http://invisible.net/












Rose                         Informational                     [Page 21]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


Appendix A. The rfc Element

   The "<rfc>" tag at the beginning of the file, with only an "ipr2026"
   attribute (Section 2.2.7.1), produces an Internet-Draft. However,
   when other attributes are added to this tag by the RFC editor, an
   RFC is produced, e.g.,

       <rfc number="2200"
            obsoletes="2000, 1920, 1880, 1800, ..."
            category="std"
            seriesNo="1">

   At a minimum, the "number" attribute should be present.

   The other attributes are:

   o  "obsoletes", having a comma-separated list of RFC numbers, that
      the document obsoletes;

   o  "updates", having a comma-separated list of RFC numbers, that the
      document updates;

   o  "category", having one of these values:

      1.  "std", for a Standards-Track document;

      2.  "bcp", "for a Best Current Practices document;

      3.  "exp", for an Experimental Protocol document;

      4.  "historic", for a historic document; or,

      5.  "info", the default, for an Informational document.

   o  "seriesNo", having the corresponding number in the STD (std), BCP
      (bcp), or FYI (info) series.

   Finally, a special entity, "&rfc.number;", is available. Authors
   preparing an RFC should use this entity whenever they want to
   reference the number of the RFC within the document itself. In
   printed versions of the document, the appropriate substitution (or
   "XXXX") will occur.









Rose                         Informational                     [Page 22]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


Appendix B. The RFC DTD

   <!--
     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

           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 % MONTH      "CDATA">
   <!ENTITY % YEAR       "CDATA">

   <!ENTITY % URI        "CDATA">



Rose                         Informational                     [Page 23]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


   <!ENTITY % ATEXT      "CDATA">
   <!ENTITY % CTEXT      "#PCDATA">

   <!ENTITY % TEXT       "#PCDATA">

   <!ENTITY   rfc.number "XXXX">


   <!--
     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
             ipr2026     (full|noDerivativeWorks|none)
                                            #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>


Rose                         Informational                     [Page 24]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


   <!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
             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;|xref|eref|list|vspace)*>


Rose                         Informational                     [Page 25]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


   <!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 vspace      EMPTY>
   <!ATTLIST vspace
             startBlank  %NUMBER;           "0">

   <!ELEMENT figure      (preamble?,artwork,postamble?)>
   <!ATTLIST figure
             anchor      ID                 #IMPLIED
             title       %ATEXT;            "">

   <!ELEMENT preamble    (%TEXT;|xref|eref)*>
   <!ELEMENT artwork     (%TEXT;)*>
   <!ATTLIST artwork
             xml:space   (default|preserve) "preserve">
   <!ELEMENT postamble   (%TEXT;|xref|eref)*>


   <!--
     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  (%CTEXT;)>


Rose                         Informational                     [Page 26]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999





















































Rose                         Informational                     [Page 27]


Internet-Draft      Writing I-Ds and RFCs using XML        February 1999


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 implmentation 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.
























Rose                         Informational                     [Page 28]

------- =_aaaaaaaaaa0
Content-Type: text/html; charset="us-ascii"
Content-ID: <20685.919210993.3@dbc.fv.com>
Content-Description: draft-mrose-writing-rfcs-00.html

<html><head><title>Writing I-Ds and RFCs using XML</title>
<STYLE type="text/css">
    .title { color: #990000; font-size: 22px; line-height: 22px; font-weight: bold; text-align: right;
             font-family: helvetica, arial, sans-serif }
    .filename { color: #666666; font-size: 18px; line-height: 28px; font-weight: bold; text-align: right;
                  font-family: helvetica, arial, sans-serif }
    p.copyright { color: #000000; font-size: 10px;
                  font-family: verdana, charcoal, helvetica, arial, sans-serif }
    p { margin-left: 2em; margin-right: 2em; }
    ol { margin-left: 2em; margin-right: 2em; }
    ul.text { margin-left: 2em; margin-right: 2em; }
    pre { margin-left: 3em; color: #333333 }
    ul.toc { color: #000000; line-height: 16px;
             font-family: verdana, charcoal, helvetica, arial, sans-serif }
    H3 { color: #333333; font-size: 16px; line-height: 16px; font-family: helvetica, arial, sans-serif }
    H4 { color: #000000; font-size: 14px; font-family: helvetica, arial, sans-serif }
    TD.header { color: #ffffff; font-size: 10px; font-family: arial, helvetica, san-serif; valign: top }
    TD.author-text { color: #000000; font-size: 10px;
                     font-family: verdana, charcoal, helvetica, arial, sans-serif }
    TD.author { color: #000000; font-weight: bold; margin-left: 4em; font-size: 10px; font-family: verdana, charcoal, helvetica, arial, sans-serif }
    A:link { color: #990000; font-size: 10px; text-transform: uppercase; font-weight: bold;
             font-family: MS Sans Serif, verdana, charcoal, helvetica, arial, sans-serif }
    A:visited { color: #333333; font-weight: bold; font-size: 10px; text-transform: uppercase;
                font-family: MS Sans Serif, verdana, charcoal, helvetica, arial, sans-serif }
    A:name { color: #333333; font-weight: bold; font-size: 10px; text-transform: uppercase;
             font-family: MS Sans Serif, verdana, charcoal, helvetica, arial, sans-serif }
    .link2 { color:#ffffff; font-weight: bold; text-decoration: none;
             font-family: monaco, charcoal, geneva, MS Sans Serif, helvetica, monotype, verdana, sans-serif;
             font-size: 9px }
    .RFC { color:#666666; font-weight: bold; text-decoration: none;
           font-family: monaco, charcoal, geneva, MS Sans Serif, helvetica, monotype, verdana, sans-serif;
           font-size: 9px }
    .hotText { color:#ffffff; font-weight: normal; text-decoration: none;
               font-family: charcoal, monaco, geneva, MS Sans Serif, helvetica, monotype, verdana, sans-serif;
               font-size: 9px }
</style>
</head>
<body bgcolor="#ffffff"alink="#000000" vlink="#666666" link="#990000">
<table border="0" cellpadding="0" cellspacing="2" width="30" height="15" align="right"><tr><td bgcolor="#990000" align="center" width="30" height="15"><a href="#toc" CLASS="link2"><font face="monaco, MS Sans Serif" color="#ffffff" size="1"><b>&nbsp;TOC&nbsp;</b></font></a><br></td></tr></table>
<table width="66%" border="0" cellpadding="0" cellspacing="0"><tr><td><table width="100%" border="0" cellpadding="2" cellspacing="1">
<tr valign="top"><td width="33%" bgcolor="#666666" class="header">Network Working Group</td><td width="33%" bgcolor="#666666" class="header">M.T. Rose</td></tr>
<tr valign="top"><td width="33%" bgcolor="#666666" class="header">Internet-Draft</td><td width="33%" bgcolor="#666666" class="header">Invisible Worlds, Inc.</td></tr>
<tr valign="top"><td width="33%" bgcolor="#666666" class="header">Category: Informational</td><td width="33%" bgcolor="#666666" class="header">February 1999</td></tr>
<tr valign="top"><td width="33%" bgcolor="#666666" class="header">Expires: August 02, 1999</td><td width="33%" bgcolor="#666666" class="header">&nbsp;</td></tr>
</table></td></tr></table>
<div align="right"><font face="monaco, MS Sans Serif" color="#990000" size="+3"><b><br><span class="title">Writing I-Ds and RFCs using XML</span></b></font></div>
<div align="right"><font face="monaco, MS Sans Serif" color="#666666" size="+2"><b><span class="filename">draft-mrose-writing-rfcs-00.html</span></b></font></div>
<font face="verdana, helvetica, arial, sans-serif" size="2">

<h3>Status of this Memo</h3>
<p>
This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026.</p>
<p>
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups.
Note that other groups may also distribute working documents as
Internet-Drafts.</p>
<p>
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any time.
It is inappropriate to use Internet-Drafts as reference material or to cite
them other than as "work in progress."</p>
<p>
To view the entire list of Internet-Drafts Shadow Directories,
see
<a href="http://www.ietf.org/shadow.html">http://www.ietf.org/shadow.html</a>.</p>
<p>
This Internet-Draft will expire on August 02, 1999.</p>

<h3>Abstract</h3>

<p>
This memo presents a technique for using XML as a source
format for documents in the Internet-Drafts and RFC series.
</p>

<h3>Copyright Notice</h3>
<p>
Copyright (C) The Internet Society (1999). All Rights Reserved.</p>
<a name="toc"><br><hr size="1" shade="0"></a>
<table border="0" cellpadding="0" cellspacing="2" width="30" height="15" align="right"><tr><td bgcolor="#990000" align="center" width="30" height="15"><a href="#toc" CLASS="link2"><font face="monaco, MS Sans Serif" color="#ffffff" size="1"><b>&nbsp;TOC&nbsp;</b></font></a><br></td></tr></table>
<h3>Table of Contents</h3>
<ul compact class="toc">
<b><a href="#anchor1">1.</a>&nbsp;
Introduction<br></b>
<b><a href="#anchor2">2.</a>&nbsp;
Using the DTD to Write I-Ds and RFCs<br></b>
<b><a href="#xml_basics">2.1</a>&nbsp;
XML basics<br></b>
<b><a href="#front_matter">2.2</a>&nbsp;
Front matter<br></b>
<b><a href="#anchor3">2.2.1</a>&nbsp;
The title Element<br></b>
<b><a href="#anchor4">2.2.2</a>&nbsp;
The author Element<br></b>
<b><a href="#anchor5">2.2.3</a>&nbsp;
The date Element<br></b>
<b><a href="#anchor6">2.2.4</a>&nbsp;
Meta Data Elements<br></b>
<b><a href="#anchor7">2.2.5</a>&nbsp;
The abstract Element<br></b>
<b><a href="#anchor8">2.2.6</a>&nbsp;
The note Element<br></b>
<b><a href="#anchor9">2.2.7</a>&nbsp;
Status, Copyright Notice, Table of Contents<br></b>
<b><a href="#ipr2026">2.2.7.1</a>&nbsp;
Conformance with RFC 2026<br></b>
<b><a href="#anchor10">2.2.8</a>&nbsp;
Everything in the Front<br></b>
<b><a href="#anchor11">2.3</a>&nbsp;
The Middle<br></b>
<b><a href="#section">2.3.1</a>&nbsp;
The section Element<br></b>
<b><a href="#t">2.3.1.1</a>&nbsp;
The t Element<br></b>
<b><a href="#anchor12">2.3.1.1.1</a>&nbsp;
The list Element<br></b>
<b><a href="#anchor13">2.3.1.2</a>&nbsp;
The figure Element<br></b>
<b><a href="#xref">2.3.1.3</a>&nbsp;
The xref Element<br></b>
<b><a href="#eref">2.3.1.4</a>&nbsp;
The eref Element<br></b>
<b><a href="#anchor14">2.3.1.5</a>&nbsp;
The vspace Element<br></b>
<b><a href="#back_matter">2.4</a>&nbsp;
Back matter<br></b>
<b><a href="#anchor15">2.4.1</a>&nbsp;
The references Element<br></b>
<b><a href="#anchor16">2.4.2</a>&nbsp;
Appendices<br></b>
<b><a href="#anchor17">2.4.3</a>&nbsp;
Copyright Status<br></b>
<b><a href="#anchor18">3.</a>&nbsp;
Processing the XML Source File<br></b>
<b><a href="#anchor19">3.1</a>&nbsp;
Editing<br></b>
<b><a href="#anchor20">3.1.1</a>&nbsp;
Checking<br></b>
<b><a href="#xml2rfc">3.2</a>&nbsp;
Converting to Text Format<br></b>
<b><a href="#anchor21">3.3</a>&nbsp;
Converting to HTML Format<br></b>
<b><a href="#anchor22">3.4</a>&nbsp;
Viewing<br></b>
<b><a href="#anchor23">3.5</a>&nbsp;
Searching<br></b>
<b><a href="#anchor24">4.</a>&nbsp;
Security Considerations<br></b>
<b><a href="#rfc.references">&#167;</a>&nbsp;
References<br></b>
<b><a href="#rfc.authors">&#167;</a>&nbsp;
Author's Address<br></b>
<b><a href="#rfc">A.</a>&nbsp;
The rfc Element<br></b>
<b><a href="#rfc.dtd">B.</a>&nbsp;
The RFC DTD<br></b>
</ul>
<br clear="all">

<a name="anchor1"><br><hr size="1" shade="0"></a>
<table border="0" cellpadding="0" cellspacing="2" width="30" height="15" align="right"><tr><td bgcolor="#990000" align="center" width="30" height="15"><a href="#toc" CLASS="link2"><font face="monaco, MS Sans Serif" color="#ffffff" size="1"><b>&nbsp;TOC&nbsp;</b></font></a><br></td></tr></table>
<h3>1.&nbsp;Introduction</h3>

<p>
This memo describes how to write a document for the I-D and RFC series
using <a href="#XML">the Extensible Markup Language</a>[1] (XML).
This memo has three goals:

<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 href="#refs.RFC2223">RFC 2223</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>

<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:

<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>

</p>

<a name="anchor2"><br><hr size="1" shade="0"></a>
<table border="0" cellpadding="0" cellspacing="2" width="30" height="15" align="right"><tr><td bgcolor="#990000" align="center" width="30" height="15"><a href="#toc" CLASS="link2"><font face="monaco, MS Sans Serif" color="#ffffff" size="1"><b>&nbsp;TOC&nbsp;</b></font></a><br></td></tr></table>
<h3>2.&nbsp;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 href="#rfc.dtd">The RFC DTD</a> to look at the DTD.
</p>

<h4><a name="xml_basics">2.1</a>&nbsp;XML basics</h4>

<p>
There are very few rules when writing in XML,
as the syntax is simple.
There are five terms you'll need to know:

<ol class="text">

<li>
An "element" usually refers to a start tag, an end tag, and all the
characters in between,
e.g.,
"&lt;example&gt;text and/or nested elements&lt;/example&gt;"
</li>

<li>
An "empty element" combines the start tag and the end tag,
e.g.,
"&lt;empty/&gt;".
You don't find these in HTML.
</li>

<li>
An "attribute" is part of an element.
If present, they occur in the start tag, e.g.,
"&lt;example name='value'&gt;".
Of course,
they can also appear in empty elements, e.g.,
"&lt;empty name='value'/&gt;".
</li>

<li>
An "entity" is a textual macro that starts with "&amp;".
Don't worry about these,
you'll only use them whenever you want to put a "&amp;" or a "&lt;" in
your text.
</li>

<li>
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 (".").
</li>

</ol>

</p>

<p>
First,
start your source file with an XML declaration,
a reference to the DTD,
and the "rfc" element:
</p>
</font><pre>
    &lt;?xml version="1.0"?>
    &lt;!DOCTYPE rfc SYSTEM "rfcXXXX.dtd">
    &lt;rfc>
        ...
    &lt;/rfc>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<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 "&lt;/rfc&gt;" tag.
</p>

<p>
(NOTE TO READER:
when this memo is published as an RFC,
the "&rfc.number;" above will be replaced with the actual string to
use in your source file.)
</p>

<p>
Second,
make sure that all elements are properly matched and nested.
A properly matched element that starts with
"&lt;example&gt;" is eventually followed with "&lt;/example&gt;".
(Empty elements are always matched.)
Elements are properly nested when they don't overlap.
</p>

<p>
For example,
</p>
</font><pre>
    &lt;outer>
        ...
        &lt;inner>
            ...
        &lt;/inner>
        ...
    &lt;/outer>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
is properly nested.
</p>

<p>
However,
</p>
</font><pre>
    &lt;outer>
        ...
        &lt;inner>
            ...
        &lt;/outer>
        ...
    &lt;/inner>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
overlaps, so the elements aren't properly nested.
</p>

<p>
Third,
never use "&lt;" or "&amp;" in your text.
Instead, use either "&amp;lt;" or "&amp;amp;", respectively.
</p>

<p>
Fourth,
there are two quoting characters in XML, 'apostrophe' and "quotation".
Make sure that all attributes values are quoted,
e.g., "&lt;example name='value'&gt;",
If the value contains one of the quoting characters,
then use the other to quote the value,
e.g., "&lt;example name='"'&gt;",
If the value contains both quoting characters,
then use one of them to quote the value,
and replace occurrances of that character in the attribute value with
either '&amp;apos;' (apostrophe) or "&amp;quot;" (quotation),
e.g., "&lt;example name='"&amp;apos;"'&gt;".
</p>

<p>
If you want to put a comment in your source file,
here's the syntax:
</p>
</font><pre>
        &lt;!-- comments can be multiline,
         if you wish -->
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
Finally,
XML is case sensitive.
</p>

<h4><a name="front_matter">2.2</a>&nbsp;Front matter</h4>

<p>
Immediately following the "&lt;rfc&gt;" tag is the "front"
element:
</p>
</font><pre>
    &lt;?xml version="1.0"?>
    &lt;!DOCTYPE rfc SYSTEM "rfcXXXX.dtd">
    &lt;rfc>
        &lt;front>
            &lt;title ...>
            &lt;author ...>
            &lt;author ...>
            &lt;date ...>
            &lt;area ...>
            &lt;workgroup ...>
            &lt;keyword ...>
            &lt;keyword ...>
            &lt;abstract ...>
            &lt;note ...>
        &lt;/front>
        ...
    &lt;/rfc>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<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>

<h4><a name="anchor3">2.2.1</a>&nbsp;The title Element</h4>

<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 href="#refs.RFC2223">[2]</a>,
if the title is more than 42 characters,
then an abbreviation should also be provided,
e.g.,
</p>
</font><pre>
    &lt;title abbrev="Much Ado about Nothing">
    The IETF's Discussion on "Source Format of RFC Documents"
    &lt;/title>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<h4><a name="anchor4">2.2.2</a>&nbsp;The author Element</h4>

<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 "&lt;author&gt;" tag,
"initials", "surname", and "fullname",
e.g.,
</p>
</font><pre>
    &lt;author initials="M.T." surname="Rose"
            fullname="Marshall T. Rose">
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<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>
</font><pre>
    &lt;organization abbrev="ISI">
        USC/Information Sciences Institute
    &lt;/organization>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<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>
</font><pre>
    &lt;postal>
        &lt;street>950 Charter Street&lt;/street>
        &lt;street>M/S 40&lt;/street>
        &lt;city>Redwood City&lt;/city> &lt;region>CA&lt;/region>
        &lt;code>94063&lt;/code>
        &lt;country>US&lt;/country>
    &lt;/postal>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<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.
Note that 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>
</font><pre>
    &lt;phone>+1 650 779 7081&lt;/phone>
    &lt;email>mrose@not.invisible.net&lt;/email>
    &lt;uri>http://invisible.net/&lt;/uri>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<h4><a name="anchor5">2.2.3</a>&nbsp;The date Element</h4>

<p>
The "date" element identifies the publication date of the
document.
It consists of a month and a year, e.g.,
</p>
</font><pre>
    &lt;date month="February" year="1999"/>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<h4><a name="anchor6">2.2.4</a>&nbsp;Meta Data Elements</h4>

<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>
</font><pre>
    &lt;area>General&lt;/area>
    &lt;workgroup>RFC Beautification Working Group&lt;/workgroup>
    &lt;keyword>RFC&lt;/keyword>
    &lt;keyword>Request for Comments&lt;/keyword>
    &lt;keyword>I-D&lt;/keyword>
    &lt;keyword>Internet-Draft&lt;/keyword>
    &lt;keyword>XML&lt;/keyword>
    &lt;keyword>Extensible Markup Language&lt;/keyword>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<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>

<h4><a name="anchor7">2.2.5</a>&nbsp;The abstract Element</h4>

<p>
A document may have an "abstract" element,
which contains one or more <a href="#t">"t" elements</a>.
In general,
only a single "t" element is present,
e.g.,
</p>
</font><pre>
    &lt;abstract>
        &lt;t>This memo presents a technique for using XML as a
        source format for documents in the Internet-Drafts and RFC
        series.&lt;/t>
    &lt;/abstract>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<h4><a name="anchor8">2.2.6</a>&nbsp;The note Element</h4>

<p>
A document may have one or more "note" elements,
each of which contains one or more <a href="#t">"t" elements</a>.
There is a mandatory "title" attribute.
In general,
the "note" element contains text from the IESG,
e.g.,
</p>
</font><pre>
    &lt;note title="IESG Note">
        &lt;t>The IESG has something to say.&lt;/t>
    &lt;/note>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<h4><a name="anchor9">2.2.7</a>&nbsp;Status, Copyright Notice, Table of Contents</h4>

<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>

<h4><a name="ipr2026">2.2.7.1</a>&nbsp;Conformance with RFC 2026</h4>

<p>
If an Internet-Draft is being produced,
then the "ipr2026" attribute should be present in the "&lt;rfc&gt;"
tag at the beginning of the file.
The value of the attribute should be one of:

<blockquote class="text"><dl>

<dt>full:</dt>
<dd>
indicating that the document is in full conformance with all
the provisions of Section 10 of RFC 2026;
</dd>

<dt>noDerivativeWorks:</dt>
<dd>
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,
</dd>

<dt>none:</dt>
<dd>
indicating that the document is NOT offerred 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.
</dd>

</dl></blockquote>

In the latter case,
a copyright notice will not be automatically inserted during
processing by an XML application.
</p>

<p>
Consult <a href="#refs.RFC2026">[3]</a> for further details.
</p>

<h4><a name="anchor10">2.2.8</a>&nbsp;Everything in the Front</h4>

<p>
So,
putting it all together, we have, e.g.,
</p>
</font><pre>
    &lt;front>
        &lt;title>Writing I-Ds and RFCs using XML&lt;/title>

        &lt;author initials="M.T." surname="Rose"
                fullname="Marshall T. Rose">
            &lt;organization>Invisible Worlds, Inc.&lt;/organization>

            &lt;address>
                &lt;postal>
                    &lt;street>950 Charter Street&lt;/street>
                    &lt;street>M/S 40&lt;/street>
                    &lt;city>Redwood City&lt;/city> &lt;region>CA&lt;/region>
                    &lt;code>94063&lt;/code>
                    &lt;country>US&lt;/country>
                &lt;/postal>

                &lt;phone>+1 650 779 7081&lt;/phone>
                &lt;email>mrose@not.invisible.net&lt;/email>
                &lt;uri>http://invisible.net/&lt;/uri>
            &lt;/address>
        &lt;/author>

        &lt;date month="February" year="1999"/>

        &lt;area>General&lt;/area>
        &lt;workgroup>RFC Beautification Working Group&lt;/workgroup>
        &lt;keyword>RFC&lt;/keyword>
        &lt;keyword>Request for Comments&lt;/keyword>
        &lt;keyword>I-D&lt;/keyword>
        &lt;keyword>Internet-Draft&lt;/keyword>
        &lt;keyword>XML&lt;/keyword>
        &lt;keyword>Extensible Markup Language&lt;/keyword>
        &lt;abstract>
            &lt;t>This memo presents a technique for using XML as a
            source format for documents in the Internet-Drafts and RFC
            series.&lt;/t>
        &lt;/abstract>
    &lt;/front>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<h4><a name="anchor11">2.3</a>&nbsp;The Middle</h4>

<p>
The "middle" element contains all the sections of the document
except for the bibliography and appendices:
</p>
</font><pre>
    ...
    &lt;/front>
    &lt;middle>
        &lt;section ...>
        &lt;section ...>
        &lt;section ...>
    &lt;/middle>
    &lt;back>
    ...
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
The "middle" element consists of one or more "section"
elements.
</p>

<h4><a name="section">2.3.1</a>&nbsp;The section Element</h4>

<p>
Each "section" element contains a section of the document.
There is a mandatory attribute,
"title",
that identifies the title of the section.
There is also an optional attribute,
"anchor",
that is used for cross-referencing with
<a href="#xref">the "xref" element</a>,
e.g.,
</p>
</font><pre>
    &lt;section anchor="intro" title="Introduction">
        ...
    &lt;/section>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
The "section" element is recursive --
each contains any number and combination of "t", "figure", and "section"
elements, e.g.,
</p>
</font><pre>
    &lt;section title="The Middle">
        ...
        &lt;section title="The section Element">
            ...
            &lt;section title="The t Element">
                ...
                &lt;section title="The list Element">...&lt;/section>
            &lt;/section>
            &lt;section title="The figure Element">...&lt;/section>
            &lt;section title="The xref Element">...&lt;/section>
            &lt;section title="The eref Element">...&lt;/section>
        &lt;/section>
    &lt;/section>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<h4><a name="t">2.3.1.1</a>&nbsp;The t Element</h4>

<p>
The "t" element contains a paragraph, an item list, or a combination of the two.
Paragraphs are simply text.
If a cross-reference is needed to a section, figure, or reference,
<a href="#xref">the "xref" element</a> is used;
similarly,
if an external-reference is needed,
<a href="#eref">the "eref" element</a> is used.
</p>

<h4><a name="anchor12">2.3.1.1.1</a>&nbsp;The list Element</h4>

<p>
The "list" element contains one or more items.
Each item is a "t" element,
allowing for recursion, e.g.,
</p>
</font><pre>
    &lt;list style="numbers">
        &lt;t>The first item.&lt;/t>
        &lt;t>The second item, which contains two bulleted sub-items:
            &lt;list style="symbols">
                &lt;t>The first sub-item.&lt;/t>
                &lt;t>The second sub-item.&lt;/t>
            &lt;/list>
        &lt;/t>
    &lt;/list>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
The "list" element has an optional attribute,
"style",
having the value "numbers" (for numeric lists),
"symbols" (for bulleted lists),
"hanging" (for hanging 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>
</font><pre>
    &lt;list>
        &lt;t hangText="full:">indicating that the document is in full
        conformance with all the provisions of Section 10 of RFC 2026;&lt;/t>

        &lt;t hangText="noDerivativeWorks:">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,&lt;/t>

        &lt;t hangText="none:">indicating that the document is NOT offerred
        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.&lt;/t>
    &lt;/list>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<h4><a name="anchor13">2.3.1.2</a>&nbsp;The figure Element</h4>

<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 href="#xref">the "xref" element</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, or reference,
<a href="#xref">the "xref" element</a> is used;
similarly,
if an external-reference is needed,
<a href="#eref">the "eref" element</a> is used.
</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>
</font><pre>
    &lt;figure anchor="figure_example">
        &lt;preamble>So,
        putting it all together, we have, e.g.,&lt;/preamble>
        &lt;artwork>
            ascii artwork goes here...

            be sure to use "&amp;lt;" or "&amp;amp;" instead of "&lt;" and "&amp;",
            respectively!
        &lt;/artwork>
        &lt;postamble>which is a very simple example.&lt;/postamble>
    &lt;/figure>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
which is a very simple example.
</p>

<p>
If you have artwork with a lot of "&lt;" characters,
then there's an XML trick you can use:
</p>
</font><pre>
    &lt;figure>
        &lt;preamble>If you have artwork with a lot of "&amp;lt;"
        characters, then there's an XML trick you can use:&lt;/preamble>
        &lt;artwork>&lt;![CDATA[
            ascii artwork goes here...

            just don't use "]]" in your artwork!
        ]]>&lt;/artwork>
        &lt;postamble>The "&lt;![CDATA[ ... ]]>" construct is called
        a CDATA block -- everything between the innermost brackets is
        left alone by the XML application.&lt;/postamble>
    &lt;/figure>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
The "&lt;![CDATA[ ... ]]>" construct is called a CDATA
block -- everything between the innermost brackets is left alone by
the XML application.
</p>

<p>
Because the "figure" element represents a logical grouping of text
and artwork,
an XML application producing a text version of the document should
attempt to keep these elements on the same page.
Because <a href="#refs.RFC2223">RFC 2223</a>[2] allows no more than 69
characters by 49 lines of content on each page,
XML applications should be prepared to prematurely introduce page
breaks to allow for better visual grouping.
</p>

<h4><a name="xref">2.3.1.3</a>&nbsp;The xref Element</h4>

<p>
The "xref" element is used to cross-reference sections, figures, and
references.
The mandatory "target" attribute is used to link 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 <a href="#xml_basics">XML basics</a>.
</p>

<p>
If used as an empty element,
e.g.,
</p>
</font><pre>
    according to the token syntax in &lt;xref target="xml_basics"/>.
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
then the XML application inserts an appropriate phrase
during processing,
such as "Section 2.1" or
"&lt;a href="#xml_basics">XML Basics&lt;/a>".
</p>

<p>
If used with content, e.g.,
</p>
</font><pre>
    conforming to &lt;xref target="refs.RFC2223">RFC 2223&lt;/xref>.
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
then the XML application inserts an appropriate
designation during processing,
such as "RFC 2223[2]" or
"&lt;a href="#refs.RFC2223">RFC 2223&lt;/a>".
Although the XML application decides what "an appropriate designation"
might be,
its choice is consistent throughout the processing of the document.

</p>

<h4><a name="eref">2.3.1.4</a>&nbsp;The eref Element</h4>

<p>
The "eref" element is used to reference external documents.
The mandatory "target" attribute is a
<a href="#URI">URI</a>[4], e.g.,
</p>
</font><pre>
    &lt;eref target="http://metalab.unc.edu/xml/">Cafe con Leche&lt;/eref>.
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
Note that while the "target" attribute is always present,
the "eref" element may be empty, e.g.,
</p>
</font><pre>
    &lt;eref target="http://invisible.net/"/>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
and the XML application inserts an appropriate designation during
processing such as "[9]" or
"&lt;a href="http://invisible.net/">http://invisible.net/&lt;/a>".
</p>

<h4><a name="anchor14">2.3.1.5</a>&nbsp;The vspace Element</h4>

<p>
The "vspace" element,
which may occur only inside the "t" element,
is used by the author to provide formatting guidance to the XML
application.
There is an attribute,
"blankLines",
that indicates the number of blank lines that should be inserted.
A physical linebreak is specified by using the default value, "0".
</p>

<p>
In addition,
the "vspace" element can be used to force a new physical paragraph
within a list item, e.g.,
</p>
</font><pre>
    &lt;list style="numbers">
        &lt;t>This is list item.
           &lt;vspace blankLines="1"/>
           This is part of the same list item,
           although when displayed, it appears
           as a separate physical paragraph.&lt;/t>
    &lt;/list>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
An XML application producing a text version of the document should
exercise care when encountering a value for "blankLines" that causes a
pagebreak --
in particular,
if a "vspace" element causes a pagebreak,
then no further blank lines should be inserted.
This allows authors to "force" a pagebreak by using an arbitrarily
large value, e.g., "blankLines='100'".
</p>

<p>
Finally, note that the "vspace" element is always empty -- it never
contains any text.
</p>

<h4><a name="back_matter">2.4</a>&nbsp;Back matter</h4>

<p>
Finally,
the "back" element is used for references and
appendices:
</p>
</font><pre>
        ...
        &lt;/middle>
        &lt;back>
            &lt;references>
                &lt;reference ...>
                &lt;reference ...>
            &lt;/references>
            &lt;section ...>
            &lt;section ...>
        &lt;/back>
    &lt;/rfc>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
The "back" element consists of an optional "references" element,
and,
one or more optional "section" elements.
The "back" element itself is optional,
if your document doesn't have any references or appendices,
you don't have to include it.
</p>

<h4><a name="anchor15">2.4.1</a>&nbsp;The references Element</h4>

<p>
The "references" element contains the document's bibliography.
It contains one or more "reference" elements.
</p>

<p>
Each "reference" element contains a "front" element and one or more
optional "seriesInfo" elements.
</p>

<p>
We've already discussed the "front" element back in
<a href="#front_matter">Front matter</a>.
</p>

<p>
The "seriesInfo" element identifies the document series and number of
the reference,
e.g., "RFC 2200", "STD 1", and so on.
</p>

<p>
The "reference" element has an optional "anchor"
attribute that is used for cross-referencing with
<a href="#xref">the "xref" element</a>, e.g.,
</p>
</font><pre>
    &lt;reference anchor="refs.RFC2200">
        &lt;front>
            &lt;title>Internet Official Protocol Standards&lt;/title>
            &lt;author initials="J." surname="Postel"
                    fullname="Jon Postel">
                &lt;organization abbrev="ISI">
                USC/Information Sciences Institute
                &lt;/organization>
            &lt;/author>

            &lt;date month="June" year="1997"/>
        &lt;/front>
        &lt;seriesInfo>RFC 2200&lt;/seriesInfo>
        &lt;seriesInfo>STD 1&lt;/seriesInfo>
    &lt;/reference>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
The "reference" element also has an optional "target"
attribute that is used for external references
(c.f., <a href="#eref">The eref Element</a>).
The XML application,
if producing an HTML version of the document will use the "target"
attribute accordingly;
however, if the "seriesInfo" element starts with the string "RFC "
(e.g., "RFC 2223")
the XML application should automatically provide an appropriate
default for the "target" attribute
(e.g., "http://example.com/rfcs/rfc2223.txt").
</p>

<h4><a name="anchor16">2.4.2</a>&nbsp;Appendices</h4>

<p>
To include appendices after the bibliography,
simply add more "section" elements.
(For an example,
look at the example at the beginning of <a href="#back_matter">Back matter</a>.)
</p>

<h4><a name="anchor17">2.4.3</a>&nbsp;Copyright Status</h4>

<p>
The copyright status for the document is not included in the
document's markup -- this is automatically inserted by an XML
application that produces either a text or HTML version of the document.
</p>

<a name="anchor18"><br><hr size="1" shade="0"></a>
<table border="0" cellpadding="0" cellspacing="2" width="30" height="15" align="right"><tr><td bgcolor="#990000" align="center" width="30" height="15"><a href="#toc" CLASS="link2"><font face="monaco, MS Sans Serif" color="#ffffff" size="1"><b>&nbsp;TOC&nbsp;</b></font></a><br></td></tr></table>
<h3>3.&nbsp;Processing the XML Source File</h3>

<p>
This section concerns itself with applications that operate on
an XML source file.
A lot of XML tools are available,
as are many lists of XML resources,
e.g.,
<a href="http://metalab.unc.edu/xml/">Cafe con Leche</a>.
</p>

<p>
There are two kinds of XML tools: validating and non-validating.
Both check that the source file conforms to the rules given in
<a href="#xml_basics">XML basics</a>.
However,
in addition to making sure that the source file is well-formed,
a validating tool also reads the DTD referenced by the source file
to make sure that they match.
There are a number of both validating and non-validating tools available.
</p>

<h4><a name="anchor19">3.1</a>&nbsp;Editing</h4>

<p>
There are several XML editors available.
Ideally,
you want an editor that validates.
This has two advantages:

<ul class="text">

<li>
the editor provides guidance in fleshing-out the document structure;
and,
</li>

<li>
the editor validates that the source file matches the rules in the DTD.
</li>

</ul>

</p>

<p>
There are two major modes in Emacs that support XML:
sgml-mode and
<a href="http://www.inria.fr/koala/plh/sxml.html">psgml</a>.
The latter mode allows you to validate the source file
(by calling an external program).
If you visit the source file in Emacs and the major mode isn't
"SGML" or "XML",
then usually all it takes is adding these lines to your ".emacs"
file:
</p>
</font><pre>
    (setq auto-mode-alist
          (cons (cons "\\.xml$" 'sgml-mode) auto-mode-alist))
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
and then restarting Emacs.
</p>

<p>
The author uses both sgml-mode in Emacs,
and a commercial validating editor,
<a href="http://www.t2000-usa.com/">Clip! version 1.5</a>,
when editing source
files.
</p>

<h4><a name="anchor20">3.1.1</a>&nbsp;Checking</h4>

<p>
If your editor doesn't validate,
then you should run a program to validate the source file.
</p>

<p>
The author uses
<a href="http://www.alphaworks.ibm.com/formula/xml/">the
AlphaWorks XML parser</a> for this purpose.
It requires that your system have a Java virtual machine.
In addition to Java,
there are validating parsers written in C, Perl, Python, and Tcl.
</p>

<h4><a name="xml2rfc">3.2</a>&nbsp;Converting to Text Format</h4>

<p>
The author has written
<a href="http://memory.palace.org/authoring/">the xml2rfc tool</a>,
which reads the source file and produces both a text and HTML version
of the document.
(This memo was produced using the xml2rfc tool.)
Note that xml2rfc isn't a validating tool,
so it's a good idea to use either a validating editor or run a stand-alone
validating parser prior to using the tool.
</p>

<h4><a name="anchor21">3.3</a>&nbsp;Converting to HTML Format</h4>

<p>
The XML Style Language (XSL) is used to describe 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.
</p>

<p>
However,
as of this writing XSL is still in considerable flux.
(Hence,
no reference was included in this memo,
as by the time you read this section,
the reference would be outdated.)
So,
in the interim,
the author uses the xml2rfc tool for this purpose,
even though this tool doesn't provide much flexibility in its HTML layout.
</p>

<h4><a name="anchor22">3.4</a>&nbsp;Viewing</h4>

<p>
Browsers that support either XSL or Cascading Style Sheets (CSS)
are able to view the source file directly.
</p>

<p>
At present,
the author doesn't use any of these browsers,
instead converting source files to either text or HTML.
</p>

<h4><a name="anchor23">3.5</a>&nbsp;Searching</h4>

<p>
As with text editors,
any text-oriented search tool (e.g., grep) can be used on the source file.
However,
there are search tools available that understand structured source.
</p>

<p>
The author uses
<a href="http://www.cs.helsinki.fi/~jjaakkol/sgrep.html">sgrep
version 1.9</a>
for this purpose,
e.g.
</p>
</font><pre>
    sgrep -g xml 'ELEMENTS("title") not in ELEMENTS("back")' \
        writing-rfcs.xml
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
which extracts the title element from the source file.
</p>

<a name="anchor24"><br><hr size="1" shade="0"></a>
<table border="0" cellpadding="0" cellspacing="2" width="30" height="15" align="right"><tr><td bgcolor="#990000" align="center" width="30" height="15"><a href="#toc" CLASS="link2"><font face="monaco, MS Sans Serif" color="#ffffff" size="1"><b>&nbsp;TOC&nbsp;</b></font></a><br></td></tr></table>
<h3>4.&nbsp;Security Considerations</h3>

<p>
This memo raises no security issues;
however,
according to <a href="#refs.RFC2223">[2]</a>,
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, e.g.,
</p>
</font><pre>
    &lt;middle>
        ...
        &lt;section title="Security Considerations">
            &lt;t>This memo raises no security issues;
            however,
            according to &lt;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.&lt;/t>
        &lt;/section>
    &lt;/middle>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">
<a name="rfc.references"><br><hr size="1" shade="0"></a>
<table border="0" cellpadding="0" cellspacing="2" width="30" height="15" align="right"><tr><td bgcolor="#990000" align="center" width="30" height="15"><a href="#toc" CLASS="link2"><font face="monaco, MS Sans Serif" color="#ffffff" size="1"><b>&nbsp;TOC&nbsp;</b></font></a><br></td></tr></table>
<h3>References</h3>
<table width="99%" border="0">
<tr><td class="author-text" valign="top"><b><a name="XML">[1]</a></b></td>
<td class="author-text"><a href="http://www.w3c.org">World Wide Web Consortium</a>, "<a href="http://www.w3.org/TR/1998/REC-xml-19980210">Extensible Markup Language (XML) 1.0</a>", February 1998.</td></tr>
<tr><td class="author-text" valign="top"><b><a name="refs.RFC2223">[2]</a></b></td>
<td class="author-text"><a href="mailto:Postel@ISI.EDU">Postel, J.</a>, <a href="mailto:jkrey@isi.edu">Reynolds, J.</a>, "<a href="http://info.internet.isi.edu/in-notes/rfc/files/rfc2223.txt">Instructions to RFC Authors</a>", RFC 2223, October 1997.</td></tr>
<tr><td class="author-text" valign="top"><b><a name="refs.RFC2026">[3]</a></b></td>
<td class="author-text"><a href="mailto:sob@harvard.edu">Bradner, S.O.</a>, "<a href="http://info.internet.isi.edu/in-notes/rfc/files/rfc2026.txt">The Internet Standards Process -- Revision 3</a>", RFC 2026, BCP 9, October 1996.</td></tr>
<tr><td class="author-text" valign="top"><b><a name="URI">[4]</a></b></td>
<td class="author-text"><a href="mailto:timbl@w3.org">Berners-Lee, T.</a>, <a href="mailto:fielding@ics.uci.edu">Fielding, R.T.</a>, <a href="mailto:masinter@parc.xerox.com">Masinter, L.</a>, "<a href="http://info.internet.isi.edu/in-notes/rfc/files/rfc2396.txt">Uniform Resource Identifiers (URI): Generic Syntax</a>", RFC 2396, August 1998.</td></tr>
</table>

<a name="rfc.authors"><br><hr size="1" shade="0"></a>
<table border="0" cellpadding="0" cellspacing="2" width="30" height="15" align="right"><tr><td bgcolor="#990000" align="center" width="30" height="15"><a href="#toc" CLASS="link2"><font face="monaco, MS Sans Serif" color="#ffffff" size="1"><b>&nbsp;TOC&nbsp;</b></font></a><br></td></tr></table>
<h3>Author's Address</h3>
<table width="99%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="author-text">&nbsp;</td>
<td class="author-text">Marshall T. Rose</td></tr>
<tr><td class="author-text">&nbsp;</td>
<td class="author-text">Invisible Worlds, Inc.</td></tr>
<tr><td class="author-text">&nbsp;</td>
<td class="author-text">950 Charter Street</td></tr>
<tr><td class="author-text">&nbsp;</td>
<td class="author-text">North 40</td></tr>
<tr><td class="author-text">&nbsp;</td>
<td class="author-text">Redwood City, CA  94063</td></tr>
<tr><td class="author-text">&nbsp;</td>
<td class="author-text">US</td></tr>
<tr><td class="author" align="right">Phone:&nbsp;</td>
<td class="author-text">+1 650 779 7081</td></tr>
<tr><td class="author" align="right">EMail:&nbsp;</td>
<td class="author-text"><a href="mailto:mrose@not.invisible.net">mrose@not.invisible.net</a></td></tr>
<tr><td class="author" align="right">URI:&nbsp;</td>
<td class="author-text"><a href="http://invisible.net/">http://invisible.net/</a></td></tr>
</table>

<a name="rfc"><br><hr size="1" shade="0"></a>
<table border="0" cellpadding="0" cellspacing="2" width="30" height="15" align="right"><tr><td bgcolor="#990000" align="center" width="30" height="15"><a href="#toc" CLASS="link2"><font face="monaco, MS Sans Serif" color="#ffffff" size="1"><b>&nbsp;TOC&nbsp;</b></font></a><br></td></tr></table>
<h3>Appendix A.&nbsp;The rfc Element</h3>

<p>
The "&lt;rfc&gt;" tag at the beginning of the file,
with only <a href="#ipr2026">an "ipr2026" attribute</a>,
produces an Internet-Draft.
However,
when other attributes are added to this tag by the RFC editor,
an RFC is produced, e.g.,
</p>
</font><pre>
    &lt;rfc number="2200"
         obsoletes="2000, 1920, 1880, 1800, ..."
         category="std"
         seriesNo="1">
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">

<p>
At a minimum,
the "number" attribute should be present.
</p>

<p>
The other attributes are:

<ul class="text">

<li>
"obsoletes",
having a comma-separated list of RFC numbers,
that the document obsoletes;
</li>

<li>
"updates",
having a comma-separated list of RFC numbers,
that the document updates;
</li>

<li>
"category",
having one of these values:

<ol class="text">

<li>
"std", for a Standards-Track document;
</li>

<li>
"bcp", "for a Best Current Practices document;
</li>

<li>
"exp", for an Experimental Protocol document;
</li>

<li>
"historic", for a historic document; or,
</li>

<li>
"info", the default, for an Informational document.
</li>

</ol>

</li>

<li>
"seriesNo",
having the corresponding number in the STD (std), BCP (bcp), or FYI (info)
series.
</li>

</ul>

</p>

<p>
Finally,
a special entity, "&amp;rfc.number;", is available.
Authors preparing an RFC should use this entity whenever they want to
reference the number of the RFC within the document itself.
In printed versions of the document,
the appropriate substitution (or "XXXX") will occur.
</p>

<a name="rfc.dtd"><br><hr size="1" shade="0"></a>
<table border="0" cellpadding="0" cellspacing="2" width="30" height="15" align="right"><tr><td bgcolor="#990000" align="center" width="30" height="15"><a href="#toc" CLASS="link2"><font face="monaco, MS Sans Serif" color="#ffffff" size="1"><b>&nbsp;TOC&nbsp;</b></font></a><br></td></tr></table>
<h3>Appendix B.&nbsp;The RFC DTD</h3>
</font><pre>
&lt;!--
  DTD for the RFC document series, draft of 99-01-30
  -->


&lt;!--
  Contents

    DTD data types

    The top-level

    Front matter

    The Body

    Back matter
  -->


&lt;!--
  DTD data types:

        entity        description
        ======        ===============================================
        NUMBER        [0-9]+
        NUMBERS       a comma-separated list of NUMBER

        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
  -->


&lt;!ENTITY % NUMBER     "CDATA">
&lt;!ENTITY % NUMBERS    "CDATA">

&lt;!ENTITY % MONTH      "CDATA">
&lt;!ENTITY % YEAR       "CDATA">

&lt;!ENTITY % URI        "CDATA">

&lt;!ENTITY % ATEXT      "CDATA">
&lt;!ENTITY % CTEXT      "#PCDATA">

&lt;!ENTITY % TEXT       "#PCDATA">

&lt;!ENTITY   rfc.number "XXXX">


&lt;!--
  The top-level
  -->


&lt;!--
  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.
  -->
&lt;!ELEMENT rfc         (front,middle,back?)>
&lt;!ATTLIST rfc
          number      %NUMBER;           #IMPLIED
          obsoletes   %NUMBERS;          ""
          updates     %NUMBERS;          ""
          category    (std|bcp|info|exp|historic)
                                         "info"
          seriesNo    %NUMBER;           #IMPLIED
          ipr2026     (full|noDerivativeWorks|none)
                                         #IMPLIED>


&lt;!--
  Front matter
  -->


&lt;!ELEMENT front       (title,author+,date,area*,workgroup*,keyword*,
                       abstract?,note?)>

&lt;!-- the "abbrev" attribute is used for headers, etc. -->
&lt;!ELEMENT title       (%CTEXT;)>
&lt;!ATTLIST title
          abbrev      %ATEXT;            #IMPLIED>

&lt;!ELEMENT author      (organization,address?)>
&lt;!ATTLIST author
          initials    %ATEXT;            #IMPLIED
          surname     %ATEXT;            #IMPLIED
          fullname    %ATEXT;            #IMPLIED>

&lt;!ELEMENT organization
                      (%CTEXT;)>
&lt;!ATTLIST organization
          abbrev      %ATEXT;            #IMPLIED>

&lt;!ELEMENT address     (postal?,phone?,facsimile?,email?,uri?)>

&lt;!-- at most one of each the city, region, code, and country
     elements may be present -->
&lt;!ELEMENT postal      (street+,(city|region|code|country)*)>
&lt;!ELEMENT street      (%CTEXT;)>
&lt;!ELEMENT city        (%CTEXT;)>
&lt;!ELEMENT region      (%CTEXT;)>
&lt;!ELEMENT code        (%CTEXT;)>
&lt;!ELEMENT country     (%CTEXT;)>
&lt;!ELEMENT phone       (%CTEXT;)>
&lt;!ELEMENT facsimile   (%CTEXT;)>
&lt;!ELEMENT email       (%CTEXT;)>
&lt;!ELEMENT uri         (%CTEXT;)>

&lt;!ELEMENT date        EMPTY>
&lt;!ATTLIST date
          month       %MONTH;            #REQUIRED
          year        %YEAR;             #REQUIRED>

&lt;!-- meta-data... -->
&lt;!ELEMENT area        (%CTEXT;)>
&lt;!ELEMENT workgroup   (%CTEXT;)>
&lt;!ELEMENT keyword     (%CTEXT;)>

&lt;!ELEMENT abstract    (t)+>
&lt;!ELEMENT note        (t)+>
&lt;!ATTLIST note
          title       %ATEXT;            #REQUIRED>


&lt;!--
  The body
  -->


&lt;!ELEMENT middle      (section)+>

&lt;!ELEMENT section     (t|figure|section)*>
&lt;!ATTLIST section
          anchor      ID                 #IMPLIED
          title       %ATEXT;            #REQUIRED>

&lt;!ELEMENT t           (%TEXT;|xref|eref|list|vspace)*>
&lt;!ATTLIST t
          hangText    %ATEXT;            #IMPLIED>

&lt;!-- the value of the style attribute is inherited from the closest
     parent -->
&lt;!ELEMENT list        (t+)>
&lt;!ATTLIST list
          style       (numbers|symbols|hanging|empty)
                                         "empty">

&lt;!ELEMENT xref        (%CTEXT;)>
&lt;!ATTLIST xref
          target      IDREF              #REQUIRED
          pageno      (true|false)       "false">

&lt;!ELEMENT eref        (%CTEXT;)>
&lt;!ATTLIST eref
          target      %URI;              #REQUIRED>

&lt;!ELEMENT vspace      EMPTY>
&lt;!ATTLIST vspace
          startBlank  %NUMBER;           "0">

&lt;!ELEMENT figure      (preamble?,artwork,postamble?)>
&lt;!ATTLIST figure
          anchor      ID                 #IMPLIED
          title       %ATEXT;            "">

&lt;!ELEMENT preamble    (%TEXT;|xref|eref)*>
&lt;!ELEMENT artwork     (%TEXT;)*>
&lt;!ATTLIST artwork
          xml:space   (default|preserve) "preserve">
&lt;!ELEMENT postamble   (%TEXT;|xref|eref)*>


&lt;!--
  Back matter
  -->


&lt;!-- sections, if present, are appendices -->
&lt;!ELEMENT back        (references?,section*)>

&lt;!ELEMENT references  (reference+)>
&lt;!ELEMENT reference   (front,seriesInfo*)>
&lt;!ATTLIST reference
          anchor      ID                 #IMPLIED
          target      %URI;              #IMPLIED>
&lt;!ELEMENT seriesInfo  (%CTEXT;)>
</pre><font face="verdana, helvetica, arial, sans-serif" size="2">
<a name="rfc.copyright"><br><hr size="1" shade="0"></a>
<table border="0" cellpadding="0" cellspacing="2" width="30" height="15" align="right"><tr><td bgcolor="#990000" align="center" width="30" height="15"><a href="#toc" CLASS="link2"><font face="monaco, MS Sans Serif" color="#ffffff" size="1"><b>&nbsp;TOC&nbsp;</b></font></a><br></td></tr></table>
<h3>Full Copyright Statement</h3>
<p class="copyright">
Copyright (C) The Internet Society (1999).  All Rights Reserved.</p>
<p class="copyright">
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 implmentation 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.</p>
<p class="copyright">
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.</p>
<p class="copyright">
This document and the information contained herein is provided on an
&quot;AS IS&quot; 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.</p>
</font></body></html>

------- =_aaaaaaaaaa0
Content-Type: text/xml; charset="us-ascii"
Content-ID: <20685.919210993.4@dbc.fv.com>
Content-Description: draft-mrose-writing-rfcs-00.xml

<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfcXXXX.dtd">
<?rfc toc="yes"?>
<rfc ipr2026="full">
<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>950 Charter Street</street>
<street>North 40</street>
<city>Redwood City</city> <region>CA</region> <code>94063</code>
<country>US</country>
</postal>
<phone>+1 650 779 7081</phone>
<email>mrose@not.invisible.net</email>
<uri>http://invisible.net/</uri>
</address>
</author>
<date month="February" year="1999"/>
<area>General</area>
<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 as a source
format for documents in the Internet-Drafts and RFC series.</t>
</abstract>
</front>
<middle>
<section title="Introduction">
<t>This memo describes how to write a document for the I-D and RFC series
using <xref target="XML">the Extensible Markup Language</xref> (XML).
This memo has three goals:
<list style="numbers">
<t>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.</t>
<t>To describe software that processes XML source files,
including a tool that produces documents
conforming to <xref target="refs.RFC2223">RFC 2223</xref>,
HTML format, and so on.</t>
<t>To provide the proof-of-concept for the first two goals
(this memo was written using this DTD and produced using that
software).</t>
</list>
</t>
<t>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:
<list style="symbols">
<t>allows the traditional production of textual RFC-like documents using
familiar editors;</t>
<t>requires some, albeit minimal, additions to existing software
environments; and,</t>
<t>permits information to be organized, searched, and retrieved
using both unstructured and structured mechanisms.</t>
</list>
</t>
</section>
<section title="Using the DTD to Write I-Ds and RFCs">
<t>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.</t>
<t>If you're already familiar with XML,
skip to <xref target="rfc.dtd"/> to look at the DTD.</t>
<section anchor="xml_basics" title="XML basics">
<t>There are very few rules when writing in XML,
as the syntax is simple.
There are five terms you'll need to know:
<list style="numbers">
<t>An "element" usually refers to a start tag, an end tag, and all the
characters in between,
e.g.,
"&lt;example&gt;text and/or nested elements&lt;/example&gt;"</t>
<t>An "empty element" combines the start tag and the end tag,
e.g.,
"&lt;empty/&gt;".
You don't find these in HTML.</t>
<t>An "attribute" is part of an element.
If present, they occur in the start tag, e.g.,
"&lt;example name='value'&gt;".
Of course,
they can also appear in empty elements, e.g.,
"&lt;empty name='value'/&gt;".</t>
<t>An "entity" is a textual macro that starts with "&amp;".
Don't worry about these,
you'll only use them whenever you want to put a "&amp;" or a "&lt;" in
your text.</t>
<t>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 (".").</t>
</list>
</t>
<figure>
<preamble>First,
start your source file with an XML declaration,
a reference to the DTD,
and the "rfc" element:</preamble>
<artwork><![CDATA[
    <?xml version="1.0"?>
    <!DOCTYPE rfc SYSTEM "rfc]]>&rfc.number;<![CDATA[.dtd">
    <rfc>
        ...
    </rfc>
]]></artwork>
<postamble>Ignore the first two lines
-- the declaration and the reference --
and simply treat them as opaque strings.
Nothing else should be present after the "&lt;/rfc&gt;" tag.</postamble>
</figure>
<t>(NOTE TO READER:
when this memo is published as an RFC,
the "&rfc.number;" above will be replaced with the actual string to
use in your source file.)</t>
<t>Second,
make sure that all elements are properly matched and nested.
A properly matched element that starts with
"&lt;example&gt;" is eventually followed with "&lt;/example&gt;".
(Empty elements are always matched.)
Elements are properly nested when they don't overlap.</t>
<figure>
<preamble>For example,</preamble>
<artwork><![CDATA[
    <outer>
        ...
        <inner>
            ...
        </inner>
        ...
    </outer>
]]></artwork>
<postamble>is properly nested.</postamble>
</figure>
<figure>
<preamble>However,</preamble>
<artwork><![CDATA[
    <outer>
        ...
        <inner>
            ...
        </outer>
        ...
    </inner>
]]></artwork>
<postamble>overlaps, so the elements aren't properly nested.</postamble>
</figure>
<t>Third,
never use "&lt;" or "&amp;" in your text.
Instead, use either "&amp;lt;" or "&amp;amp;", respectively.</t>
<t>Fourth,
there are two quoting characters in XML, 'apostrophe' and "quotation".
Make sure that all attributes values are quoted,
e.g., "&lt;example name='value'&gt;",
If the value contains one of the quoting characters,
then use the other to quote the value,
e.g., "&lt;example name='"'&gt;",
If the value contains both quoting characters,
then use one of them to quote the value,
and replace occurrances of that character in the attribute value with
either '&amp;apos;' (apostrophe) or "&amp;quot;" (quotation),
e.g., "&lt;example name='"&amp;apos;"'&gt;".</t>
<figure>
<preamble>If you want to put a comment in your source file,
here's the syntax:</preamble>
<artwork><![CDATA[
        <!-- comments can be multiline,
         if you wish -->
]]></artwork>
</figure>
<t>Finally,
XML is case sensitive.</t>
</section>
<section anchor="front_matter" title="Front matter">
<figure>
<preamble>Immediately following the "&lt;rfc&gt;" tag is the "front"
element:</preamble>
<artwork><![CDATA[
    <?xml version="1.0"?>
    <!DOCTYPE rfc SYSTEM "rfc]]>&rfc.number;<![CDATA[.dtd">
    <rfc>
        <front>
            <title ...>
            <author ...>
            <author ...>
            <date ...>
            <area ...>
            <workgroup ...>
            <keyword ...>
            <keyword ...>
            <abstract ...>
            <note ...>
        </front>
        ...
    </rfc>
]]></artwork>
<postamble>(Note that in all examples,
indentation is used only for expository purposes.)</postamble>
</figure>
<t>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.</t>
<section title="The title Element">
<figure>
<preamble>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 <xref target="refs.RFC2223"/>,
if the title is more than 42 characters,
then an abbreviation should also be provided,
e.g.,</preamble>
<artwork><![CDATA[
    <title abbrev="Much Ado about Nothing">
    The IETF's Discussion on "Source Format of RFC Documents"
    </title>
]]></artwork>
</figure>
</section>
<section title="The author Element">
<figure>
<preamble>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 "&lt;author&gt;" tag,
"initials", "surname", and "fullname",
e.g.,</preamble>
<artwork><![CDATA[
    <author initials="M.T." surname="Rose"
            fullname="Marshall T. Rose">
]]></artwork>
</figure>
<t>The "author" element itself consists of an "organization" element,
and,
an optional "address" element.</t>
<figure>
<preamble>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.,</preamble>
<artwork><![CDATA[
    <organization abbrev="ISI">
        USC/Information Sciences Institute
    </organization>
]]></artwork>
</figure>
<t>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.</t>
<figure>
<preamble>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.,</preamble>
<artwork><![CDATA[
    <postal>
        <street>950 Charter Street</street>
        <street>M/S 40</street>
        <city>Redwood City</city> <region>CA</region>
        <code>94063</code>
        <country>US</country>
    </postal>
]]></artwork>
<postamble>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.
Note that the value of the "country" element should be a two-letter
code from ISO 3166.</postamble>
</figure>
<figure>
<preamble>The "phone", "facsimile", "email", and "uri" elements are
simple, e.g.,</preamble>
<artwork><![CDATA[
    <phone>+1 650 779 7081</phone>
    <email>mrose@not.invisible.net</email>
    <uri>http://invisible.net/</uri>
]]></artwork>
</figure>
</section>
<section title="The date Element">
<figure>
<preamble>The "date" element identifies the publication date of the
document.
It consists of a month and a year, e.g.,</preamble>
<artwork><![CDATA[
    <date month="February" year="1999"/>
]]></artwork>
</figure>
</section>
<section title="Meta Data Elements">
<t>The "front" element may contain meta data --
the content of these elements does not appear in printed versions of
the document.</t>
<figure>
<preamble>A document has one or more optional "area",
"workgroup" and "keyword" elements, e.g.,</preamble>
<artwork><![CDATA[
    <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>
]]></artwork>
<postamble>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.</postamble>
</figure>
</section>
<section title="The abstract Element">
<figure>
<preamble>A document may have an "abstract" element,
which contains one or more <xref target="t">"t" elements</xref>.
In general,
only a single "t" element is present,
e.g.,</preamble>
<artwork><![CDATA[
    <abstract>
        <t>This memo presents a technique for using XML as a
        source format for documents in the Internet-Drafts and RFC
        series.</t>
    </abstract>
]]></artwork>
</figure>
</section>
<section title="The note Element">
<figure>
<preamble>A document may have one or more "note" elements,
each of which contains one or more <xref target="t">"t" elements</xref>.
There is a mandatory "title" attribute.
In general,
the "note" element contains text from the IESG,
e.g.,</preamble>
<artwork><![CDATA[
    <note title="IESG Note">
        <t>The IESG has something to say.</t>
    </note>
]]></artwork>
</figure>
</section>
<section title="Status, Copyright Notice, Table of Contents">
<t>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.</t>
<section anchor="ipr2026" title="Conformance with RFC 2026">
<t>If an Internet-Draft is being produced,
then the "ipr2026" attribute should be present in the "&lt;rfc&gt;"
tag at the beginning of the file.
The value of the attribute should be one of:
<list style="hanging">
<t hangText="full:">indicating that the document is in full conformance with all
the provisions of Section 10 of RFC 2026;</t>
<t hangText="noDerivativeWorks:">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 offerred 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>
In the latter case,
a copyright notice will not be automatically inserted during
processing by an XML application.</t>
<t>Consult <xref target="refs.RFC2026"/> for further details.</t>
</section>
</section>
<section title="Everything in the Front">
<figure>
<preamble>So,
putting it all together, we have, e.g.,</preamble>
<artwork><![CDATA[
    <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>950 Charter Street</street>
                    <street>M/S 40</street>
                    <city>Redwood City</city> <region>CA</region>
                    <code>94063</code>
                    <country>US</country>
                </postal>

                <phone>+1 650 779 7081</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 as a
            source format for documents in the Internet-Drafts and RFC
            series.</t>
        </abstract>
    </front>
]]></artwork>
</figure>
</section>
</section>
<section title="The Middle">
<figure>
<preamble>The "middle" element contains all the sections of the document
except for the bibliography and appendices:</preamble>
<artwork><![CDATA[
    ...
    </front>
    <middle>
        <section ...>
        <section ...>
        <section ...>
    </middle>
    <back>
    ...
]]></artwork>
<postamble>The "middle" element consists of one or more "section"
elements.</postamble>
</figure>
<section anchor="section" title="The section Element">
<figure>
<preamble>Each "section" element contains a section of the document.
There is a mandatory attribute,
"title",
that identifies the title of the section.
There is also an optional attribute,
"anchor",
that is used for cross-referencing with
<xref target="xref">the "xref" element</xref>,
e.g.,</preamble>
<artwork><![CDATA[
    <section anchor="intro" title="Introduction">
        ...
    </section>
]]></artwork>
</figure>
<figure>
<preamble>The "section" element is recursive --
each contains any number and combination of "t", "figure", and "section"
elements, e.g.,</preamble>
<artwork><![CDATA[
    <section title="The Middle">
        ...
        <section title="The section Element">
            ...
            <section title="The t Element">
                ...
                <section title="The list Element">...</section>
            </section>
            <section title="The figure Element">...</section>
            <section title="The xref Element">...</section>
            <section title="The eref Element">...</section>
        </section>
    </section>
]]></artwork>
</figure>
<section anchor="t" title="The t Element">
<t>The "t" element contains a paragraph, an item list, or a combination of the two.
Paragraphs are simply text.
If a cross-reference is needed to a section, figure, or reference,
<xref target="xref">the "xref" element</xref> is used;
similarly,
if an external-reference is needed,
<xref target="eref">the "eref" element</xref> is used.</t>
<section title="The list Element">
<figure>
<preamble>The "list" element contains one or more items.
Each item is a "t" element,
allowing for recursion, e.g.,</preamble>
<artwork><![CDATA[
    <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>
]]></artwork>
<postamble>The "list" element has an optional attribute,
"style",
having the value "numbers" (for numeric lists),
"symbols" (for bulleted lists),
"hanging" (for hanging 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".
</postamble>
</figure>
<figure>
<preamble>When nested within a "hanging list" element,
the "t" element has an optional attribute,
"hangText" that specifies the text to be inserted, e.g.,</preamble>
<artwork><![CDATA[
    <list>
        <t hangText="full:">indicating that the document is in full
        conformance with all the provisions of Section 10 of RFC 2026;</t>

        <t hangText="noDerivativeWorks:">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 offerred
        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>
]]></artwork>
</figure>
</section>
</section>
<section title="The figure Element">
<t>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
<xref target="xref">the "xref" element</xref>.
There is also an optional "title" attribute that identifies the title
of the figure.
</t>
<t>The "preamble" and "postamble" elements,
if present,
are simply text.
If a cross-reference is needed to a section, figure, or reference,
<xref target="xref">the "xref" element</xref> is used;
similarly,
if an external-reference is needed,
<xref target="eref">the "eref" element</xref> is used.</t>
<t>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.</t>
<figure>
<preamble>So,
putting it all together, we have, e.g.,</preamble>
<artwork><![CDATA[
    <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 "&",
            respectively!
        </artwork>
        <postamble>which is a very simple example.</postamble>
    </figure>
]]></artwork>
<postamble>which is a very simple example.</postamble>
</figure>
<figure>
<preamble>If you have artwork with a lot of "&lt;" characters,
then there's an XML trick you can use:</preamble>
<artwork>
    &lt;figure>
        &lt;preamble>If you have artwork with a lot of "&amp;lt;"
        characters, then there's an XML trick you can use:&lt;/preamble>
        &lt;artwork>&lt;![CDATA[
            ascii artwork goes here...

            just don't use "]]" in your artwork!
        ]]>&lt;/artwork>
        &lt;postamble>The "&lt;![CDATA[ ... ]]>" construct is called
        a CDATA block -- everything between the innermost brackets is
        left alone by the XML application.&lt;/postamble>
    &lt;/figure>
</artwork>
<postamble>The "&lt;![CDATA[ ... ]]>" construct is called a CDATA
block -- everything between the innermost brackets is left alone by
the XML application.</postamble>
</figure>
<t>Because the "figure" element represents a logical grouping of text
and artwork,
an XML application producing a text version of the document should
attempt to keep these elements on the same page.
Because <xref target="refs.RFC2223">RFC 2223</xref> allows no more than 69
characters by 49 lines of content on each page,
XML applications should be prepared to prematurely introduce page
breaks to allow for better visual grouping.</t>
</section>
<section anchor="xref" title="The xref Element">
<t>The "xref" element is used to cross-reference sections, figures, and
references.
The mandatory "target" attribute is used to link 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 <xref target="xml_basics"/>.</t>
<figure>
<preamble>If used as an empty element,
e.g.,</preamble>
<artwork><![CDATA[
    according to the token syntax in <xref target="xml_basics"/>.
]]></artwork>
<postamble>then the XML application inserts an appropriate phrase
during processing,
such as "Section 2.1" or
<![CDATA["<a href="#xml_basics">XML Basics</a>"]]>.</postamble>
</figure>
<figure>
<preamble>If used with content, e.g.,</preamble>
<artwork><![CDATA[
    conforming to <xref target="refs.RFC2223">RFC 2223</xref>.
]]></artwork>
<postamble>then the XML application inserts an appropriate
designation during processing,
such as "RFC 2223[2]" or
<![CDATA["<a href="#refs.RFC2223">RFC 2223</a>"]]>.
Although the XML application decides what "an appropriate designation"
might be,
its choice is consistent throughout the processing of the document.
</postamble>
</figure>
</section>
<section anchor="eref" title="The eref Element">
<figure>
<preamble>The "eref" element is used to reference external documents.
The mandatory "target" attribute is a
<xref target="URI">URI</xref>, e.g.,</preamble>
<artwork><![CDATA[
    <eref target="http://metalab.unc.edu/xml/">Cafe con Leche</eref>.
]]></artwork>
</figure>
<figure>
<preamble>Note that while the "target" attribute is always present,
the "eref" element may be empty, e.g.,</preamble>
<artwork><![CDATA[
    <eref target="http://invisible.net/"/>
]]></artwork>
<postamble>and the XML application inserts an appropriate designation during
processing such as "[9]" or
<![CDATA["<a href="http://invisible.net/">http://invisible.net/</a>"]]>.</postamble>
</figure>
</section>
<section title="The vspace Element">
<t>The "vspace" element,
which may occur only inside the "t" element,
is used by the author to provide formatting guidance to the XML
application.
There is an attribute,
"blankLines",
that indicates the number of blank lines that should be inserted.
A physical linebreak is specified by using the default value, "0".</t>
<figure>
<preamble>In addition,
the "vspace" element can be used to force a new physical paragraph
within a list item, e.g.,</preamble>
<artwork><![CDATA[
    <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>
]]></artwork>
</figure>
<t>An XML application producing a text version of the document should
exercise care when encountering a value for "blankLines" that causes a
pagebreak --
in particular,
if a "vspace" element causes a pagebreak,
then no further blank lines should be inserted.
This allows authors to "force" a pagebreak by using an arbitrarily
large value, e.g., "blankLines='100'".</t>
<t>Finally, note that the "vspace" element is always empty -- it never
contains any text.</t>
</section>
</section>
</section>
<section anchor="back_matter" title="Back matter">
<figure>
<preamble>Finally,
the "back" element is used for references and
appendices:</preamble>
<artwork><![CDATA[
        ...
        </middle>
        <back>
            <references>
                <reference ...>
                <reference ...>
            </references>
            <section ...>
            <section ...>
        </back>
    </rfc>
]]></artwork>
<postamble>The "back" element consists of an optional "references" element,
and,
one or more optional "section" elements.
The "back" element itself is optional,
if your document doesn't have any references or appendices,
you don't have to include it.</postamble>
</figure>
<section title="The references Element">
<t>The "references" element contains the document's bibliography.
It contains one or more "reference" elements.</t>
<t>Each "reference" element contains a "front" element and one or more
optional "seriesInfo" elements.</t>
<t>We've already discussed the "front" element back in
<xref target="front_matter"/>.</t>
<t>The "seriesInfo" element identifies the document series and number of
the reference,
e.g., "RFC 2200", "STD 1", and so on.</t>
<figure>
<preamble>The "reference" element has an optional "anchor"
attribute that is used for cross-referencing with
<xref target="xref">the "xref" element</xref>, e.g.,</preamble>
<artwork><![CDATA[
    <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>RFC 2200</seriesInfo>
        <seriesInfo>STD 1</seriesInfo>
    </reference>
]]></artwork>
</figure>
<t>The "reference" element also has an optional "target"
attribute that is used for external references
(c.f., <xref target="eref"/>).
The XML application,
if producing an HTML version of the document will use the "target"
attribute accordingly;
however, if the "seriesInfo" element starts with the string "RFC "
(e.g., "RFC 2223")
the XML application should automatically provide an appropriate
default for the "target" attribute
(e.g., <![CDATA["http://example.com/rfcs/rfc2223.txt"]]>).</t>
</section>
<section title="Appendices">
<t>To include appendices after the bibliography,
simply add more "section" elements.
(For an example,
look at the example at the beginning of <xref target="back_matter"/>.)</t>
</section>
<section title="Copyright Status">
<t>The copyright status for the document is not included in the
document's markup -- this is automatically inserted by an XML
application that produces either a text or HTML version of the document.</t>
</section>
</section>
</section>
<section title="Processing the XML Source File">
<t>This section concerns itself with applications that operate on
an XML source file.
A lot of XML tools are available,
as are many lists of XML resources,
e.g.,
<eref target="http://metalab.unc.edu/xml/">Cafe con Leche</eref>.</t>
<t>There are two kinds of XML tools: validating and non-validating.
Both check that the source file conforms to the rules given in
<xref target="xml_basics"/>.
However,
in addition to making sure that the source file is well-formed,
a validating tool also reads the DTD referenced by the source file
to make sure that they match.
There are a number of both validating and non-validating tools available.</t>
<section title="Editing">
<t>There are several XML editors available.
Ideally,
you want an editor that validates.
This has two advantages:
<list style="symbols">
<t>the editor provides guidance in fleshing-out the document structure;
and,</t>
<t>the editor validates that the source file matches the rules in the DTD.</t>
</list>
</t>
<figure>
<preamble>There are two major modes in Emacs that support XML:
sgml-mode and
<eref target="http://www.inria.fr/koala/plh/sxml.html">psgml</eref>.
The latter mode allows you to validate the source file
(by calling an external program).
If you visit the source file in Emacs and the major mode isn't
"SGML" or "XML",
then usually all it takes is adding these lines to your ".emacs"
file:</preamble>
<artwork><![CDATA[
    (setq auto-mode-alist
          (cons (cons "\\.xml$" 'sgml-mode) auto-mode-alist))
]]></artwork>
<postamble>and then restarting Emacs.</postamble>
</figure>
<t>The author uses both sgml-mode in Emacs,
and a commercial validating editor,
<eref target="http://www.t2000-usa.com/">Clip! version 1.5</eref>,
when editing source
files.</t>
<section title="Checking">
<t>If your editor doesn't validate,
then you should run a program to validate the source file.</t>
<t>The author uses
<eref target="http://www.alphaworks.ibm.com/formula/xml/">the
AlphaWorks XML parser</eref> for this purpose.
It requires that your system have a Java virtual machine.
In addition to Java,
there are validating parsers written in C, Perl, Python, and Tcl.</t>
</section>
</section>
<section anchor="xml2rfc" title="Converting to Text Format">
<t>The author has written
<eref target="http://memory.palace.org/authoring/">the xml2rfc tool</eref>,
which reads the source file and produces both a text and HTML version
of the document.
(This memo was produced using the xml2rfc tool.)
Note that xml2rfc isn't a validating tool,
so it's a good idea to use either a validating editor or run a stand-alone
validating parser prior to using the tool.</t>
</section>
<section title="Converting to HTML Format">
<t>The XML Style Language (XSL) is used to describe 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.</t>
<t>However,
as of this writing XSL is still in considerable flux.
(Hence,
no reference was included in this memo,
as by the time you read this section,
the reference would be outdated.)
So,
in the interim,
the author uses the xml2rfc tool for this purpose,
even though this tool doesn't provide much flexibility in its HTML layout.</t>
</section>
<section title="Viewing">
<t>Browsers that support either XSL or Cascading Style Sheets (CSS)
are able to view the source file directly.</t>
<t>At present,
the author doesn't use any of these browsers,
instead converting source files to either text or HTML.</t>
</section>
<section title="Searching">
<t>As with text editors,
any text-oriented search tool (e.g., grep) can be used on the source file.
However,
there are search tools available that understand structured source.</t>
<figure>
<preamble>The author uses
<eref target="http://www.cs.helsinki.fi/~jjaakkol/sgrep.html">sgrep
version 1.9</eref>
for this purpose,
e.g.</preamble>
<artwork>
    sgrep -g xml 'ELEMENTS("title") not in ELEMENTS("back")' \
        writing-rfcs.xml
</artwork>
<postamble>which extracts the title element from the source file.</postamble>
</figure>
</section>
</section>
<section title="Security Considerations">
<figure>
<preamble>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, e.g.,</preamble>
<artwork><![CDATA[
    <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>
]]></artwork>
</figure>
</section>
</middle>
<back>
<references>
<reference anchor="XML" target="http://www.w3.org/TR/1998/REC-xml-19980210">
<front>
<title>Extensible Markup Language (XML) 1.0</title>
<author>
<organization abbrev="W3C">World Wide Web Consortium</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science</street>
<street>545 Technology Square</street>
<city>Cambridge</city> <region>MA</region> <code>02139</code>
<country>US</country>
</postal>
<phone>+ 1 617 253 2613</phone>
<facsimile>+ 1 617 258 5999</facsimile>
<email>timbl@w3.org</email>
<uri>http://www.w3c.org</uri>
</address>
</author>
<date month="February" year="1998"/>
</front>
</reference>
<reference anchor="refs.RFC2223">
<front>
<title>Instructions to RFC Authors</title>
<author initials="J." surname="Postel" fullname="Jon Postel">
<organization abbrev="ISI">USC/Information Sciences Institute</organization>
<address>
<postal>
<street>4676 Admiralty Way</street>
<city>Marina del Rey</city> <region>CA</region> <code>90292</code>
<country>US</country>
</postal>
<phone>+1 310 822 1511</phone>
<facsimile>+1 310 823 6714</facsimile>
<email>Postel@ISI.EDU</email>
</address>
</author>
<author initials="J." surname="Reynolds" fullname="Joyce K. Reynolds">
<organization abbrev="ISI">USC/Information Sciences Institute</organization>
<address>
<postal>
<street>4676 Admiralty Way</street>
<city>Marina del Rey</city> <region>CA</region> <code>90292</code>
<country>US</country>
</postal>
<phone>+1 310 822 1511</phone>
<facsimile>+1 310 823 6714</facsimile>
<email>jkrey@isi.edu</email>
</address>
</author>
<date month="October" year="1997"/>
</front>
<seriesInfo>RFC 2223</seriesInfo>
</reference>
<reference anchor="refs.RFC2026">
<front>
<title>The Internet Standards Process -- Revision 3</title>
<author initials="S.O." surname="Bradner" fullname="Scott O. Bradner">
<organization>Harvard University</organization>
<address>
<postal>
<street>Holyoke Center, Room 813</street>
<street>1350 Massachusettes Avenue</street>
<city>Cambridge</city> <region>MA</region> <code>02138</code>
<country>US</country>
</postal>
<phone>+1 617 495 3864</phone>
<email>sob@harvard.edu</email>
</address>
</author>
<date month="October" year="1996"/>
</front>
<seriesInfo>RFC 2026</seriesInfo>
<seriesInfo>BCP 9</seriesInfo>
</reference>
<reference anchor="URI">
<front>
<title>Uniform Resource Identifiers (URI): Generic Syntax</title>
<author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
<organization abbrev="W3C">World Wide Web Consortium</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science</street>
<street>545 Technology Square</street>
<city>Cambridge</city> <region>MA</region> <code>02139</code>
<country>US</country>
</postal>
<phone>+1 617 253 5702</phone>
<facsimile>+1 617 258 8682</facsimile>
<email>timbl@w3.org</email>
</address>
</author>
<author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
<organization abbrev="UCI">University of California, Irvine</organization>
<address>
<postal>
<street>Department of Information and Computer Science</street>
<street>University of California, Irvine</street>
<city>Irvine</city> <region>CA</region> <code>92697-3425</code>
<country>US</country>
</postal>
<phone>+1 949 824 7403</phone>
<facsimile>+1 949 824 1715</facsimile>
<email>fielding@ics.uci.edu</email>
</address>
</author>
<author initials="L." surname="Masinter" fullname="Larry Masinter">
<organization>Xerox PARC</organization>
<address>
<postal>
<street>3333 Coyote Hill Road</street>
<city>Palo Alto</city> <region>CA</region> <code>94304</code>
<country>US</country>
</postal>
<phone>+1 650 812 4365</phone>
<facsimile>+1 650 812 4333</facsimile>
<email>masinter@parc.xerox.com</email>
</address>
</author>
<date month="August" year="1998"/>
</front>
<seriesInfo>RFC 2396</seriesInfo>
</reference>
</references>
<section anchor="rfc" title="The rfc Element">
<figure>
<preamble>The "&lt;rfc&gt;" tag at the beginning of the file,
with only <xref target="ipr2026">an "ipr2026" attribute</xref>,
produces an Internet-Draft.
However,
when other attributes are added to this tag by the RFC editor,
an RFC is produced, e.g.,</preamble>
<artwork><![CDATA[
    <rfc number="2200"
         obsoletes="2000, 1920, 1880, 1800, ..."
         category="std"
         seriesNo="1">
]]></artwork>
<postamble>At a minimum,
the "number" attribute should be present.</postamble>
</figure>
<t>The other attributes are:
<list style="symbols">
<t>"obsoletes",
having a comma-separated list of RFC numbers,
that the document obsoletes;</t>
<t>"updates",
having a comma-separated list of RFC numbers,
that the document updates;</t>
<t>"category",
having one of these values:
    <list style="numbers">
    <t>"std", for a Standards-Track document;</t>
    <t>"bcp", "for a Best Current Practices document;</t>
    <t>"exp", for an Experimental Protocol document;</t>
    <t>"historic", for a historic document; or,</t>
    <t>"info", the default, for an Informational document.</t>
    </list>
</t>
<t>"seriesNo",
having the corresponding number in the STD (std), BCP (bcp), or FYI (info)
series.</t>
</list>
</t>
<t>Finally,
a special entity, "&amp;rfc.number;", is available.
Authors preparing an RFC should use this entity whenever they want to
reference the number of the RFC within the document itself.
In printed versions of the document,
the appropriate substitution (or "XXXX") will occur.</t>
</section>
<section anchor="rfc.dtd" title="The RFC DTD">
<figure>
<artwork><![CDATA[
<!--
  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

        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 % MONTH      "CDATA">
<!ENTITY % YEAR       "CDATA">

<!ENTITY % URI        "CDATA">

<!ENTITY % ATEXT      "CDATA">
<!ENTITY % CTEXT      "#PCDATA">

<!ENTITY % TEXT       "#PCDATA">

<!ENTITY   rfc.number "XXXX">


<!--
  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
          ipr2026     (full|noDerivativeWorks|none)
                                         #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
          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;|xref|eref|list|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 vspace      EMPTY>
<!ATTLIST vspace
          startBlank  %NUMBER;           "0">

<!ELEMENT figure      (preamble?,artwork,postamble?)>
<!ATTLIST figure
          anchor      ID                 #IMPLIED
          title       %ATEXT;            "">

<!ELEMENT preamble    (%TEXT;|xref|eref)*>
<!ELEMENT artwork     (%TEXT;)*>
<!ATTLIST artwork
          xml:space   (default|preserve) "preserve">
<!ELEMENT postamble   (%TEXT;|xref|eref)*>


<!--
  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  (%CTEXT;)>
]]></artwork>
</figure>
</section>
</back>
</rfc>


Html markup produced by rfcmarkup 1.129c, available from https://tools.ietf.org/tools/rfcmarkup/