List of utility methods to do XML Document Create
Document | stringToDocument(String xmlString) string To Document return db.parse(new ByteArrayInputStream(xmlString.getBytes("UTF-8"))); |
Document | toDocument(File f) to Document return builder.get().parse(f);
|
Document | toDocument(Reader reader) Parses an XML document from a reader. return toDocument(new InputSource(reader)); |
Document | toDocument(ResultSet rs) to Document DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.newDocument(); System.out.println("here"); Element results = doc.createElement("Results"); doc.appendChild(results); ResultSetMetaData rsmd = rs.getMetaData(); int colCount = rsmd.getColumnCount(); ... |
Document | toDocument(SOAPMessage soapMsg) to Document Source src = soapMsg.getSOAPPart().getContent(); TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer = tf.newTransformer(); DOMResult result = new DOMResult(); transformer.transform(src, result); return (Document) result.getNode(); |
Document | toDomDocument(Node domNode) to Dom Document return toDomDocument(toXml(domNode));
|