View Old View New View Both View Only Previous Next

This draft contains only sections that have differences from the version that it modified.

W3C

XQuery and XPath Data Model 4.0

W3C Editor's Draft 23 February 2026

This version:
https://www.w3.org/TR/2000/REC-xpath-datamodel-40-20000101/
Latest version of XQuery and XPath Data Model 4.0:
https://www.w3.org/TR/xpath-datamodel-40/
Previous versions of XQuery and XPath Data Model 4.0:
https://www.w3.org/TR/2017/PR-xpath-datamodel-31-20170117/
https://www.w3.org/TR/2016/CR-xpath-datamodel-31-20161213/
https://www.w3.org/TR/2014/CR-xpath-datamodel-31-20141218/
Most recent version of XQuery and XPath Data Model 4:
https://www.w3.org/TR/xpath-datamodel-4/
Most recent version of XQuery and XPath Data Model:
https://www.w3.org/TR/xpath-datamodel/
Most recent Recommendation of XQuery and XPath Data Model:
https://www.w3.org/TR/2014/REC-xpath-datamodel-30-20140408/
Editor:
Michael Kay, Saxonica <http://www.saxonica.com/>

This document is also available in these non-normative formats: XML.


Abstract

This document defines the data model of [XPath 4.0], [XSL Transformations (XSLT) Version 4.0], and [XQuery 4.0: An XML Query Language], and any other specifications that reference it.

Status of this Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document.

This document is a working draft developed and maintained by a W3C Community Group, the XQuery and XSLT Extensions Community Group unofficially known as QT4CG (where "QT" denotes Query and Transformation). This draft is work in progress and should not be considered either stable or complete. Standard W3C copyright and patent conditions apply.

The community group welcomes comments on the specification. Comments are best submitted as issues on the group's GitHub repository.

The community group maintains two extensive test suites, one oriented to XQuery and XPath, the other to XSLT. These can be found at qt4tests and xslt40-test respectively. New tests, or suggestions for correcting existing tests, are welcome. The test suites include extensive metadata describing the conditions for applicability of each test case as well as the expected results. They do not include any test drivers for executing the tests: each implementation is expected to provide its own test driver.

Dedication

The publications of this community group are dedicated to our co-chair, Michael Sperberg-McQueen (1954–2024).


G Accessor Summary (Non-Normative)

This section summarizes the return values of each accessor by node type.

G.1 dm:attributes Accessor

Node KindsDocument nodes

Returns the empty sequence

Node KindsElement nodes

Returns the value of the attributes property. The order of attribute nodes is stable but implementation dependent.

Node KindsAttribute nodes

Returns the empty sequence.

Node KindsNamespace nodes

Returns the empty sequence.

Node KindsProcessing instruction nodes

Returns the empty sequence.

Node KindsComment nodes

Returns the empty sequence.

Node KindsText nodes

Returns the empty sequence.

G.2 dm:base-uri Accessor

Node KindsDocument nodes

Returns the value of the base-uri property.

Node KindsElement nodes

Returns the value of the base-uri property.

Node KindsAttribute nodes

If the attribute has a parent, returns the value of the dm:base-uri of its parent; otherwise it returns the empty sequence.

Node KindsNamespace nodes

Returns the empty sequence.

Node KindsProcessing instruction nodes

Returns the value of the base-uri property.

Node KindsComment nodes

If the comment has a parent, returns the value of the dm:base-uri of its parent; otherwise, returns the empty sequence.

Node KindsText nodes

If the text node has a parent, returns the value of the dm:base-uri of its parent; otherwise, returns the empty sequence.

G.3 dm:children Accessor

Node KindsDocument nodes

Returns the value of the children property.

Node KindsElement nodes

Returns the value of the children property.

Node KindsAttribute nodes

Returns the empty sequence.

Node KindsNamespace nodes

Returns the empty sequence.

Node KindsProcessing instruction nodes

Returns the empty sequence.

Node KindsComment nodes

Returns the empty sequence.

Node KindsText nodes

Returns the empty sequence.

G.4 dm:document-uri Accessor

Node KindsDocument nodes

Returns the absolute URI of the resource from which the document node was constructed, or the empty sequence if no such absolute URI is available.

Node KindsElement nodes

Returns the empty sequence.

Node KindsAttribute nodes

Returns the empty sequence.

Node KindsNamespace nodes

Returns the empty sequence.

Node KindsProcessing instruction nodes

Returns the empty sequence.

Node KindsComment nodes

Returns the empty sequence.

Node KindsText nodes

Returns the empty sequence.

G.5 dm:is-id Accessor

Node KindsDocument nodes

Returns the empty sequence.

Node KindsElement nodes

Returns the value of the is-id property.

Node KindsAttribute nodes

Returns the value of the is-id property.

Node KindsNamespace nodes

Returns the empty sequence.

Node KindsProcessing instruction nodes

Returns the empty sequence.

Node KindsComment nodes

Returns the empty sequence.

Node KindsText nodes

Returns the empty sequence.

G.6 dm:is-idrefs Accessor

Node KindsDocument nodes

Returns the empty sequence.

Node KindsElement nodes

Returns the value of the is-idrefs property.

Node KindsAttribute nodes

Returns the value of the is-idrefs property.

Node KindsNamespace nodes

Returns the empty sequence.

Node KindsProcessing instruction nodes

Returns the empty sequence.

Node KindsComment nodes

Returns the empty sequence.

Node KindsText nodes

Returns the empty sequence.

G.7 dm:namespace-nodes Accessor

Node KindsDocument nodes

Returns the empty sequence.

Node KindsElement nodes

Returns the value of the namespaces property as a sequence of namespace nodes. The order of namespace nodes is stable but implementation dependent.

Node KindsAttribute nodes

Returns the empty sequence.

Node KindsNamespace nodes

Returns the empty sequence.

Node KindsProcessing instruction nodes

Returns the empty sequence.

Node KindsComment nodes

Returns the empty sequence.

Node KindsText nodes

Returns the empty sequence.

G.8 dm:nilled Accessor

Node KindsDocument nodes

Returns the empty sequence.

Node KindsElement nodes

Returns the value of the nilled property.

Node KindsAttribute nodes

Returns the empty sequence.

Node KindsNamespace nodes

Returns the empty sequence.

Node KindsProcessing instruction nodes

Returns the empty sequence.

Node KindsComment nodes

Returns the empty sequence.

Node KindsText nodes

Returns the empty sequence.

G.9 dm:node-kind Accessor

Node KindsDocument nodes

Returns “document”.

Node KindsElement nodes

Returns “element”.

Node KindsAttribute nodes

Returns “attribute”.

Node KindsNamespace nodes

Returns “namespace”.

Node KindsProcessing instruction nodes

Returns “processing-instruction”.

Node KindsComment nodes

Returns “comment”.

Node KindsText nodes

Returns “text”.

G.10 dm:node-name Accessor

Node KindsDocument nodes

Returns the empty sequence.

Node KindsElement nodes

Returns the value of the node-name property.

Node KindsAttribute nodes

Returns the value of the node-name property.

Node KindsNamespace nodes

If the prefix is not empty, returns an xs:QName with the value of the prefix property in the local-name and an empty namespace name, otherwise returns the empty sequence.

Node KindsProcessing instruction nodes

Returns an xs:QName with the value of the target property in the local-name and an empty namespace URI and empty prefix.

Node KindsComment nodes

Returns the empty sequence.

Node KindsText nodes

Returns the empty sequence.

G.11 dm:parent Accessor

Node KindsDocument nodes

Returns the empty sequence.

Node KindsElement nodes

Returns the value of the parent property.

Node KindsAttribute nodes

Returns the value of the parent property.

Node KindsNamespace nodes

Returns the value of the parent property.

Node KindsProcessing instruction nodes

Returns the value of the parent property.

Node KindsComment nodes

Returns the value of the parent property.

Node KindsText nodes

Returns the value of the parent property.

G.12 dm:string-value Accessor

Node KindsDocument nodes

Returns the value of the string-value property.

Node KindsElement nodes

Returns the value of the string-value property.

Node KindsAttribute nodes

Returns the value of the string-value property.

Node KindsNamespace nodes

Returns the value of the uri property.

Node KindsProcessing instruction nodes

Returns the value of the content property.

Node KindsComment nodes

Returns the value of the content property.

Node KindsText nodes

Returns the value of the content property.

G.13 dm:type-name Accessor

Node KindsDocument nodes

Returns the empty sequence.

Node KindsElement nodes

Returns the value of the schema-type property.

Node KindsAttribute nodes

Returns the value of the schema-type property.

Node KindsNamespace nodes

Returns the empty sequence.

Node KindsProcessing instruction nodes

Returns the empty sequence.

Node KindsComment nodes

Returns the empty sequence.

Node KindsText nodes

Returns xs:untypedAtomic.

G.14 dm:typed-value Accessor

Node KindsDocument nodes

Returns the value of the typed-value property.

Node KindsElement nodes

Returns the value of the typed-value property.

Node KindsAttribute nodes

Returns the value of the typed-value property.

Node KindsNamespace nodes

Returns the value of the uri property as an xs:string.

Node KindsProcessing instruction nodes

Returns the value of the content property as a xs:string.

Node KindsComment nodes

Returns the value of the content property as a xs:string.

Node KindsText nodes

Returns the value of the content property as an xs:untypedAtomic.

G.15 dm:unparsed-entity-public-id Accessor

Node KindsDocument nodes

Returns the public identifier of the specified unparsed entity or the empty sequence if no such entity exists.

Node KindsElement nodes

Returns the empty sequence.

Node KindsAttribute nodes

Returns the empty sequence.

Node KindsNamespace nodes

Returns the empty sequence.

Node KindsProcessing instruction nodes

Returns the empty sequence.

Node KindsComment nodes

Returns the empty sequence.

Node KindsText nodes

Returns the empty sequence.

G.16 dm:unparsed-entity-system-id Accessor

Node KindsDocument nodes

Returns the system identifier of the specified unparsed entity or the empty sequence if no such entity exists.

Node KindsElement nodes

Returns the empty sequence.

Node KindsAttribute nodes

Returns the empty sequence.

Node KindsNamespace nodes

Returns the empty sequence.

Node KindsProcessing instruction nodes

Returns the empty sequence.

Node KindsComment nodes

Returns the empty sequence.

Node KindsText nodes

Returns the empty sequence.