1 23 24 package org.enhydra.xml.lazydom; 25 26 import org.enhydra.apache.xerces.dom.DOMImplementationImpl; 27 import org.w3c.dom.DOMException ; 28 import org.w3c.dom.DOMImplementation ; 29 import org.w3c.dom.Document ; 30 import org.w3c.dom.DocumentType ; 31 32 37 public class LazyDOMImplementation extends DOMImplementationImpl { 38 39 private static LazyDOMImplementation fSingleton; 40 41 44 public static DOMImplementation getDOMImplementation() { 45 if (fSingleton == null) { 46 fSingleton = new LazyDOMImplementation(); 47 } 48 return fSingleton; 49 } 50 51 55 public Document createDocument(String namespaceURI, 56 String qualifiedName, 57 DocumentType doctype) throws DOMException { 58 LazyDocument doc = new LazyDocument(doctype, null); 59 doc.appendChild(doc.createElementNS(namespaceURI, qualifiedName)); 60 return doc; 61 } 62 63 64 68 public DocumentType createDocumentType(String qualifiedName, 69 String publicID, 70 String systemID) { 71 LazyDocumentType docType = new LazyDocumentType(null, 72 null, 73 qualifiedName, 74 publicID, 75 systemID, 76 null); 77 return docType; 78 } 79 80 81 85 public Document createDocument(TemplateDOM templateDOM) throws DOMException { 86 return new LazyDocument(null, templateDOM); 87 } 88 } 89 | Popular Tags |