Skip to main content

Introduction

The IETF uses a specific format for the standards and other documents it publishes as RFCs, and for the draft documents which are produced when developing documents for publications. There exists a number of different tools to facilitate the formatting of drafts and RFCs according to the existing rules, and this tool, xml2rfc, is one of them. It takes as input an xml file which contains the text and meta-information about author names etc., and transforms it into suitably formatted output. The input xml file should follow the DTD given in RFC2629 (or it’s inofficial successor).

The current incarnation of xml2rfc provides output in the following formats: Paginated and unpaginated ascii text, html, nroff, and expanded xml. Only the paginated text format is currently (January 2013) accepable as draft submissions to the IETF.

Installation

System Install

To install a system-wide version of xml2rfc, download and unpack the xml2rfc distribution package, then cd into the resulting package directory and run:

$ python setup.py install

Alternatively, if you have the ‘pip’ command (‘Pip Installs Packages’) installed, you can run pip to download and install the package:

$ pip install xml2rfc

User Install

If you want to perform a local installation for a specific user, you have a couple of options. You may use python’s default location of user site-packages by specifying the flag --user. These locations are:

  • UNIX: $HOME/.local/lib/python<ver>/site-packages

  • OSX: $HOME/Library/Python/<ver>/lib/python/site-packages

  • Windows: %APPDATA%/Python/Python<ver>/site-packages

You can additionally combine the flag --install-scripts with --user to specify a directory on your PATH to install the xml2rfc executable to. For example, the following command:

$ python setup.py install --user --install-scripts=$HOME/bin

will install the xml2rfc library and data to your local site-packages directory, and an executable python script xml2rfc to $HOME/bin.

Custom Install

The option --prefix allows you to specify the base path for all installation files. The setup.py script will exit with an error if your PYTHONPATH is not correctly configured to contain the library path the script tries to install to.

The command is used as follows:

$ python setup.py install --prefix=<path>

For further fine-tuning of the installation behavior, you can get a list of all available options by running:

$ python setup.py install --help

Usage

xml2rfc accepts a single XML document as input and outputs to one or more conversion formats.

Basic Usage: xml2rfc SOURCE [options] FORMATS...

Options

The following parameters affect how xml2rfc behaves, however none are required.

Short

Long

Description

-C

--clear-cache

purge the cache and exit

-h

--help

show the help message and exit

-n

--no-dtd

disable DTD validation step

-N

--no-network

don’t use the network to resolve references

-q

--quiet

dont print anything

-v

--verbose

print extra information

-V

--version

display the version number and exit

-b BASENAME

--basename=BASENAME

specify the base name for output files

-c CACHE

--cache=CACHE

specify an alternate cache directory to write to

-D DATE

--date=DATE

run as if todays date is DATE (format: yyyy-mm-dd)

-d DTD

--dtd=DTD

specify an alternate dtd file

-o FILENAME

--out=FILENAME

specify an output filename

Formats

At least one but as many as all of the following output formats must be specified. The destination file will be created according to the argument given to –filename. If no argument was given, it will create the file(s) “output.format”. If no format is specified, xml2rfc will default to paginated text (--text).

Command

Description

--raw

outputs to a text file, unpaginated

--text

outputs to a text file with proper page breaks

--nroff

outputs to an nroff file

--html

outputs to an html file

--exp

outputs to an XML file with all references expanded

Examples
xml2rfc draft.xml
xml2rfc draft.xml --dtd=alt.dtd --basename=draft-1.0 --text --nroff --html

Dependencies

xml2rfc depends on the following packages:

Changelog

Version 2.9.3 (15 Feb 2018)

  • Changed the way <date> defaults are calculated. Previously, today’s date were used to populate missing day if month and year matched, and to populate month if year matched. However, if today’s date lay in an adjoining month, even if it was within days of that month, the day would be set to the first of the given month. This commit changes that, to use the last day of the month instead of the first of the month, if the month is the previous month to today’s date. This will result in a different derived date than earlier, closer to today’s date. This fixes issue #337.

  • Fixed a bug in a preptool.py error message. Reverted a prettyprinting change which caused inconsistent behaviour between writers.

  • Moved normalize_month() to utils, for use in multiple writers.

  • Made the makefile less verbose.

  • Improved the pretty-printing of v2v3 output. Fixed a bug in the attribute_xref_target() handler name that prevented it from being called.

  • Removed whitespace normalization from v2v3 writer.

  • Moved handling of exempted default attributes in preptool inside get_attribute_defaults(), for consistency.

  • Added an option –liberal to permit re-processing of prepped source without error exit. This mode will be needed when we make the preptool part of the default processing pipeline. Also removed whitespace normalization for v2v3, exp, and preptool output, in order to not change authors’ text formatting when not needed.

  • Lowered the requirement on six to 1.4.1 in order to make installation easier on some systems with locked system python libs that include six.

Version 2.9.2 (09 Feb 2018)

  • Fixed issues with packaging and with execution under python 2.7. Fixes issue #342 and #343.

Version 2.9.1 (09 Feb 2018)

Metadata

Release files for xml2rfc 2.9.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xml2rfc 2.9.3
File Size Uploaded
xml2rfc-2.9.3.tar.gz 1.7 MB Details

Release files / xml2rfc-2.9.3.tar.gz

Download URL xml2rfc-2.9.3.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
93b6f2bd5e028745bcd8e76156d351829153674066360d2577f1ca5842686aed
BLAKE2b-256 checksum
How to use checksums
ba56b1a30326b94610732f414ee22b99ed208931f178f477f5f747d70aaef0fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

3.34.1

2 release files

3.30.1

2 release files

3.30.0

2 release files

3.29.0

2 release files

3.26.0

2 release files

3.25.0

1 release file

3.24.0

1 release file

3.23.2

1 release file

3.23.1

1 release file

3.23.0

1 release file

3.22.0

1 release file

3.21.0

1 release file

3.20.1

1 release file

3.20.0

1 release file

3.19.4

1 release file

3.19.3

1 release file

3.19.2

1 release file

3.19.1

1 release file

3.19.0

1 release file

3.18.2

1 release file

3.18.1

1 release file

3.18.0

1 release file

3.17.5

1 release file

3.17.4

1 release file

3.17.3

1 release file

3.17.2

1 release file

3.17.1

1 release file

3.17.0

1 release file

3.16.0

1 release file

3.15.3

1 release file

3.15.2

1 release file

3.15.1

1 release file

3.15.0

1 release file

3.14.2

1 release file

3.14.1

1 release file

3.14.0

1 release file

3.13.1

1 release file

3.13.0

1 release file

3.12.9

1 release file

3.12.8

1 release file

3.12.7

1 release file

3.12.6

1 release file

3.12.5

1 release file

3.12.4

1 release file

3.12.3

1 release file

3.12.2

1 release file

3.12.1

1 release file

3.12.0

1 release file

3.11.1

1 release file

3.11.0

1 release file

3.10.0

1 release file

3.9.1

1 release file

3.9.0

1 release file

3.8.0

1 release file

3.7.0

1 release file

3.6.0

1 release file

3.5.0

1 release file

3.4.0

1 release file

3.3.0

1 release file

3.2.1

1 release file

3.2.0

1 release file

3.1.1

1 release file

3.1.0

1 release file

3.0.0

1 release file

2.47.0

1 release file

2.46.0

1 release file

2.45.3

1 release file

2.45.2

1 release file

2.45.1

1 release file

2.45.0

1 release file

2.44.0

1 release file

2.43.0

1 release file

2.42.0

1 release file

2.41.0

1 release file

2.40.1

1 release file

2.40.0

1 release file

2.39.0

1 release file

2.38.1

1 release file

2.38.0

1 release file

2.37.3

1 release file

2.37.2

1 release file

2.37.1

1 release file

2.37.0

1 release file

2.36.0

1 release file

2.35.0

1 release file

2.34.0

1 release file

2.33.0

1 release file

2.32.0

1 release file

2.31.0

1 release file

2.30.0

1 release file

2.29.1

1 release file

2.29.0

1 release file

2.28.0

1 release file

2.27.1

1 release file

2.27.0

1 release file

2.26.0

1 release file

2.25.0

1 release file

2.24.0

1 release file

2.23.1

1 release file

2.23.0

1 release file

2.22.3

1 release file

2.22.2

1 release file

2.22.1

1 release file

2.22.0

1 release file

2.21.1

1 release file

2.21.0

1 release file

2.20.1

1 release file

2.20.0

1 release file

2.19.1

1 release file

2.19.0

1 release file

2.18.0

1 release file

2.17.2

1 release file

2.17.1

1 release file

2.17.0

1 release file

2.16.3

1 release file

2.16.2

1 release file

2.16.1

1 release file

2.16.0

1 release file

2.15.5

1 release file

2.15.4

1 release file

2.15.3

1 release file

2.15.2

1 release file

2.15.1

1 release file

2.15.0

1 release file

2.14.1

1 release file

2.14.0

1 release file

2.13.1

1 release file

2.13.0

1 release file

2.12.3

1 release file

2.12.2

1 release file

2.12.1

1 release file

2.12.0

1 release file

2.11.1

1 release file

2.11.0

1 release file

2.10.3

1 release file

2.10.2

1 release file

2.10.1

1 release file

2.10.0

1 release file

2.9.9

1 release file

2.9.8

1 release file

2.9.7

1 release file

2.9.6

1 release file

2.9.5

1 release file

2.9.4

1 release file

This release

2.9.3 This release

1 release file

2.9.2

1 release file

2.9.1

1 release file

2.9.0

1 release file

2.8.5

1 release file

2.8.4

1 release file

2.8.3

1 release file

2.8.2

1 release file

2.8.1

1 release file

2.8.0

1 release file

2.7.0

1 release file

2.6.2

1 release file

2.6.1

1 release file

2.6.0

1 release file

2.5.2

1 release file

2.5.1

1 release file

2.5.0

1 release file

2.4.12

1 release file

2.4.11

1 release file

2.4.10

1 release file

2.4.9

1 release file

2.4.8

1 release file

2.4.7

1 release file

2.4.6

1 release file

2.4.5

1 release file

2.4.4

1 release file

2.4.3

1 release file

2.4.2

1 release file

2.4.1

1 release file

2.4.0

1 release file

2.3.11

1 release file

2.3.10

1 release file

2.3.9

1 release file

2.3.8

1 release file

2.3.7

1 release file

2.3.6

1 release file

2.3.5

1 release file

2.3.4

1 release file

2.3.3

1 release file

2.3.2

1 release file

2.3.1

1 release file

2.3.0

1 release file

2.2.7

1 release file

2.2.5

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page