This module exports procedures for transforming a limited subset of the SXML representation of docbook into stexi. It is not complete by any means. The intention is to gather a number of routines and stylesheets so that external modules can parse specific subsets of docbook, for example that set generated by certain tools.
A stylesheet for use with SSAX's
pre-post-order
, which defines a number of generic rules for transforming docbook into texinfo.
The set of sdocbook element tags that should not be nested inside each other. See sdocbook-flatten, for more information.
Filters out empty elements in an sdocbook nodeset. Mostly useful after running
sdocbook-flatten
.
Iterate over the sdocbook nodeset sdocbook-fragment, transforming contiguous
refsect
andtitle
elements into the appropriate texinfo sectioning command. Most useful after having runsdocbook-flatten
.For example:
(replace-titles '((refsect1) (title "Foo") (para "Bar."))) ⇒ '((chapter "Foo") (para "Bar."))
"Flatten" a fragment of sdocbook so that block elements do not nest inside each other.
Docbook is a nested format, where e.g. a
refsect2
normally appears inside arefsect1
. Logical divisions in the document are represented via the tree topology; arefsect2
element contains all of the elements in its section.On the contrary, texinfo is a flat format, in which sections are marked off by standalone section headers like
@chapter
, and block elements do not nest inside each other.This function takes a nested sdocbook fragment sdocbook and flattens all of the sections, such that e.g.
(refsect1 (refsect2 (para "Hello")))becomes
((refsect1) (refsect2) (para "Hello"))Oftentimes (always?) sectioning elements have
<title>
as their first element child; users interested in processing therefsect*
elements into proper sectioning elements likechapter
might be interested inreplace-titles
andfilter-empty-elements
. See replace-titles, and filter-empty-elements.Returns a nodeset, as described in sxml xpath. That is to say, this function returns an untagged list of stexi elements.