how to get the attribute value of an xml node using java

前端 未结 6 834
抹茶落季
抹茶落季 2020-12-03 13:59

I\'ve an xml which looks like this:

{ .....         


        
6条回答
  •  孤街浪徒
    2020-12-03 14:46

    use

    document.getElementsByTagName(" * ");

    to get all XML elements from within an XML file, this does however return repeating attributes

    example:

    NodeList list = doc.getElementsByTagName("*");


    System.out.println("XML Elements: ");

            for (int i=0; i

提交回复
热议问题