xml2rfc (version v2 and v3)


A handy little tool, xml2rfc, will allow you to take your XML source (using the format defined in RFC 7749, obsoleting RFC 2629) and see how the results look like in the original ASCII look-and-feel or the new modern HTML rendition of that look-and-feel.

The RFC Editor team have put together an FAQ to help answer questions on xml2rfc and the v3 update, and Henrik has put together an introduction to the xml2rfc schema version 3.

There is a complete guide available to the currently-supported grammar and the xml2rfc command-line tool.

The v3 update to the xml2rfc language has been published. Continuing discussion on the v3 update are being held on the rfc-dev@ietf.org list. Additional tools relevant to the v3 work can be found on the experimental page. (General questions on RFC formats should be discussed on the rfc-interest@rfc-editor.org list.)

Documenation of what is implemented in the current version is now available, generated by the tool itself: xml2rfc-doc.html

The xml2rfc converter handles BOTH v2 and v3 input files.

Conversion

  1. Try your results in this handy converter form (which also supports more options than the xml2rfc tool).
    Note: If you get an empty output, be sure to turn on the Output option "Use frames to show Warnings & Errors" and look for errors there.
    The form below has not been fully converted to the new xml2rfc v3 process yet. The PDF generation still uses an older mechanism, and if you give it a v2 file, it will use the v2 processor. Stay tuned as we adjust things to be fully v3.
    Convert Your XML Source
    Input Source:
     File:
     URL:
    Output format:
    Text: plaintext as PDF
    unpaginated
    Web page: HTML as PDF
      RfcMarkup as PDF ePub
    Other: nroff expanded XML
    Options:
     Output result Use frames to show Warnings & Errors Window File

    Convert an Internet Text File to Xml2rfc format

    Convert your internet draft file to xml2rfc format.
    (The current version supported can be seen here.

    Input Source:
     File:
     URL:
    Options:
     Strip headers only No Yes
     Output result Use frames to show Warnings Window File

    <Report issues here.>
  2. Note 1: This page is now using the v2 xml2rfc program. (The specific version number can be found here.)
  3. Note 2: Version v2 is much stricter in following the language spec than version v1. For example,
    • Version v1 would accept XML that is not well-formed in a variety of places. For example:
      • ENTITY declarations must be inside <!DOCTYPE rfc SYSTEM "rfc2629.dtd"[ ]>
      • Needs <![CDATA[ ]]> for some artwork that didn't need it for v1.
    • <list> </list> must be inside <t> </t> (and other similar nesting restrictions)
    • Version v2 does not tolerate characters that are not expressed in UTF-8.
  4. Note 3: If you find errors, please report them in the trac system.
  5. If you want to use the v1 version for some reason, you can go to the old xml2rfc page. However, after June 30, 2014, XML submitted to the RFC Editor XML must be able to be processed by the v2 version.
  6. There is a GUI version of xml2rfc version 2 that may be run on your local computer, and has been built and packaged for Linux (RPM + DEB), Mac and Windows. Installation packages may be found on the IETF tools web site.

Living on the edge?

Here is the current development release.

March 2013 release

Major new xml2rfc features include:

  • The xml2rfc program has been rewritten from scratch. It is more portable, maintainable and faster.
  • However, it is stricter in adherance to the language specs.
  • It may be downloaded here. Instructions for doing a "pip install" can be found here.

Major new web features include:

  • New options in web form to generate ePub and PDF.
  • New option in web form to show trace and warning messages along with the output, using frames. This is the default.
  • New option in web form to enter a URL instead of uploading a file.
Please note that the current version of xml2rfc produces boilerplate text which is fully compliant with the latest IETF Trust Legal Provisions Document.

To generate the latest boilerplate, please use these settings in your .xml source file:
in the <rfc /> element: use one of these attributes:
  • ipr='trust200902'
    • This is appropriate for most drafts, where the entire content of the draft is written by the draft's authors, or all authors of other material have given explicit permission to use their work.
  • ipr='noModificationTrust200902'
    • This is appropriate for drafts where the authors wish to place the additional condition that if the draft is published as an RFC, it must have no changes other than formatting.  An example might be a document published by another organization that permits copying but not modification.
  • ipr='noDerivativesTrust200902'
    • This is appropriate for drafts not intended to be published as RFCs.
  • ipr='pre5378Trust200902'
    • This is appropriate for drafts that include material submitted to the IETF prior to RFC 5378 (10 Nov 2008), where the authors of that material have not given explicit permission to use their work in this draft.  An example might be a draft using material from an RFC whose author has died or cannot be located, or who thinks your draft is
      stupid.
and use a year= and month= in the <date /> element (which controls the date in the document header) with a date of 2010-04-01 or later.

Citation Libraries

The following citation libraries are generated periodically in a complete form, and may be downloaded in their entirety or individually.
citation
library
retrieve entire directory
as a file
retrieve entire directory using
wget -r -l 1 -A .xml -nd -nc ...

Example URLs for individual citations
rss
feed
rsync
RFC zip or tgz http://xml2rfc.ietf.org/public/rfc/bibxml/ or
http://www.rfc-editor.org/refs/bibxml/

Example: http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9999.xml
rss 1.0 yes
Internet-Draft zip or tgz http://xml2rfc.ietf.org/public/rfc/bibxml-ids/ or
http://xml2rfc.ietf.org/public/rfc/bibxml3/

Examples:
http://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.example-name.xml
http://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.draft-example-name-99.xml

Note: Leave draft- off when referencing a generic draft name, and add draft- when referencing a specific version of an internet-draft.
rss 1.0 yes
RFC Subseries
(STD, BCP, FYI)
zip or tgz http://xml2rfc.ietf.org/public/rfc/bibxml-rfcsubseries/ or
http://xml2rfc.ietf.org/public/rfc/bibxml9/

Examples:
http://xml2rfc.ietf.org/public/rfc/bibxml-rfcsubseries/reference.BCP.0099.xml
http://xml2rfc.ietf.org/public/rfc/bibxml-rfcsubseries/reference.FYI.0099.xml
http://xml2rfc.ietf.org/public/rfc/bibxml-rfcsubseries/reference.STD.0099.xml

Note: These are only usable with the xml2rfc v3.
no yes
W3C zip or tgz http://xml2rfc.ietf.org/public/rfc/bibxml-w3c/ or
http://xml2rfc.ietf.org/public/rfc/bibxml4/

Example: http://xml2rfc.ietf.org/public/rfc/bibxml4/reference.W3C.REC-example-name-date.xml
rss 1.0 yes
XSF (formerly JSF) zip or tgz http://www.xmpp.org/extensions/refs/ rss 0.92 no
3GPP zip or tgz http://xml2rfc.ietf.org/public/rfc/bibxml-3gpp/ or
http://xml2rfc.ietf.org/public/rfc/bibxml5/

Examples:
http://xml2rfc.ietf.org/public/rfc/bibxml5/reference.SDO-3GPP.1234.xml
http://xml2rfc.ietf.org/public/rfc/bibxml-3gpp/reference.SDO-3GPP.1234.xml
rss 1.0 yes
IEEE zip or tgz http://xml2rfc.ietf.org/public/rfc/bibxml-ieee/ or
http://xml2rfc.ietf.org/public/rfc/bibxml6/

Examples:
http://xml2rfc.ietf.org/public/rfc/bibxml6/reference.IEEE.12345_date.xml
http://xml2rfc.ietf.org/public/rfc/bibxml-ieee/reference.IEEE.12345_date.xml
rss 1.0 yes
Miscellaneous zip or tgz http://xml2rfc.ietf.org/public/rfc/bibxml-misc/ or
http://xml2rfc.ietf.org/public/rfc/bibxml2/
no yes
Note: when a filename contains a "+" or other characters not permitted within an XML ID, the anchor generated for a reference will have the disallowed characters replaced with an "_". For example, the ID generated for "bibxml3/reference.I-D.odell-8+8.xml" has an anchor of "I-D.odell-8_8" (not "I-D.odell-8+8").

rsync access is available at two independent servers (xml2rfc.ietf.org::xml2rfc.bibxml and xml2rfc.tools.ietf.org::xml2rfc.bibxml) — after you pick one, you shouldn't switch.  For example,
    $ rsync -avuz xml2rfc.ietf.org::xml2rfc.bibxml/ ~/cit/


The following citation libraries are generated on demand when referenced, with a cache maintained for 24 hours.
citation
library
Example URLs
DOI http://xml2rfc.ietf.org/public/rfc/bibxml7/reference.DOI.12.1234/12345.12345.xml
http://xml2rfc.ietf.org/public/rfc/bibxml-doi/reference.DOI.12.1234/12345.12345.xml
IANA http://xml2rfc.ietf.org/public/rfc/bibxml8/reference.IANA.example-table-name.xml
http://xml2rfc.ietf.org/public/rfc/bibxml-iana/reference.IANA.example-table-name.xml
The anchors are automatically generated based on the DOI or IANA table name. The anchor may be overridden by adding a "?anchor=EXAMPLE" argument to the URL.



Two entity files often used with RFCs and Internet-Drafts are rfc2629-xhtml.ent and rfc2629-other.ent.

Helpful Hints

See the xml2rfc FAQ for answers to common questions.

Normative References

If you need to have multiple references sections, try something like this:

    <back>
<references title='Normative References'>
...
</references>
<references title='Informative References'>
...
</references>
</back>

That's right: the <references/> element may occur more than once in the back section, and has an optional 'title' attribute.

Including files

Use the XML external entity mechanism, e.g.,

    <?xml version='1.0'?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' [

<!ENTITY rfc2629 PUBLIC '' 'http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2629.xml'>

]>

...

<t>This document was constructed using the <xref target="RFC2629" /> DTD.</t>

...

<references>
...
&rfc2629;
...
</references>

Note that this syntax is rather pedantic, i.e., you declare the entity toward the top of your file and then you invoke it exactly once (using an "&") in the <references/> element to include it.

Take a look at this file, provided by Dan Kohn. In addition to showing a complete example, it also works with the XSL transformation written by Julian Reschke and the DTD. (Depending on the capabilities of your browser, instead of clicking on these links directly, you may want to download these three files using "Save Target As...")

To try out this sample, you'll need to put all three files in the same directory. Also, note that some XSLT processors disable the use of external entities, you may need to check "Preferences" to see if there's an option to enable their use.

Notes for Authors

Templates

The IETF Tools Team maintains a library of templates you can use for different kinds of drafts.

Using your source file

When submitting an Internet-Draft using the IETF Internet-Draft Submission Tool, you can upload the XML source file in addition to the text file. If your draft is approved for publication as an RFC, the RFC Editor will retrieve the XML file from the I-D repository, or you can submit it directly to the RFC Editor.

When published

To improve the quality of the citation library, send a copy of the updated XML file here. Thanks!

Advanced Conversions

This version of the conversion form supports all combinations and output formats that are currently available.

Note: NOT ALL COMBINATIONS WORK.

  • EPub support is provided using version 0.8 of ebook-convert.
  • PS and RTF support are provided using a combination of wkhtmltopdf, pdf2ps and/or GNU enscript.


Convert Your XML Source
 Input source File:
URL:
 Output mode Text HTML (via xslt) RfcMarkup nroff unpaginated XML
 Output format ASCII PDF ePub RTF PostScript
 Output result Use frames to show Warnings & Errors Window File

Questions? Try the mailing list.