distinct in Xpath?

后端 未结 6 836
走了就别回头了
走了就别回头了 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:53

    A pure XPath 1.0 -- one-liner:

    Use:

    count(/*/group/user[not(. = ../following-sibling::group/user)])

提交回复
热议问题