Data Model

XQuery is defined in terms of a formal data model, not in terms of XML text. Every input to a query is an instance of the data model, and the output of every query is an instance of the data model. In the XQuery data model, every document is represented as a tree of nodes. The kinds of nodes that may occur are: document, element, attribute, text, namespace, processing instruction, and comment. Every node has a unique node identity that distinguishes it from other nodes—even from other nodes that are otherwise identical.

In addition to nodes, the data model allows atomic values, which are single values that correspond to the simple types defined in the W3C Recommendation, “XML Schema, Part 2” [SCHEMA], such as strings, Booleans, decimals, ...

Get XQuery from the Experts: A Guide to the W3C XML Query Language now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.