1 29 30 package com.caucho.quercus.lib.dom; 31 32 import com.caucho.xml.*; 33 34 import org.w3c.dom.*; 35 import org.xml.sax.SAXException ; 36 37 import java.io.IOException ; 38 import java.io.InputStream ; 39 40 public class QDOMFactory 41 implements DOMFactory 42 { 43 public Attr createAttr(String name) 44 { 45 return new QAttr(name); 46 } 47 48 public Comment createComment() 49 { 50 return new QComment(); 51 } 52 53 public Document createDocument() 54 { 55 return new QDocument(); 56 } 57 58 public Document createDocument(DocumentType docType) 59 { 60 return new QDocument(docType); 61 } 62 63 public DocumentType createDocumentType(String qualifiedName) 64 { 65 return new QDocumentType(qualifiedName); 66 } 67 68 public DocumentType createDocumentType(String qualifiedName, 69 String publicId, 70 String systemId) 71 { 72 return new QDocumentType(qualifiedName, publicId, systemId); 73 } 74 75 public Element createElement(String name) 76 { 77 return new QElement(name); 78 } 79 80 public Element createElement(String name, String namespace) 81 { 82 return new QElement(name, namespace); 83 } 84 85 public EntityReference createEntityReference(String name) 86 { 87 return new QEntityReference(name); 88 } 89 90 public ProcessingInstruction createProcessingInstruction(String name) 91 { 92 return new QProcessingInstruction(name); 93 } 94 95 public Text createText() 96 { 97 return new QText(); 98 } 99 100 public org.w3c.dom.DOMImplementation getImplementation() 101 { 102 return new QDOMImplementation(); 103 } 104 105 public void parseXMLDocument(Document document, InputStream is, String path) 106 throws IOException , SAXException 107 { 108 Xml xml = new Xml(); 109 xml.parseDocument((QDocument) document, is, path); 110 } 111 112 public void parseHTMLDocument(Document document, InputStream is, String path) 113 throws IOException , SAXException 114 { 115 Html html = new Html(); 116 html.parseDocument((QDocument) document, is, path); 117 } 118 } 119 | Popular Tags |