Processing node-lists as lists
Processing node-lists as lists
Node-lists can be handled as usual lists.
Example
The example uses children, node-list-first and node-list-rest statements,
which are combined.
The COOKBOOK construction-rule accesses the COOKBOOK-node by using
current-node.
Then the children of this node are accessed.
After that the first node of this children-node-list is selected. ... .
The concerning nodes are highlighted.
Note: The body of a construction must contain a sosofo.
So the nodes are processed by process-node-list to a sosofo.
Stylesheets
- The stylesheet children.dsl selects nodes by children and
the node-list methods.
SGML-document: cookbook.sgml, output type sgml
- The stylesheet recursive.dsl demonstrates the practical
use of node-list-first, node-list-last and node-list-empty?
by processing a node-list recursively.
SGML-document: recursive.sgml, output type sgml
You may need a Scheme tutorial to understand the whole example.
Next: Formatting lists: Numbers and Positions
Index