Skip to content

Instantly share code, notes, and snippets.

@emchateau
Forked from xquery/gist:1536327
Last active August 29, 2015 14:10
Show Gist options
  • Save emchateau/2e42905e624f6fbef56a to your computer and use it in GitHub Desktop.
Save emchateau/2e42905e624f6fbef56a to your computer and use it in GitHub Desktop.
This function tokenize a string and returns each token in an xml element
xquery version "1.0";
(:~
: This function tokenize a string and returns each text item in a <text/> element
:)
let $string := "test,test,test,test,test"
return
for $text in tokenize($string,',')
return
<text>{concat('add some text: ', $text)}</text>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment