1 9 10 package org.dom4j.samples; 11 12 import org.dom4j.Document; 13 import org.dom4j.datatype.DatatypeDocumentFactory; 14 import org.dom4j.io.SAXReader; 15 16 22 public class DatatypeDemo extends AbstractDemo { 23 24 public static void main(String [] args) { 25 run(new DatatypeDemo(), args); 26 } 27 28 public DatatypeDemo() { 29 } 30 31 protected Document parse(String xmlFile) throws Exception { 32 SAXReader reader = new SAXReader(); 33 reader.setDocumentFactory(DatatypeDocumentFactory.getInstance()); 34 return reader.read(xmlFile); 35 } 36 37 protected void process(Document document) throws Exception { 38 getXMLWriter().write(document); 39 } 40 } 41 42 80 | Popular Tags |