10. Standard Document Query Language

SDQL adds two data types to the expression language, node-list and named-node-list. It also adds some additional syntax for expressions: in SDQL, in any context in which an expression is allowed, a special-query-expression is also allowed.

A subset of SDQL called the core query language is defined in “Core Query Language”.

The node-list data type represents an ordered list of zero or more nodes in a grove.

There is no node data type. A single node is represented by a node-list with a single member.

A node-list will typically be implemented in a lazy fashion. In other words, the internal representation of a node-list is not a list of nodes, but a representation of the specification that constructed the node-list. For example, if an application uses the node-list-count procedure on a node-list, it would be inefficient to build the node-list, count it, and then discard the node-list; it would be better simply to count how many distinct nodes match the node-list's specification.

A node-list with a single member is referred to as a singleton node-list.

The named-node-list data type is a subtype of the node-list data type that represents a node-list each of whose members has a string-valued property that uniquely identifies the node in the node-list.

nl is used for an argument that shall be a node-list. snl is used for an argument that shall be a singleton node-list. nnl is used for an argument that shall be a named-node-list.