1 16 19 20 package org.apache.xml.dtm.ref.dom2dtm; 21 22 import org.apache.xml.dtm.DTMException; 23 24 import org.w3c.dom.Attr ; 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 31 48 public class DOM2DTMdefaultNamespaceDeclarationNode implements Attr  49 { 50 final String NOT_SUPPORTED_ERR="Unsupported operation on pseudonode"; 51 52 Element pseudoparent; 53 String prefix,uri,nodename; 54 int handle; 55 DOM2DTMdefaultNamespaceDeclarationNode(Element pseudoparent,String prefix,String uri,int handle) 56 { 57 this.pseudoparent=pseudoparent; 58 this.prefix=prefix; 59 this.uri=uri; 60 this.handle=handle; 61 this.nodename="xmlns:"+prefix; 62 } 63 public String getNodeName() {return nodename;} 64 public String getName() {return nodename;} 65 public String getNamespaceURI() {return "http://www.w3.org/2000/xmlns/";} 66 public String getPrefix() {return prefix;} 67 public String getLocalName() {return prefix;} 68 public String getNodeValue() {return uri;} 69 public String getValue() {return uri;} 70 public Element getOwnerElement() {return pseudoparent;} 71 72 public boolean isSupported(String feature, String version) {return false;} 73 public boolean hasChildNodes() {return false;} 74 public boolean hasAttributes() {return false;} 75 public Node getParentNode() {return null;} 76 public Node getFirstChild() {return null;} 77 public Node getLastChild() {return null;} 78 public Node getPreviousSibling() {return null;} 79 public Node getNextSibling() {return null;} 80 public boolean getSpecified() {return false;} 81 public void normalize() {return;} 82 public NodeList getChildNodes() {return null;} 83 public NamedNodeMap getAttributes() {return null;} 84 public short getNodeType() {return Node.ATTRIBUTE_NODE;} 85 public void setNodeValue(String value) {throw new DTMException(NOT_SUPPORTED_ERR);} 86 public void setValue(String value) {throw new DTMException(NOT_SUPPORTED_ERR);} 87 public void setPrefix(String value) {throw new DTMException(NOT_SUPPORTED_ERR);} 88 public Node insertBefore(Node a, Node b) {throw new DTMException(NOT_SUPPORTED_ERR);} 89 public Node replaceChild(Node a, Node b) {throw new DTMException(NOT_SUPPORTED_ERR);} 90 public Node appendChild(Node a) {throw new DTMException(NOT_SUPPORTED_ERR);} 91 public Node removeChild(Node a) {throw new DTMException(NOT_SUPPORTED_ERR);} 92 public Document getOwnerDocument() {return pseudoparent.getOwnerDocument();} 93 public Node cloneNode(boolean deep) {throw new DTMException(NOT_SUPPORTED_ERR);} 94 95 100 public int getHandleOfNode() 101 { 102 return handle; 103 } 104 } 105 106 | Popular Tags |