XML: Return elements of a sequence that occur certain number of times

后端 未结 2 422
傲寒
傲寒 2021-01-28 08:23

I have an XML file with information on movies. I want my expression to return the directors in the XML that have directed more than 1 movie.

What I have now is:

2条回答
  •  攒了一身酷
    2021-01-28 09:07

    I solved the problem with the following code:

    let $directors := distinct-values(
    for $director in //director
    where count(result/videos/video[director = $director]) > 1
    return $director
    )
    return $directors
    

提交回复
热议问题