string

Converts a value or a node to string

Description

The fn:string function converts a value or a node to a string. If $arg is a node, this function returns its string value. The method of determining the string value of a node depends on its kind. For an element node, it is the character data content of the element and all of its descendants concatenated together. For an attribute node, it is simply the value of the attribute as a string. If $arg is an atomic value, the function returns that value, cast to xs:string.

Parameters

Description

arg:string()

Examples

XPath

Results

string($in-xml-2/number)

784

string($in-xml-2/desc)

Our favorite shirt!

string($in-xml-2/@dept)

MEN