Class XPathNamespaceImpl

java.lang.Object
org.loboevolution.html.dom.xpath.XPathNamespaceImpl
All Implemented Interfaces:
EventTarget, Node, XPathNamespace

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.

  • Method Details

    • getOwnerElement

      public Node getOwnerElement()
      The Element on which the namespace was in scope when it was requested. This does not change on a returned namespace node even if the document changes such that the namespace goes out of scope on that element and this node is no longer found there by XPath.
      Specified by:
      getOwnerElement in interface XPathNamespace
      Returns:
      a Node object.
    • getNodeName

      public String getNodeName()
      Returns a string appropriate for the type of node.
      Specified by:
      getNodeName in interface Node
      Returns:
      a String object.
    • getNodeValue

      public String getNodeValue()

      getNodeValue.

      Specified by:
      getNodeValue in interface Node
      Returns:
      a String object.
    • setNodeValue

      public void setNodeValue(String arg0)

      setNodeValue.

      Specified by:
      setNodeValue in interface Node
      Parameters:
      arg0 - a String object.
    • getNodeType

      public int getNodeType()
      Returns the type of node.
      Specified by:
      getNodeType in interface Node
      Returns:
      a Integer object.
    • getParentNode

      public Node getParentNode()
      Returns the parent.
      Specified by:
      getParentNode in interface Node
      Returns:
      a Node object.
    • getChildNodes

      public NodeList getChildNodes()
      Returns the children.
      Specified by:
      getChildNodes in interface Node
      Returns:
      a NodeList object.
    • getFirstChild

      public Node getFirstChild()
      Returns the first child.
      Specified by:
      getFirstChild in interface Node
      Returns:
      a Node object.
    • getLastChild

      public Node getLastChild()
      Returns the last child.
      Specified by:
      getLastChild in interface Node
      Returns:
      a Node object.
    • getPreviousSibling

      public Node getPreviousSibling()
      Returns the previous sibling.
      Specified by:
      getPreviousSibling in interface Node
      Returns:
      a Node object.
    • getNextSibling

      public Node getNextSibling()
      Returns the next sibling.
      Specified by:
      getNextSibling in interface Node
      Returns:
      a Node object.
    • getOwnerDocument

      public Document getOwnerDocument()
      Returns the node document. Returns null for documents.
      Specified by:
      getOwnerDocument in interface Node
      Returns:
      a Document object.
    • insertBefore

      public Node insertBefore(Node arg0, Node arg1)

      insertBefore.

      Specified by:
      insertBefore in interface Node
      Parameters:
      arg0 - a Node object.
      arg1 - a Node object.
      Returns:
      a Node object.
    • replaceChild

      public Node replaceChild(Node arg0, Node arg1)

      replaceChild.

      Specified by:
      replaceChild in interface Node
      Parameters:
      arg0 - a Node object.
      arg1 - a Node object.
      Returns:
      a Node object.
    • removeChild

      public Node removeChild(Node arg0)

      removeChild.

      Specified by:
      removeChild in interface Node
      Parameters:
      arg0 - a Node object.
      Returns:
      a Node object.
    • appendChild

      public Node appendChild(Node arg0)

      appendChild.

      Specified by:
      appendChild in interface Node
      Parameters:
      arg0 - a Node object.
      Returns:
      a Node object.
    • prependChild

      public Node prependChild(Node newChild)

      prependChild.

      Specified by:
      prependChild in interface Node
      Parameters:
      newChild - a Node object.
      Returns:
      a Node object.
    • prepend

      public Node prepend(Node newChild)

      prepend.

      Specified by:
      prepend in interface Node
      Parameters:
      newChild - a Node object.
      Returns:
      a Node object.
    • hasChildNodes

      public boolean hasChildNodes()
      Returns whether node has children.
      Specified by:
      hasChildNodes in interface Node
      Returns:
      a boolean.
    • cloneNode

      public Node cloneNode(boolean arg0)
      Returns a copy of node. If deep is true, the copy also includes the node's descendants.
      Specified by:
      cloneNode in interface Node
      Parameters:
      arg0 - a boolean.
      Returns:
      a Node object.
    • normalize

      public void normalize()
      Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
      Specified by:
      normalize in interface Node
    • getNamespaceURI

      public String getNamespaceURI()

      getNamespaceURI.

      Specified by:
      getNamespaceURI in interface Node
      Returns:
      a String object.
    • getPrefix

      public String getPrefix()
      Returns prefix.
      Specified by:
      getPrefix in interface Node
      Returns:
      a String object.
    • setPrefix

      public void setPrefix(String arg0)

      setPrefix.

      Specified by:
      setPrefix in interface Node
      Parameters:
      arg0 - a String object.
    • getLocalName

      public String getLocalName()

      getLocalName.

      Specified by:
      getLocalName in interface Node
      Returns:
      a String object.
    • getBaseURI

      public String getBaseURI()
      Returns node's node document's document base URL.
      Specified by:
      getBaseURI in interface Node
      Returns:
      a String object.
    • compareDocumentPosition

      public short compareDocumentPosition(Node other)

      compareDocumentPosition.

      Specified by:
      compareDocumentPosition in interface Node
      Parameters:
      other - a Node object.
      Returns:
      a short.
    • isSupported

      public boolean isSupported(String xml, String s)
      Specified by:
      isSupported in interface Node
    • hasAttributes

      public boolean hasAttributes()
      Description copied from interface: Node
      Returns true if element has attributes, and false otherwise.
      Specified by:
      hasAttributes in interface Node
      Returns:
      a boolean.
    • getFeature

      public Node getFeature(String name, String version)
      Specified by:
      getFeature in interface Node
    • getAttributes

      public NamedNodeMap getAttributes()
      Description copied from interface: Node

      getAttributes.

      Specified by:
      getAttributes in interface Node
      Returns:
      a NamedNodeMap object.
    • getTextContent

      public String getTextContent()

      getTextContent.

      Specified by:
      getTextContent in interface Node
      Returns:
      a String object.
    • setTextContent

      public void setTextContent(String textContent)

      setTextContent.

      Specified by:
      setTextContent in interface Node
      Parameters:
      textContent - a String object.
    • isSameNode

      public boolean isSameNode(Node other)

      isSameNode.

      Specified by:
      isSameNode in interface Node
      Parameters:
      other - a Node object.
      Returns:
      a boolean.
    • lookupPrefix

      public String lookupPrefix(String namespaceURI)

      lookupPrefix.

      Specified by:
      lookupPrefix in interface Node
      Parameters:
      namespaceURI - a String object.
      Returns:
      a String object.
    • isDefaultNamespace

      public boolean isDefaultNamespace(String namespaceURI)

      isDefaultNamespace.

      Specified by:
      isDefaultNamespace in interface Node
      Parameters:
      namespaceURI - a String object.
      Returns:
      a boolean.
    • lookupNamespaceURI

      public String lookupNamespaceURI(String prefix)

      lookupNamespaceURI.

      Specified by:
      lookupNamespaceURI in interface Node
      Parameters:
      prefix - a String object.
      Returns:
      a String object.
    • isEqualNode

      public boolean isEqualNode(Node arg)
      Returns whether node and otherNode have the same properties.
      Specified by:
      isEqualNode in interface Node
      Parameters:
      arg - a Node object.
      Returns:
      a boolean.
    • setUserData

      public Object setUserData(String key, Object data, UserDataHandler handler)

      setUserData.

      Specified by:
      setUserData in interface Node
      Parameters:
      key - a String object.
      data - a Object object.
      handler - a UserDataHandler object.
      Returns:
      a Object object.
    • getUserData

      public Object getUserData(String key)

      getUserData.

      Specified by:
      getUserData in interface Node
      Parameters:
      key - a String object.
      Returns:
      a Object object.
    • isIsConnected

      public boolean isIsConnected()
      Returns true if node is connected and false otherwise.
      Specified by:
      isIsConnected in interface Node
      Returns:
      a boolean.
    • getParentElement

      public HTMLElement getParentElement()
      Returns the parent element.
      Specified by:
      getParentElement in interface Node
      Returns:
      a HTMLElement object.
    • getRootNode

      public Node getRootNode()
      Returns node's root.
      Specified by:
      getRootNode in interface Node
      Returns:
      a Node object.
    • cloneNode

      public Node cloneNode()

      cloneNode.

      Specified by:
      cloneNode in interface Node
      Returns:
      a Node object.
    • setOwnerDocument

      public void setOwnerDocument(Document document)
      Description copied from interface: Node

      setOwnerDocument.

      Specified by:
      setOwnerDocument in interface Node
      Parameters:
      document - a Document object.
    • contains

      public boolean contains(Node other)
      Returns true if other is an inclusive descendant of node, and false otherwise.
      Specified by:
      contains in interface Node
      Parameters:
      other - a Node object.
      Returns:
      a boolean.
    • addEventListener

      public void addEventListener(String type, Function listener)

      addEventListener.

      Specified by:
      addEventListener in interface EventTarget
      Parameters:
      type - a String object.
      listener - a Function object.
    • addEventListener

      public void addEventListener(String type, Function listener, boolean useCapture)

      addEventListener.

      Specified by:
      addEventListener in interface EventTarget
      Parameters:
      type - a String object.
      listener - a Function object.
      useCapture - a boolean.
    • removeEventListener

      public void removeEventListener(String type, Function listener)

      removeEventListener.

      Specified by:
      removeEventListener in interface EventTarget
      Parameters:
      type - a String object.
      listener - a Function object.
    • removeEventListener

      public void removeEventListener(String type, Function listener, boolean useCapture)

      removeEventListener.

      Specified by:
      removeEventListener in interface EventTarget
      Parameters:
      type - a String object.
      listener - a Function object.
      useCapture - a boolean.
    • dispatchEvent

      public boolean dispatchEvent(Node element, Event evt)

      dispatchEvent.

      Specified by:
      dispatchEvent in interface EventTarget
      Parameters:
      element - a Node object.
      evt - a Event object.
      Returns:
      a boolean.
    • dispatchEvent

      public boolean dispatchEvent(Event evt) throws EventException
      Description copied from interface: EventTarget

      dispatchEvent.

      Specified by:
      dispatchEvent in interface EventTarget
      Parameters:
      evt - a Event object.
      Returns:
      a boolean.
      Throws:
      EventException - if any.