1 16 17 package org.apache.xerces.dom; 18 19 import org.w3c.dom.DOMException ; 20 import org.w3c.dom.DOMImplementation ; 21 import org.w3c.dom.Document ; 22 import org.w3c.dom.DocumentType ; 23 import org.w3c.dom.Element ; 24 25 39 public class PSVIDOMImplementationImpl extends CoreDOMImplementationImpl { 40 41 45 47 48 static PSVIDOMImplementationImpl singleton = new PSVIDOMImplementationImpl(); 49 50 54 55 public static DOMImplementation getDOMImplementation() { 56 return singleton; 57 } 58 59 63 78 public boolean hasFeature(String feature, String version) { 79 return super.hasFeature(feature, version) || 80 feature.equalsIgnoreCase("psvi"); 81 } 83 103 public Document createDocument(String namespaceURI, 104 String qualifiedName, 105 DocumentType doctype) 106 throws DOMException 107 { 108 if (doctype != null && doctype.getOwnerDocument() != null) { 109 throw new DOMException (DOMException.WRONG_DOCUMENT_ERR, 110 DOMMessageFormatter.formatMessage( 111 DOMMessageFormatter.XML_DOMAIN, 112 "WRONG_DOCUMENT_ERR", null)); 113 } 114 DocumentImpl doc = new PSVIDocumentImpl(doctype); 115 Element e = doc.createElementNS( namespaceURI, qualifiedName); 116 doc.appendChild(e); 117 return doc; 118 } 119 120 121 } | Popular Tags |