How can I read Xml attributes using Java?

后端 未结 6 1455
一生所求
一生所求 2020-12-10 21:44

Given an xml document that looks like the following:

 
     

        
6条回答
  •  心在旅途
    2020-12-10 22:34

    Just a little cleaned up with type declarations, basic null checks:

    Start with any node in the value of 'dom'

    NodeList l = dom.getElementsByTagName("tagname");
    
    for (int j=0; j

提交回复
热议问题