1 28 29 package com.caucho.xml; 30 31 import org.w3c.dom.DOMImplementation ; 32 import org.w3c.dom.Document ; 33 import org.w3c.dom.DocumentType ; 34 import org.w3c.dom.Element ; 35 36 public class QDOMImplementation implements DOMImplementation , java.io.Serializable { 37 public boolean hasFeature(String feature, String version) 38 { 39 if (feature.equalsIgnoreCase("xml") && 40 (version.equals("2.0") || version.equals("1.0") || 41 version == null || version.equals(""))) 42 return true; 43 else if (feature.equalsIgnoreCase("Core") && 44 (version.equals("2.0") || version.equals("1.0") || 45 version == null || version.equals(""))) 46 return true; 47 else 48 return false; 49 } 50 51 public Object getFeature(String feature, String version) 52 { 53 return null; 54 } 55 56 public DocumentType createDocumentType(String name, 57 String publicId, 58 String systemId) 59 { 60 QDocumentType type = new QDocumentType(name); 61 type.setPublicId(publicId); 62 type.setSystemId(systemId); 63 64 return type; 65 } 66 67 public Document createDocument(String namespaceURI, String name, 68 DocumentType docType) 69 { 70 QDocument doc = new QDocument(this); 71 doc.setDoctype(docType); 72 73 Element elt = doc.createElementNS(namespaceURI, name); 74 doc.appendChild(elt); 75 76 return doc; 77 } 78 79 81 84 public DOMImplementation getInterface(String feature) 85 { 86 return null; 87 } 88 } 89 | Popular Tags |