1 16 19 20 21 package org.apache.xpath.domapi; 22 23 import org.w3c.dom.Attr ; 24 import org.w3c.dom.DOMException ; 25 import org.w3c.dom.Document ; 26 import org.w3c.dom.Element ; 27 import org.w3c.dom.NamedNodeMap ; 28 import org.w3c.dom.Node ; 29 import org.w3c.dom.NodeList ; 30 import org.w3c.dom.xpath.XPathNamespace; 31 32 69 70 public class XPathNamespaceImpl implements XPathNamespace { 71 72 Node m_attributeNode = null; 74 75 78 public XPathNamespaceImpl(Node node) { 79 m_attributeNode = node; 80 } 81 82 85 public Element getOwnerElement() { 86 return ((Attr )m_attributeNode).getOwnerElement(); 87 } 88 89 92 public String getNodeName() { 93 return "#namespace"; 94 } 95 96 99 public String getNodeValue() throws DOMException { 100 return m_attributeNode.getNodeValue(); 101 } 102 103 106 public void setNodeValue(String arg0) throws DOMException { 107 } 108 109 112 public short getNodeType() { 113 return XPathNamespace.XPATH_NAMESPACE_NODE; 114 } 115 116 119 public Node getParentNode() { 120 return m_attributeNode.getParentNode(); 121 } 122 123 126 public NodeList getChildNodes() { 127 return m_attributeNode.getChildNodes(); 128 } 129 130 133 public Node getFirstChild() { 134 return m_attributeNode.getFirstChild(); 135 } 136 137 140 public Node getLastChild() { 141 return m_attributeNode.getLastChild(); 142 } 143 144 147 public Node getPreviousSibling() { 148 return m_attributeNode.getPreviousSibling(); 149 } 150 151 154 public Node getNextSibling() { 155 return m_attributeNode.getNextSibling(); 156 } 157 158 161 public NamedNodeMap getAttributes() { 162 return m_attributeNode.getAttributes(); 163 } 164 165 168 public Document getOwnerDocument() { 169 return m_attributeNode.getOwnerDocument(); 170 } 171 172 175 public Node insertBefore(Node arg0, Node arg1) throws DOMException { 176 return null; 177 } 178 179 182 public Node replaceChild(Node arg0, Node arg1) throws DOMException { 183 return null; 184 } 185 186 189 public Node removeChild(Node arg0) throws DOMException { 190 return null; 191 } 192 193 196 public Node appendChild(Node arg0) throws DOMException { 197 return null; 198 } 199 200 203 public boolean hasChildNodes() { 204 return false; 205 } 206 207 210 public Node cloneNode(boolean arg0) { 211 throw new DOMException (DOMException.NOT_SUPPORTED_ERR,null); 212 } 213 214 217 public void normalize() { 218 m_attributeNode.normalize(); 219 } 220 221 224 public boolean isSupported(String arg0, String arg1) { 225 return m_attributeNode.isSupported(arg0, arg1); 226 } 227 228 231 public String getNamespaceURI() { 232 233 return m_attributeNode.getNodeValue(); 236 } 237 238 241 public String getPrefix() { 242 return m_attributeNode.getPrefix(); 243 } 244 245 248 public void setPrefix(String arg0) throws DOMException { 249 } 250 251 254 public String getLocalName() { 255 256 return m_attributeNode.getPrefix(); 258 } 259 260 263 public boolean hasAttributes() { 264 return m_attributeNode.hasAttributes(); 265 } 266 267 } 268 | Popular Tags |