1 57 58 package com.sun.org.apache.xerces.internal.impl.xs.dom; 59 60 import com.sun.org.apache.xerces.internal.dom.TextImpl; 61 import com.sun.org.apache.xerces.internal.dom.AttrNSImpl; 62 import org.w3c.dom.DOMException ; 63 import org.w3c.dom.Element ; 64 import org.w3c.dom.Text ; 65 import org.w3c.dom.Attr ; 66 67 68 76 public class DocumentImpl extends com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl { 77 78 protected DOMNodePool fNodePool; 79 83 86 public DocumentImpl() { 87 super(); 88 } 89 90 91 94 public Element createElementNS(String namespaceURI, String qualifiedName, 95 String localpart, 96 int lineNum, int columnNum) 97 throws DOMException 98 { 99 if (fNodePool !=null) { 100 ElementNSImpl element = fNodePool.getElementNode(); 101 element.setValues(this, namespaceURI, qualifiedName, 102 localpart, lineNum, columnNum); 103 return element; 104 } 105 return new ElementNSImpl(this, namespaceURI, qualifiedName, 106 localpart, lineNum, columnNum); 107 } 108 109 115 public Text createTextNode(String data) { 116 if (fNodePool != null) { 117 TextImpl text = fNodePool.getTextNode(); 118 text.setValues(this, data); 119 return text; 120 } 121 return new TextImpl(this, data); 122 } 123 124 125 135 public Attr createAttributeNS(String namespaceURI, String qualifiedName, 136 String localName) throws DOMException { 137 if (fNodePool != null) { 138 AttrNSImpl attr = fNodePool.getAttrNode(); 139 attr.setValues(this, namespaceURI, qualifiedName, localName); 140 return attr; 141 } 142 return new AttrNSImpl(this, namespaceURI, qualifiedName, localName); 143 } 144 145 } | Popular Tags |