distinct in Xpath?

后端 未结 6 834
走了就别回头了
走了就别回头了 2020-12-03 04:37

I have this XML file, from which I\'d like to count the number of users referenced in it. But they can appear in more than one category, and I\'d like these duplicates not t

6条回答
  •  被撕碎了的回忆
    2020-12-03 04:54

    count(//user[not(./@name = preceding::user/@name)])
    

    I think the best way is to try to draw your xml data on paper to see how you can solve it easily

提交回复
热议问题