Returns the result of atomizing a sequence. This process flattens arrays, and replaces nodes by their typed values.
If the argument is omitted, it defaults to the context item (
behavior of the function if the argument is omitted is exactly the same as if the
context item had been passed as the argument.
The result of
fn:data is the sequence of atomic values produced by
applying the following rules to each item in
If the item is an atomic value, it is appended to the result sequence.
If the item is a node, the typed value of the node is appended to the result
sequence. The typed value is a sequence of zero or more atomic values:
specifically, the result of the
dm:typed-value accessor as defined in
If the item is an array, the result of applying
each member of the array, in order, is appended to the result sequence.
data((123, 456)) returns
1, 2, 3, 4.
let $para :=
xs:untypedAtomic("In a hole in the ground there lived a hobbit.").
A type error is raised if an item in the
$arg is a node that does not have a typed value.
A type error is raised if an item in
$arg is a function item other than
A dynamic error is raised if
$arg is omitted and the context item is
The process of applying the
fn:data function to a sequence is referred to
atomization. In many cases an explicit call on
not required, because atomization is invoked implicitly when a node or sequence of nodes
is supplied in a context where an atomic value or sequence of atomic values is
The result of atomizing an empty sequence is an empty sequence.
The result of atomizing an empty array is an empty sequence.