RFC 2629 Writing I-Ds and RFCs using XML June 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: tdtd [6] and
psgml [7]. 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. If this doesn't work, try one of the
sources above.
The author uses both sgml-mode in Emacs, and a commercial validating
editor, Clip! version 1.5 [8], when editing source files.
3.1.1 Checking
If your editor doesn't validate, then you should run a program to
validate the source file.
The author uses the AlphaWorks XML parser [9] for this 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.
RFC 2629 Writing I-Ds and RFCs using XML June 1999
3.2 Converting to Text Format
The author has written the xml2rfc tool [10], 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.
=11= |