I'm puzzled by the following:
Priscilla Walmsley's books has the following code snippet to illustrate function signatures:
upper-case( as xs:string?) as xs:string
Using this bit code produces this error message when the xquery is executed via oXygen and Saxon PE 18.104.22.168
Engine name: Saxon-PE XQuery 22.214.171.124
Description: XQuery syntax error in #upper-case(@arg as xs:string#: expected ")", found "as"
Start location: 1:0
If I remover the two 'as' expressions and execute
in a query where $arg has been defined or by itself in the expression
I get the expected result. This is all the more confusing because the pop-up help gives me exactly the syntax
($arg as xs:string) as xs:string
that the parser subsequently complains about. What am I doing wrong here?