Get child Node of another Node, given node name

前端 未结 4 1265
再見小時候
再見小時候 2021-02-11 15:21

I have an XML like this:


  
    1
    Declaration of Human Rights         


        
4条回答
  •  野性不改
    2021-02-11 16:00

    Check if the Node is a Dom Element, cast, and call getElementsByTagName()

    Node doc = docs.item(i);
    if(doc instanceof Element) {
        Element docElement = (Element)doc;
        ...
        cell = doc.getElementsByTagName("aoo").item(0);
    }
    

提交回复
热议问题