Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
If I am given a list in XQuery, like: 1, 1, 2
1, 1, 2
How do I count the number of instances of 1s?
1
The list is actually a sequence and you can count() it...
count()
let $sequence := ('1','1','2') return count($sequence[.='1'])
produces:
2