Skip to content

Using xml2rfc citations libraries

Ladislav Lhotka edited this page Sep 19, 2018 · 1 revision

One of really nice features of xml2rfc are the citation libraries that can be readily used in the XML source of an RFC or I-D. YANG-I-D provides template files and XSLT stylesheets that further simplify the process of including citations and referencing them in the text.

However, all this broke down when the IETF migrated all web sites to https: libxml2 doesn't support TLS (and probably never will), so it is unable to resolve external entities with https://... URLs. Fortunately, there is a simple workaround that also enables off-line use of the citation libraries.

Step 1: download the citation libraries to the local system

The citation libraries can be downloaded (and later refreshed) using rsync:

rsync -av xml2rfc.ietf.org::xml2rfc.bibxml /usr/local/share/xml2rfc

In this example, the citations will be stored under /usr/local/share/xml2rfc, but any other directory can be used instead.

Step 2: write an XML catalog for the citation libraries

Create the catalog file with the following contents and store it in the "root" directory where the citation libraries reside (/usr/local/share/xml2rfc):

<?xml version="1.0" encoding="utf-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <!-- XML Catalog file for xml2rfc citations -->
  <rewriteURI
      uriStartString="https://xml2rfc.tools.ietf.org/public/rfc/"
      rewritePrefix="./"/>
  <rewriteSystem
      systemIdStartString="https://xml2rfc.tools.ietf.org/public/rfc/"
      rewritePrefix="./"/>
</catalog>

Step 3: refer to the new catalog file from the system catalog

Most Linux distributions use /etc/xml/catalog as the system XML catalog. Just append the following entry to this file:

  <nextCatalog catalog="file:///usr/local/share/xml2rfc/catalog.xml"/>

Again, modify the catalog attribute so as to refer to the actual location of the new catalog file.