Constructor functions for built-in data types
Every built-in atomic type that is defined in the XML Schema Definition language has an associated constructor function.
Syntax
- prefix
- The prefix that is bound to the namespace for the data type. This is not the prefix that is bound to the default function namespace.
- type
- The unqualified name of the target data type.
- value
- The value that is to be constructed. If this value is an empty
sequence, the empty sequence is returned.
If value is illegal for the target data type, the constructor function returns an error.
Returned value
If value is not the empty sequence, the returned value is an instance of prefix:type.
If value is the empty sequence, a constructor function returns the empty sequence.
Example:
The
constructor function xs:integer(100)
or the constructor
function xs:integer("100")
returns the xs:integer
value
100. A constructor function whose argument is a node with the typed
value 100 also returns the typed value 100.