Skip to content

Instantly share code, notes, and snippets.

@emchateau
Created April 26, 2022 13:57
Show Gist options
  • Save emchateau/a473e9c40faf971144df6f9848f77f85 to your computer and use it in GitHub Desktop.
Save emchateau/a473e9c40faf971144df6f9848f77f85 to your computer and use it in GitHub Desktop.
Quick count
for $group in db:open('xpr')/xpr/expertises/expertise
for $year in $group/description/sessions/
date[@when castable as xs:date]/year-from-date(@when)
group by $year
return $year || ' : ' || count($group/self::node())
(: The self::node() step is used in the last line to remove duplicate nodes in the resulting $group value. :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment