Class XPathNamespaceImpl
- All Implemented Interfaces:
EventTarget
,Node
,XPathNamespace
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.
-
Field Summary
Fields inherited from interface org.loboevolution.html.node.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NONE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Fields inherited from interface org.loboevolution.html.xpath.XPathNamespace
XPATH_NAMESPACE_NODE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEventListener
(String type, Function listener) addEventListener.void
addEventListener
(String type, Function listener, boolean useCapture) addEventListener.appendChild
(Node arg0) appendChild.cloneNode.cloneNode
(boolean arg0) Returns a copy of node.short
compareDocumentPosition
(Node other) compareDocumentPosition.boolean
Returns true if other is an inclusive descendant of node, and false otherwise.boolean
dispatchEvent
(Event evt) dispatchEvent.boolean
dispatchEvent
(Node element, Event evt) dispatchEvent.getAttributes.Returns node's node document's document base URL.Returns the children.getFeature
(String name, String version) Returns the first child.Returns the last child.getLocalName.getNamespaceURI.Returns the next sibling.Returns a string appropriate for the type of node.int
Returns the type of node.getNodeValue.Returns the node document.The Element on which the namespace was in scope when it was requested.Returns the parent element.Returns the parent.Returns prefix.Returns the previous sibling.Returns node's root.getTextContent.getUserData
(String key) getUserData.boolean
Returns true if element has attributes, and false otherwise.boolean
Returns whether node has children.insertBefore
(Node arg0, Node arg1) insertBefore.boolean
isDefaultNamespace
(String namespaceURI) isDefaultNamespace.boolean
isEqualNode
(Node arg) Returns whether node and otherNode have the same properties.boolean
Returns true if node is connected and false otherwise.boolean
isSameNode
(Node other) isSameNode.boolean
isSupported
(String xml, String s) lookupNamespaceURI
(String prefix) lookupNamespaceURI.lookupPrefix
(String namespaceURI) lookupPrefix.void
Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.prepend.prependChild
(Node newChild) prependChild.removeChild
(Node arg0) removeChild.void
removeEventListener
(String type, Function listener) removeEventListener.void
removeEventListener
(String type, Function listener, boolean useCapture) removeEventListener.replaceChild
(Node arg0, Node arg1) replaceChild.void
setNodeValue
(String arg0) setNodeValue.void
setOwnerDocument
(Document document) setOwnerDocument.void
setPrefix.void
setTextContent
(String textContent) setTextContent.setUserData
(String key, Object data, UserDataHandler handler) setUserData.
-
Method Details
-
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 interfaceXPathNamespace
- Returns:
- a
Node
object.
-
getNodeName
Returns a string appropriate for the type of node.- Specified by:
getNodeName
in interfaceNode
- Returns:
- a
String
object.
-
getNodeValue
getNodeValue.
- Specified by:
getNodeValue
in interfaceNode
- Returns:
- a
String
object.
-
setNodeValue
setNodeValue.
- Specified by:
setNodeValue
in interfaceNode
- Parameters:
arg0
- aString
object.
-
getNodeType
public int getNodeType()Returns the type of node.- Specified by:
getNodeType
in interfaceNode
- Returns:
- a
Integer
object.
-
getParentNode
Returns the parent.- Specified by:
getParentNode
in interfaceNode
- Returns:
- a
Node
object.
-
getChildNodes
Returns the children.- Specified by:
getChildNodes
in interfaceNode
- Returns:
- a
NodeList
object.
-
getFirstChild
Returns the first child.- Specified by:
getFirstChild
in interfaceNode
- Returns:
- a
Node
object.
-
getLastChild
Returns the last child.- Specified by:
getLastChild
in interfaceNode
- Returns:
- a
Node
object.
-
getPreviousSibling
Returns the previous sibling.- Specified by:
getPreviousSibling
in interfaceNode
- Returns:
- a
Node
object.
-
getNextSibling
Returns the next sibling.- Specified by:
getNextSibling
in interfaceNode
- Returns:
- a
Node
object.
-
getOwnerDocument
Returns the node document. Returns null for documents.- Specified by:
getOwnerDocument
in interfaceNode
- Returns:
- a
Document
object.
-
insertBefore
insertBefore.
- Specified by:
insertBefore
in interfaceNode
- Parameters:
arg0
- aNode
object.arg1
- aNode
object.- Returns:
- a
Node
object.
-
replaceChild
replaceChild.
- Specified by:
replaceChild
in interfaceNode
- Parameters:
arg0
- aNode
object.arg1
- aNode
object.- Returns:
- a
Node
object.
-
removeChild
removeChild.
- Specified by:
removeChild
in interfaceNode
- Parameters:
arg0
- aNode
object.- Returns:
- a
Node
object.
-
appendChild
appendChild.
- Specified by:
appendChild
in interfaceNode
- Parameters:
arg0
- aNode
object.- Returns:
- a
Node
object.
-
prependChild
prependChild.
- Specified by:
prependChild
in interfaceNode
- Parameters:
newChild
- aNode
object.- Returns:
- a
Node
object.
-
prepend
prepend.
-
hasChildNodes
public boolean hasChildNodes()Returns whether node has children.- Specified by:
hasChildNodes
in interfaceNode
- Returns:
- a boolean.
-
cloneNode
Returns a copy of node. If deep is true, the copy also includes the node's descendants. -
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. -
getNamespaceURI
getNamespaceURI.
- Specified by:
getNamespaceURI
in interfaceNode
- Returns:
- a
String
object.
-
getPrefix
Returns prefix. -
setPrefix
setPrefix.
-
getLocalName
getLocalName.
- Specified by:
getLocalName
in interfaceNode
- Returns:
- a
String
object.
-
getBaseURI
Returns node's node document's document base URL.- Specified by:
getBaseURI
in interfaceNode
- Returns:
- a
String
object.
-
compareDocumentPosition
compareDocumentPosition.
- Specified by:
compareDocumentPosition
in interfaceNode
- Parameters:
other
- aNode
object.- Returns:
- a short.
-
isSupported
- Specified by:
isSupported
in interfaceNode
-
hasAttributes
public boolean hasAttributes()Description copied from interface:Node
Returns true if element has attributes, and false otherwise.- Specified by:
hasAttributes
in interfaceNode
- Returns:
- a boolean.
-
getFeature
- Specified by:
getFeature
in interfaceNode
-
getAttributes
Description copied from interface:Node
getAttributes.
- Specified by:
getAttributes
in interfaceNode
- Returns:
- a
NamedNodeMap
object.
-
getTextContent
getTextContent.
- Specified by:
getTextContent
in interfaceNode
- Returns:
- a
String
object.
-
setTextContent
setTextContent.
- Specified by:
setTextContent
in interfaceNode
- Parameters:
textContent
- aString
object.
-
isSameNode
isSameNode.
- Specified by:
isSameNode
in interfaceNode
- Parameters:
other
- aNode
object.- Returns:
- a boolean.
-
lookupPrefix
lookupPrefix.
- Specified by:
lookupPrefix
in interfaceNode
- Parameters:
namespaceURI
- aString
object.- Returns:
- a
String
object.
-
isDefaultNamespace
isDefaultNamespace.
- Specified by:
isDefaultNamespace
in interfaceNode
- Parameters:
namespaceURI
- aString
object.- Returns:
- a boolean.
-
lookupNamespaceURI
lookupNamespaceURI.
- Specified by:
lookupNamespaceURI
in interfaceNode
- Parameters:
prefix
- aString
object.- Returns:
- a
String
object.
-
isEqualNode
Returns whether node and otherNode have the same properties.- Specified by:
isEqualNode
in interfaceNode
- Parameters:
arg
- aNode
object.- Returns:
- a boolean.
-
setUserData
setUserData.
- Specified by:
setUserData
in interfaceNode
- Parameters:
key
- aString
object.data
- aObject
object.handler
- aUserDataHandler
object.- Returns:
- a
Object
object.
-
getUserData
getUserData.
- Specified by:
getUserData
in interfaceNode
- Parameters:
key
- aString
object.- Returns:
- a
Object
object.
-
isIsConnected
public boolean isIsConnected()Returns true if node is connected and false otherwise.- Specified by:
isIsConnected
in interfaceNode
- Returns:
- a boolean.
-
getParentElement
Returns the parent element.- Specified by:
getParentElement
in interfaceNode
- Returns:
- a
HTMLElement
object.
-
getRootNode
Returns node's root.- Specified by:
getRootNode
in interfaceNode
- Returns:
- a
Node
object.
-
cloneNode
cloneNode.
-
setOwnerDocument
Description copied from interface:Node
setOwnerDocument.
- Specified by:
setOwnerDocument
in interfaceNode
- Parameters:
document
- aDocument
object.
-
contains
Returns true if other is an inclusive descendant of node, and false otherwise. -
addEventListener
addEventListener.
- Specified by:
addEventListener
in interfaceEventTarget
- Parameters:
type
- aString
object.listener
- aFunction
object.
-
addEventListener
addEventListener.
- Specified by:
addEventListener
in interfaceEventTarget
- Parameters:
type
- aString
object.listener
- aFunction
object.useCapture
- a boolean.
-
removeEventListener
removeEventListener.
- Specified by:
removeEventListener
in interfaceEventTarget
- Parameters:
type
- aString
object.listener
- aFunction
object.
-
removeEventListener
removeEventListener.
- Specified by:
removeEventListener
in interfaceEventTarget
- Parameters:
type
- aString
object.listener
- aFunction
object.useCapture
- a boolean.
-
dispatchEvent
dispatchEvent.
- Specified by:
dispatchEvent
in interfaceEventTarget
- Parameters:
element
- aNode
object.evt
- aEvent
object.- Returns:
- a boolean.
-
dispatchEvent
Description copied from interface:EventTarget
dispatchEvent.
- Specified by:
dispatchEvent
in interfaceEventTarget
- Parameters:
evt
- aEvent
object.- Returns:
- a boolean.
- Throws:
EventException
- if any.
-