data function

The fn:data function returns the input sequence after replacing any nodes in the input sequence by their typed values.

Syntax

Read syntax diagramSkip visual syntax diagramfn:data( sequence-expression)
sequence-expression
Any sequence, including the empty sequence.

Returned value

If sequence-expression is an empty sequence, the returned value is an empty sequence.

If sequence-expression is a single atomic value, the returned value is sequence-expression.

If sequence-expression is a single node, the returned value is the typed value of sequence-expression.

If sequence-expression is a sequence of more than one item, a sequence of atomic values is returned from the items in sequence-expression. Each atomic value in sequence-expression remains unchanged. Each node in sequence-expression is replaced by its typed value, which is a sequence of zero or more atomic values.

Example

The following function returns a sequence that contains the atomic values that are in the sequence (<x xsi:type="string">ABC</x>,<y xsi:type="decimal">1.23</y>).
fn:data((<x xsi:type="string">ABC</x>,<y xsi:type="decimal">1.23</y>))

The returned value is ("ABC",1.23).