Node in XML tree.
Constants
Methods
Add a processing instruction inside current node.
Returns the given attribute from this node.
| Returns |
The value of attribute, null if node is not an element,
empty string if attribute does not exist, or does not have any
value - specified or default. |
Returns the attributes of this node.
| Returns |
array of attributes for this node. Attributes are mapped
into array with their respective names. |
Returns list of child nodes of this node.
| Returns |
array of children for this node. Returns empty list if
node does not have any children. |
Returns list of child nodes with given name
| Returns |
array of children for this node. Returns empty list if
node does not have any children named name. |
Returns the data of instruction node.
| Returns |
data of instruction node |
Returns the owner document of this node.
| Returns |
the document where this node belongs to,
returns null is this node is already document node. |
Return the document type of document to which this node belongs to.
| Returns |
document type of document node |
Return the array of entities from document type node.
| Returns |
array of entities of document type node |
Returns first child node.
| Returns |
first child node, or null if node doesn't have any children |
Return localname, without namespace prefix (if any)
| Returns |
local name of node |
The namespace URI of this node, or null if it is unspecified.
Returns the next sibling of this node.
| Returns |
next sibling or null if there is no such node.
Next sibling is child of this node's parent that is immediately
next to this node. |
Returns the name of this node (with prefix, if any).
Returns the type of this node.
| Returns |
the type of node as an integer constant |
Returns the type of this node as string, which is one of
- "Text"
- "CDATASection"
- "Comment"
- "Attr"
- "Element"
- "DocumentType"
- "Entity"
- "EntityReference"
- "Notation"
- "ProcessingInstruction"
- "DocumentFragment"
- "Document"
Returns the value of this node.
| Returns |
the value of node |
Return the array of notations from document type node.
| Returns |
array of notations of document type node |
Returns the parent node of this node.
| Returns |
the parent node of this node, returns null
if this node does not have a parent. |
The namespace prefix of this node, or null if it is unspecified.
Returns the previous sibling of this node.
| Returns |
next sibling or null if there is no such node.
Previous sibling is child of this node's parent that is immediately
next to this node. |
Returns the public id of this node.
| Returns |
public id of document type, entity
and notation nodes |
Gets the root element.
| Returns |
the root node of document where this node belongs to |
Returns the system id of this node.
| Returns |
system id of document type, entity
and notation nodes |
Returns the target of instruction node.
| Returns |
target of instruction node |
This returns the textual content directly held under this element.
This will include all text within this single element, including
whitespace and CDATA sections if they exist. It's essentially the
concatenation of all Text and CDATA nodes returned by getContent().
The call does not recurse into child elements.
If no textual value exists for the element, null is returned.
This returns the textual content of this element with all surrounding whitespace removed.
Trimmed values are returned as list of string. Zero length text elements are not returned.
If no textual value exists for the element, or if only whitespace exists, empty list is
returned.
Example. ' foo bar
some text' would return ('foo bar',
'som text')
Note. only surrounding whitespace is returned!
This returns the textual content of this element with all surrounding whitespace removed.
If no textual value exists for the element, or if only whitespace exists, null
is returned.
Gets the contained tree in XML presentation.
Checks if this node has attributes.
| Returns |
true if node has attributes |
Checks if this node has children.
| Returns |
true if node has children |
Outputs the contained tree in XML presentation to given output stream.
Removes all child nodes with given name/namespaceURI, or all children
if name isn't given.
| Returns |
returns this node |
Operators
Returns the number of childs nodes of this node.
Returns the iterator of child nodes of this node.