I am using XQuery to count occurrences of related comments, on a thread on Social Media. However, I only want to count these occurrences, if the comments are made by females. (This is for a gender related research project at Uni.
So far I have got XQuery to count all the occurrences of the comments made by females by using this:
for $t in doc ("women.xml")
let $a:=$t//comment/@gender="female"
return count ($a)
However I need some help working out how I would adapt this to account the occurrences of appearance specific comments said by females.
Thank you for your help
count(//comment[@gender="female"])will return the number ofcommentelements with@genderattribute values equal to"female".