Get an attribute of a dom node

后端 未结 2 1723
一个人的身影
一个人的身影 2021-02-06 21:03

I am trying to get an attribute of an xml node example:



I want to grab the name attribute of the car nod

2条回答
  •  不知归路
    2021-02-06 21:33

    Your node is an Element so you just have to

    Element e = (Element)node;
    String name = e.getAttribute("name");
    

提交回复
热议问题