XPath2 functions are available when either the XSLT2 or XQuery languages are selected.
The functions in the Constructors part of the XPath 2.0 functions library construct specific datatypes from the input text. Typically, the lexical format of the input text must be that expected of the datatype to be constructed. Otherwise, the transformation will not be successful.
For example, if you wish to construct an xs:date datatype, use the xs:date constructor function. The input text must have the lexical format of the xs:date datatype, which is: YYYY-MM-DD (screenshot below).
In the screenshot above, a string constant (2009-08-22) has been used to provide the input argument of the function. The input could also have been obtained from a node in the source document.
The xs:date function returns the input text (2009-08-22), which is of xs:string datatype (specified in the Constant component), as output of xs:date datatype.
When you mouseover the input argument in a function box, the expected datatype of the argument is displayed in a popup.
© 2019 Altova GmbH