1. Introduction

By literate programming, we mean programs that are intended
to be readable. The idea comes from Dr. Donald
E. Knuth and has a long history. For background, see the
Literate
Programming web site.

Knuth's cweb system interwove
narrative about the program with the actual source code of
the program. One then runs a tool named
ctangle to generate the source code
an a different tool named cweave to
generate the online documentation.

Stavely's idea was to use DocBook's existing
programlisting element to hold the program
fragments, adding a role='executable'
attribute to that element to distinguish executable source
code from other uses of the programlisting
element. This means that the regular processing of DocBook
into HTML and PDF forms is the equivalent of Knuth's
cweave step.

The remaining half of the problem, the extraction of the
executable code from the DocBook source file, is the
subject of this document.

The litlxml script is embedded in this document.
Relevant online files include: