/** * write dom-object to disc * * @param document * @throws TransformerException */ public void write(Document document) throws TransformerException { DOMSource source = new DOMSource(document); StreamResult streamResult = new StreamResult(xmlFile.getAbsolutePath()); transformer.transform(source, streamResult); }
String getFileName() { return xmlFile.getAbsolutePath().toString(); }
/** * build new Document * * @return document * @throws ParserConfigurationException * @throws SAXException * @throws IOException */ Document buildDocument() throws ParserConfigurationException, SAXException, IOException { DocumentBuilder db = xmlMethFac.newDocumentBuilder(); Document document = db.parse(xmlFile.getAbsolutePath()); return document; }