コード例 #1
0
 /**
  * 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);
 }
コード例 #2
0
 String getFileName() {
   return xmlFile.getAbsolutePath().toString();
 }
コード例 #3
0
 /**
  * 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;
 }