Skip to content

Instantly share code, notes, and snippets.

@hansenmc
Last active January 1, 2016 22:14
Show Gist options
  • Save hansenmc/c06ca4bbf4b27f0f43e5 to your computer and use it in GitHub Desktop.
Save hansenmc/c06ca4bbf4b27f0f43e5 to your computer and use it in GitHub Desktop.
MarkLogic supports XPath 3.0 Inline Function Expressions
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 :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment