home contribute faq download

FunctX XSLT Functions


The atomic value of a node



The fn:data function accepts a sequence of items and returns their typed values. For atomic values, this simply means returning the value itself, unchanged. For nodes, this means extracting the typed value of the node.

Calling this function is often unnecessary because the typed value of a node is extracted automatically (in a process known as atomization) for many XQueryXPath 2.0 expressions, including comparisons, arithmetic operations and function calls. The most common use case for the fn:data function is in XQuery element constructors.

This description is © Copyright 2007, Priscilla Walmsley. It is excerpted from the book XQuery by Priscilla Walmsley, O'Reilly, 2007. For a complete explanation of this function, please refer to Appendix A of the book.

Arguments and Return Type

$arg item()* the item to get the value of
return value xs:anyAtomicType*


<xsl:variable name="cat" select="doc('http://www.functx.com/input/catalog.xml')"/>
XSLT ExampleResults
<(557,>557, 563, 443, 784)
<navy>avy black
<557>57 Fleece Pullover navy black
<Our>ur favorite shirt!
The additional examples below yield different results if the input document was validated with the schema shown here.
<('navy', 'black'>
Error FOTY0012


Published OnLast UpdatedContributor(s)
2006-06-272007-02-26W3C, XQuery 1.0 and XPath 2.0 Functions and Operators, http://www.w3.org/TR/xpath-functions/
Datypic XSLT Services

Recommended Reading: