This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
(: http://www.w3.org/TR/xpath-30/#id-inline-func :) | |
let $square := function($i as xs:integer) as xs:integer { | |
$i * $i | |
} | |
return $square(3) | |
(: 9 :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; (: also works with 3.0, 3.1:) | |
(: http://www.w3.org/TR/xpath-30/#id-map-operator :) | |
let $letters := ("Alpha", "Beta", "Gamma") ! substring(., 1, 1) | |
return string-join($letters, ", ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.1"; (: version must be 3.1 :) | |
(: http://www.w3.org/TR/xpath-31/#id-arrow-operator :) | |
"Happy " || current-date() => year-from-date() || "!" |