XPath: How to select nodes which have no attributes?

前端 未结 3 1596
Happy的楠姐
Happy的楠姐 2020-12-02 08:16

Using XPath, how to select nodes which have no attributes (where attribute count = 0)?

For example:


    

        
3条回答
  •  Happy的楠姐
    2020-12-02 08:48

    //node[not(@*)]
    

    That's the XPath to select all nodes named "node" in the document without any attributes.

提交回复
热议问题