TopLeaf processes input documents sequentially as a stream of text interspersed with structural and metadata objects (for example, tags and processing instructions) called markers. Each marker has the potential to trigger a mapping that invokes one or more typesetting actions, such as Change font style to italic or Start new paragraph. The sequence in which these actions are applied is described in “Order of evaluation”.

This streaming approach has the advantage of speed and simplicity, but limits the extent to which material in the document can be rearranged on the fly. To offset this, TopLeaf provides the following additional capabilities:

  • The ability to capture the content of any marker (for example the content of an element), to be used or re-used at any later point.

  • The ability to insert system or user-defined markers into the input stream, thus enabling the markup actually present in the document to be internally augmented to a level capable of driving the desired output.

In practice, the majority of markers used in document rendering correspond to the markup contained within a document. However TopLeaf recognizes several other types of marker, all of which have the ability to drive the typesetting process.

The following section describes the available markers in greater detail.