FileDocCategorySizeDatePackage
XPathNamespaceImpl.javaAPI DocJava SE 6 API8883Tue Jun 10 00:23:14 BST 2008com.sun.org.apache.xpath.internal.domapi

XPathNamespaceImpl

public class XPathNamespaceImpl extends Object implements XPathNamespace
The XPathNamespace interface is returned by XPathResult interfaces to represent the XPath namespace node type that DOM lacks. There is no public constructor for this node type. Attempts to place it into a hierarchy or a NamedNodeMap result in a DOMException with the code HIERARCHY_REQUEST_ERR . This node is read only, so methods or setting of attributes that would mutate the node result in a DOMException with the code NO_MODIFICATION_ALLOWED_ERR.

The core specification describes attributes of the Node interface that are different for different node node types but does not describe XPATH_NAMESPACE_NODE, so here is a description of those attributes for this node type. All attributes of Node not described in this section have a null or false value.

ownerDocument matches the ownerDocument of the ownerElement even if the element is later adopted.

prefix is the prefix of the namespace represented by the node.

nodeName is the same as prefix.

nodeType is equal to XPATH_NAMESPACE_NODE.

namespaceURI is the namespace URI of the namespace represented by the node.

adoptNode, cloneNode, and importNode fail on this node type by raising a DOMException with the code NOT_SUPPORTED_ERR.In future versions of the XPath specification, the definition of a namespace node may be changed incomatibly, in which case incompatible changes to field values may be required to implement versions beyond XPath 1.0.

See also the Document Object Model (DOM) Level 3 XPath Specification. This implementation wraps the DOM attribute node that contained the namespace declaration.

xsl.usage
internal

Fields Summary
private final Node
m_attributeNode
private String
textContent
Constructors Summary
XPathNamespaceImpl(Node node)
Constructor for XPathNamespaceImpl.

        m_attributeNode = node;
    
Methods Summary
public org.w3c.dom.NodeappendChild(org.w3c.dom.Node arg0)

see
org.w3c.dom.Node#appendChild(Node)

        return null;
    
public org.w3c.dom.NodecloneNode(boolean arg0)

see
org.w3c.dom.Node#cloneNode(boolean)

        throw new DOMException(DOMException.NOT_SUPPORTED_ERR,null);
    
public shortcompareDocumentPosition(org.w3c.dom.Node other)

        return 0;
    
public org.w3c.dom.NamedNodeMapgetAttributes()

see
org.w3c.dom.Node#getAttributes()

        return m_attributeNode.getAttributes();
    
public java.lang.StringgetBaseURI()

        return null;
    
public org.w3c.dom.NodeListgetChildNodes()

see
org.w3c.dom.Node#getChildNodes()

        return m_attributeNode.getChildNodes();
    
public java.lang.ObjectgetFeature(java.lang.String feature, java.lang.String version)

        return null; //PENDING
    
public org.w3c.dom.NodegetFirstChild()

see
org.w3c.dom.Node#getFirstChild()

        return m_attributeNode.getFirstChild();
    
public org.w3c.dom.NodegetLastChild()

see
org.w3c.dom.Node#getLastChild()

        return m_attributeNode.getLastChild();
    
public java.lang.StringgetLocalName()

see
org.w3c.dom.Node#getLocalName()

        
        // For namespace node, the local name is the same as the prefix
        return m_attributeNode.getPrefix();
    
public java.lang.StringgetNamespaceURI()

see
org.w3c.dom.Node#getNamespaceURI()

        
        // For namespace node, the namespaceURI is the namespace URI
        // of the namespace represented by the node.
        return m_attributeNode.getNodeValue();
    
public org.w3c.dom.NodegetNextSibling()

see
org.w3c.dom.Node#getNextSibling()

        return m_attributeNode.getNextSibling();
    
public java.lang.StringgetNodeName()

see
org.w3c.dom.Node#getNodeName()

        return "#namespace";
    
public shortgetNodeType()

see
org.w3c.dom.Node#getNodeType()

        return XPathNamespace.XPATH_NAMESPACE_NODE;
    
public java.lang.StringgetNodeValue()

see
org.w3c.dom.Node#getNodeValue()

        return m_attributeNode.getNodeValue();
    
public org.w3c.dom.DocumentgetOwnerDocument()

see
org.w3c.dom.Node#getOwnerDocument()

        return m_attributeNode.getOwnerDocument();
    
public org.w3c.dom.ElementgetOwnerElement()

see
com.sun.org.apache.xalan.internal.dom3.xpath.XPathNamespace#getOwnerElement()

        return ((Attr)m_attributeNode).getOwnerElement(); 
    
public org.w3c.dom.NodegetParentNode()

see
org.w3c.dom.Node#getParentNode()

        return m_attributeNode.getParentNode();
    
public java.lang.StringgetPrefix()

see
org.w3c.dom.Node#getPrefix()

        return m_attributeNode.getPrefix();
    
public org.w3c.dom.NodegetPreviousSibling()

see
org.w3c.dom.Node#getPreviousSibling()

        return m_attributeNode.getPreviousSibling();
    
public java.lang.StringgetTextContent()

        return textContent;
    
public java.lang.ObjectgetUserData(java.lang.String key)

        return null;
    
public booleanhasAttributes()

see
org.w3c.dom.Node#hasAttributes()

        return m_attributeNode.hasAttributes();
    
public booleanhasChildNodes()

see
org.w3c.dom.Node#hasChildNodes()

        return false;
    
public org.w3c.dom.NodeinsertBefore(org.w3c.dom.Node arg0, org.w3c.dom.Node arg1)

see
org.w3c.dom.Node#insertBefore(Node, Node)

        return null;
    
public booleanisDefaultNamespace(java.lang.String namespaceURI)

        return false;
    
public booleanisEqualNode(org.w3c.dom.Node arg)

        return false;
    
public booleanisSameNode(org.w3c.dom.Node other)

        return false;
    
public booleanisSupported(java.lang.String arg0, java.lang.String arg1)

see
org.w3c.dom.Node#isSupported(String, String)

        return m_attributeNode.isSupported(arg0, arg1);
    
public java.lang.StringlookupNamespaceURI(java.lang.String prefix)

        return null;
    
public java.lang.StringlookupPrefix(java.lang.String namespaceURI)

        return ""; //PENDING
    
public voidnormalize()

see
org.w3c.dom.Node#normalize()

        m_attributeNode.normalize();
    
public org.w3c.dom.NoderemoveChild(org.w3c.dom.Node arg0)

see
org.w3c.dom.Node#removeChild(Node)

        return null;
    
public org.w3c.dom.NodereplaceChild(org.w3c.dom.Node arg0, org.w3c.dom.Node arg1)

see
org.w3c.dom.Node#replaceChild(Node, Node)

        return null;
    
public voidsetNodeValue(java.lang.String arg0)

see
org.w3c.dom.Node#setNodeValue(String)

    
public voidsetPrefix(java.lang.String arg0)

see
org.w3c.dom.Node#setPrefix(String)

    
public voidsetTextContent(java.lang.String textContent)

        this.textContent = textContent;
    
public java.lang.ObjectsetUserData(java.lang.String key, java.lang.Object data, org.w3c.dom.UserDataHandler handler)

        return null; //PENDING