public String innerXml(Node node) { DOMImplementationLS lsImpl = (DOMImplementationLS)node.getOwnerdocument().getImplementation().getFeature("LS", "3.0"); LSSerializer lsSerializer = lsImpl.createLSSerializer(); NodeList childNodes = node.getChildNodes(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < childNodes.getLength(); i++) { sb.append(lsSerializer.writeToString(childNodes.item(i))); } return sb.toString(); }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)