List of utility methods to do XML Document Create
Document | getDocument(InputStream xmlInputStream) get Document Document document = null; try { DocumentBuilder builder = docFactory.newDocumentBuilder(); document = builder.parse(xmlInputStream); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); ... |
Document | getDocument(Node node) get Document return node.getOwnerDocument();
|
Document | getDocument(Node parent) get Document return (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); |
Document | getDocument(Resource resource) get Document Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(resource.getFile());
return document;
|
Document | getDocument(String docPath) Gets XML Document for a given document path return _docBuilder.parse(docPath);
|
Document | getDocument(String fileName) This method returns the Document object for xml file. File file = new File(fileName); DocumentBuilder documentBuilder = getDocumentBuilder(); return documentBuilder.parse(file); |
Document | getDocument(String filePath) get Document return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File(filePath)); |
Document | getDocument(String payload) get Document if (payload == null || payload.length() < 1) return null; StringReader sr = new StringReader(payload); InputSource source = new InputSource(sr); return getDocument(source, null); |
Document | getDocument(String xml) get Document return getDocumentBuilder().parse(xml);
|
Document | getDocument(String xml) get Document DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); return factory.newDocumentBuilder().parse(new InputSource(new StringReader(xml))); |