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

Document nodesNode Kinds

Returns the empty sequence

Element nodesNode Kinds

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

Attribute nodesNode Kinds

Returns the empty sequence.

Namespace nodesNode Kinds

Returns the empty sequence.

Processing instruction nodesNode Kinds

Returns the empty sequence.

Comment nodesNode Kinds

Returns the empty sequence.

Text nodesNode Kinds

Returns the empty sequence.

G.2 dm:base-uri Accessor

Document nodesNode Kinds

Returns the value of the base-uri property.

Element nodesNode Kinds

Returns the value of the base-uri property.

Attribute nodesNode Kinds

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

Namespace nodesNode Kinds

Returns the empty sequence.

Processing instruction nodesNode Kinds

Returns the value of the base-uri property.

Comment nodesNode Kinds

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

Text nodesNode Kinds

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

Document nodesNode Kinds

Returns the value of the children property.

Element nodesNode Kinds

Returns the value of the children property.

Attribute nodesNode Kinds

Returns the empty sequence.

Namespace nodesNode Kinds

Returns the empty sequence.

Processing instruction nodesNode Kinds

Returns the empty sequence.

Comment nodesNode Kinds

Returns the empty sequence.

Text nodesNode Kinds

Returns the empty sequence.

G.4 dm:document-uri Accessor

Document nodesNode Kinds

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.

Element nodesNode Kinds

Returns the empty sequence.

Attribute nodesNode Kinds

Returns the empty sequence.

Namespace nodesNode Kinds

Returns the empty sequence.

Processing instruction nodesNode Kinds

Returns the empty sequence.

Comment nodesNode Kinds

Returns the empty sequence.

Text nodesNode Kinds

Returns the empty sequence.

G.5 dm:is-id Accessor

Document nodesNode Kinds

Returns the empty sequence.

Element nodesNode Kinds

Returns the value of the is-id property.

Attribute nodesNode Kinds

Returns the value of the is-id property.

Namespace nodesNode Kinds

Returns the empty sequence.

Processing instruction nodesNode Kinds

Returns the empty sequence.

Comment nodesNode Kinds

Returns the empty sequence.

Text nodesNode Kinds

Returns the empty sequence.

G.6 dm:is-idrefs Accessor

Document nodesNode Kinds

Returns the empty sequence.

Element nodesNode Kinds

Returns the value of the is-idrefs property.

Attribute nodesNode Kinds

Returns the value of the is-idrefs property.

Namespace nodesNode Kinds

Returns the empty sequence.

Processing instruction nodesNode Kinds

Returns the empty sequence.

Comment nodesNode Kinds

Returns the empty sequence.

Text nodesNode Kinds

Returns the empty sequence.

G.7 dm:namespace-nodes Accessor

Document nodesNode Kinds

Returns the empty sequence.

Element nodesNode Kinds

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

Attribute nodesNode Kinds

Returns the empty sequence.

Namespace nodesNode Kinds

Returns the empty sequence.

Processing instruction nodesNode Kinds

Returns the empty sequence.

Comment nodesNode Kinds

Returns the empty sequence.

Text nodesNode Kinds

Returns the empty sequence.

G.8 dm:nilled Accessor

Document nodesNode Kinds

Returns the empty sequence.

Element nodesNode Kinds

Returns the value of the nilled property.

Attribute nodesNode Kinds

Returns the empty sequence.

Namespace nodesNode Kinds

Returns the empty sequence.

Processing instruction nodesNode Kinds

Returns the empty sequence.

Comment nodesNode Kinds

Returns the empty sequence.

Text nodesNode Kinds

Returns the empty sequence.

G.9 dm:node-kind Accessor

Document nodesNode Kinds

Returns “document”.

Element nodesNode Kinds

Returns “element”.

Attribute nodesNode Kinds

Returns “attribute”.

Namespace nodesNode Kinds

Returns “namespace”.

Processing instruction nodesNode Kinds

Returns “processing-instruction”.

Comment nodesNode Kinds

Returns “comment”.

Text nodesNode Kinds

Returns “text”.

G.10 dm:node-name Accessor

Document nodesNode Kinds

Returns the empty sequence.

Element nodesNode Kinds

Returns the value of the node-name property.

Attribute nodesNode Kinds

Returns the value of the node-name property.

Namespace nodesNode Kinds

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.

Processing instruction nodesNode Kinds

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

Comment nodesNode Kinds

Returns the empty sequence.

Text nodesNode Kinds

Returns the empty sequence.

G.11 dm:parent Accessor

Document nodesNode Kinds

Returns the empty sequence.

Element nodesNode Kinds

Returns the value of the parent property.

Attribute nodesNode Kinds

Returns the value of the parent property.

Namespace nodesNode Kinds

Returns the value of the parent property.

Processing instruction nodesNode Kinds

Returns the value of the parent property.

Comment nodesNode Kinds

Returns the value of the parent property.

Text nodesNode Kinds

Returns the value of the parent property.

G.12 dm:string-value Accessor

Document nodesNode Kinds

Returns the value of the string-value property.

Element nodesNode Kinds

Returns the value of the string-value property.

Attribute nodesNode Kinds

Returns the value of the string-value property.

Namespace nodesNode Kinds

Returns the value of the uri property.

Processing instruction nodesNode Kinds

Returns the value of the content property.

Comment nodesNode Kinds

Returns the value of the content property.

Text nodesNode Kinds

Returns the value of the content property.

G.13 dm:type-name Accessor

Document nodesNode Kinds

Returns the empty sequence.

Element nodesNode Kinds

Returns the value of the schema-type property.

Attribute nodesNode Kinds

Returns the value of the schema-type property.

Namespace nodesNode Kinds

Returns the empty sequence.

Processing instruction nodesNode Kinds

Returns the empty sequence.

Comment nodesNode Kinds

Returns the empty sequence.

Text nodesNode Kinds

Returns xs:untypedAtomic.

G.14 dm:typed-value Accessor

Document nodesNode Kinds

Returns the value of the typed-value property.

Element nodesNode Kinds

Returns the value of the typed-value property.

Attribute nodesNode Kinds

Returns the value of the typed-value property.

Namespace nodesNode Kinds

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

Processing instruction nodesNode Kinds

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

Comment nodesNode Kinds

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

Text nodesNode Kinds

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

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

Document nodesNode Kinds

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

Element nodesNode Kinds

Returns the empty sequence.

Attribute nodesNode Kinds

Returns the empty sequence.

Namespace nodesNode Kinds

Returns the empty sequence.

Processing instruction nodesNode Kinds

Returns the empty sequence.

Comment nodesNode Kinds

Returns the empty sequence.

Text nodesNode Kinds

Returns the empty sequence.

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

Document nodesNode Kinds

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

Element nodesNode Kinds

Returns the empty sequence.

Attribute nodesNode Kinds

Returns the empty sequence.

Namespace nodesNode Kinds

Returns the empty sequence.

Processing instruction nodesNode Kinds

Returns the empty sequence.

Comment nodesNode Kinds

Returns the empty sequence.

Text nodesNode Kinds

Returns the empty sequence.