A working example of the Say-Howdy function
✓ Published0🌍 Public
CCliffordAnderson
Last edited Mar 27, 2015
Created on Mar 27, 2015
This example demonstrates a recursive function that customizes a greeting for multiple names, showing how XQuery handles string concatenation and conditional logic. The `local:say-howdy` function takes a sequence of strings, checks the count with `fn:count`, and joins multiple names with `fn:string-join` using " and " while appending an exclamation mark. The code invokes the function with a sequence of two names, "Dave" and "Laura", producing a single combined greeting. The example highlights XQuery’s type annotations (`xs:string*`) and the `if`/`else` expression, with no external libraries—purely native XQuery 3.0 syntax.
AI-generated description