A parser for parsing documents comprising a Document Order List Creator, a
YPath Table Creator, and a ZPath Table Creator. The arrangement of the
Document Order List creator being such that it is adapted to produce a
Document Order List (DOL) correlating a unique index number with an
associated node, and the Document Order List creator being adapted to
allocate each node in a document parsed its own unique index number in
the DOL. The arrangement of the YPath Table Creator is such that it is
adapted to produce a YPath Table having a set of sequences of node names
representative of all sequences of node names encountered in traversing
from the root node to all possible nodes in the document parsed, and
associated with each sequence of node names a corresponding group of
index numbers corresponding to the index numbers in the DOL for which the
associated sequence of node names is true. The arrangement of the ZPath
Table Creator is adapted to create a ZPath Table having a set of
sequences of ordinals representative of ordinals of those nodes
encounterable in traversing from the root node to all possible nodes in
the document, the ordinal of a node being the integer value position of
the node amongst those nodes of the same name which share the same parent
node, and associated with each set of sequences of ordinals, a
corresponding group of index numbers corresponding to the index numbers
in the DOL for which the associated sequence of ordinals for nodes is
true.