1 22 23 package org.xquark.xquery.xdbc; 24 25 import org.w3c.dom.Document ; 26 import org.xml.sax.SAXException ; 27 import org.xml.sax.XMLReader ; 28 import org.xquark.util.DOMReader; 29 import org.xquark.xml.xdbc.XMLDBCException; 30 31 public class DOMDocument extends AbstractXMLDocument { 32 private static final String RCSRevision = "$Revision: 1.1 $"; 33 private static final String RCSName = "$Name: $"; 34 35 private Document doc; 36 37 public DOMDocument(Document doc) { 38 super(); 39 this.doc = doc; 40 } 41 42 public Document getAsDOM() throws XMLDBCException { 43 return doc; 44 } 45 46 public void getAsSAX() throws XMLDBCException, SAXException { 47 try { 48 XMLReader reader = new DOMReader(doc); 49 plugHandlers(reader); 50 reader.parse(""); 51 } catch (java.io.IOException ioex) { 52 throw new XMLDBCException(ioex.getMessage(), ioex); 53 } 54 } 55 } 56 | Popular Tags |