1 57 58 package com.sun.org.apache.xerces.internal.dom; 59 60 import org.w3c.dom.DOMException ; 61 import org.w3c.dom.DOMImplementation ; 62 import org.w3c.dom.Document ; 63 import org.w3c.dom.DocumentType ; 64 import org.w3c.dom.Element ; 65 66 78 public class PSVIDOMImplementationImpl extends CoreDOMImplementationImpl { 79 80 84 86 87 static PSVIDOMImplementationImpl singleton = new PSVIDOMImplementationImpl(); 88 89 93 94 public static DOMImplementation getDOMImplementation() { 95 return singleton; 96 } 97 98 102 117 public boolean hasFeature(String feature, String version) { 118 return super.hasFeature(feature, version) || 119 feature.equalsIgnoreCase("psvi"); 120 } 122 142 public Document createDocument(String namespaceURI, 143 String qualifiedName, 144 DocumentType doctype) 145 throws DOMException 146 { 147 if (doctype != null && doctype.getOwnerDocument() != null) { 148 throw new DOMException (DOMException.WRONG_DOCUMENT_ERR, 149 DOMMessageFormatter.formatMessage( 150 DOMMessageFormatter.XML_DOMAIN, 151 "WRONG_DOCUMENT_ERR", null)); 152 } 153 DocumentImpl doc = new PSVIDocumentImpl(doctype); 154 Element e = doc.createElementNS( namespaceURI, qualifiedName); 155 doc.appendChild(e); 156 return doc; 157 } 158 159 160 } | Popular Tags |