Skip to content

Instantly share code, notes, and snippets.

@bencomp
Created June 13, 2013 12:17
Show Gist options
  • Save bencomp/5773235 to your computer and use it in GitHub Desktop.
Save bencomp/5773235 to your computer and use it in GitHub Desktop.
Return all <unittitle> elements in which the first word (sequence of non-space characters) ends with a comma.
let $content := <top><unittitle>Test, another word</unittitle></top>
return $content//unittitle[ends-with(tokenize(./text(), " ")[1], ",")]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment