在Java中遍历所有DOM元素的最有效方法是什么?
如下所示,但对于当前org.w3c.dom.Document
上的每个DOM元素
for(Node childNode = node.getFirstChild(); childNode!=null;){
Node nextChild = childNode.getNextSibling();
// Do something with childNode, including move or delete...
childNode = nextChild;
}
https://stackoverflow.com/questions/5386991
复制相似问题