1 package com.icl.saxon.om; 2 import com.icl.saxon.tinytree.*; 3 4 import org.w3c.dom.Document ; 5 import org.w3c.dom.DOMImplementation ; 6 import org.xml.sax.InputSource ; 7 import org.xml.sax.EntityResolver ; 8 import org.xml.sax.ErrorHandler ; 9 import org.xml.sax.SAXException ; 10 11 import javax.xml.parsers.*; 12 import javax.xml.transform.sax.SAXSource ; 13 import javax.xml.transform.TransformerException ; 14 15 public class DocumentBuilderImpl extends DocumentBuilder { 16 17 public boolean isNamespaceAware() { 18 return true; 19 } 20 21 public boolean isValidating() { 22 return false; 23 } 24 25 public Document newDocument() { 26 return new TinyDocumentImpl(); 29 } 30 31 public Document parse(InputSource in) throws SAXException { 32 try { 33 Builder builder = new TinyBuilder(); 34 builder.setNamePool(NamePool.getDefaultNamePool()); 35 return (Document )builder.build(new SAXSource (in)); 36 } catch (TransformerException err) { 37 throw new SAXException (err); 38 } 39 } 40 41 public void setEntityResolver(EntityResolver er) { 42 } 44 45 public void setErrorHandler(ErrorHandler er) { 46 } 48 49 public DOMImplementation getDOMImplementation() { 50 return new TinyDocumentImpl().getImplementation(); 51 } 52 } | Popular Tags |