The string() function converts its argument to a string. When the argument is a node, it extracts the string value of the node; when the argument is an atomic value, it converts the atomic value to a string in a similar way to the xs:string() constructor function.
For example, the expression «string(4.00) » returns the string "4" .
Argument | Data Type | Meaning |
---|---|---|
value (optional) | item()? | The value to be converted. If the argument is omitted, it defaults to the context item |
Result | xs:string | The result of converting the argument to a string |