1 54 package sax; 55 56 import java.io.IOException ; 57 58 import org.xml.sax.InputSource ; 59 import org.xml.sax.SAXException ; 60 61 import org.jdom.Document; 62 import org.jdom.JDOMException; 63 import org.jdom.output.SAXOutputter; 64 65 68 public class DocumentReader extends XMLReaderBase { 69 70 private final Document doc; 71 72 73 public DocumentReader(Document doc) { 74 this.doc = doc; 75 } 76 77 public void parse(InputSource input) throws SAXException , IOException { 78 SAXOutputter outputter = new SAXOutputter(this, this, this, this, this); 79 try { 80 outputter.output(doc); 81 } 82 catch (JDOMException ex) { 83 throw new SAXException (ex); 84 } 85 } 86 } 87 | Popular Tags |