How to count number of XML nodes that contain specific value

后端 未结 2 707
一整个雨季
一整个雨季 2021-01-19 06:13

I am looking for how to count the nodes in an XML file that contain a value of \"No\" as well as the total number of elements.

I have the element count working fine,

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-19 06:45

    I am looking for how to count the nodes in an XML file that contain a value of "No"

    In XPath:

    count(/root/User[JSEnabled = 'No'])
    

    as well as the total number of elements.

    That you already have it:

    count(/root/User)
    

    Or use the expression for selecting the nodes and any DOM method to count Node Set Result members.

提交回复
热议问题