Node.getAttributes()
NamedNodeMap attributes = fstElmnt.getAttributes();for (int a = 0; a < attributes.getLength(); a++) { Node theAttribute = attributes.item(a); System.out.println(theAttribute.getNodeName() + "=" + theAttribute.getNodevalue());}
如果使用XPATH检索数据,则可以避免遍历。阅读本教程。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)