📜  使用java代码示例获取xml节点内的节点

📅  最后修改于: 2022-03-11 14:52:17.396000             🧑  作者: Mango

代码示例1
for (int temp = 0; temp < NodeOzet.getLength(); temp++){
        Node nOzet = NodeOzet.item(temp);
        NodeList carList = eElement.getElementsByTagName("cars")
        String cars = "";
        for(int temp2 = 0; temp2 < carList.getLength(); temp2++){
             cars += ((Element)carList.item(temp2)).getAttribute("carname") + "\t";
        }
     }