All Implemented Interfaces:
Cloneable
All Known Implementing Classes:
DOMAttribute, FlyweightAttribute, AbstractText, FlyweightProcessingInstruction, BaseElement, DOMComment, Document, Entity, DefaultAttribute, AbstractCharacterData, DefaultCDATA, DefaultText, DOMDocument, AbstractComment, Branch, Text, NonLazyElement, AbstractCDATA, AbstractEntity, FlyweightCDATA, DatatypeElement, DOMDocumentType, DOMCDATA, DefaultElement, DefaultDocumentType, DOMNamespace, FlyweightEntity, AbstractDocumentType, UserDataAttribute, Attribute, BeanAttribute, FlyweightText, DOMElement, AbstractProcessingInstruction, CharacterData, FlyweightComment, CDATA, Namespace, AbstractElement, AbstractDocument, UserDataElement, BeanElement, Comment, DocumentType, AbstractNode, ProcessingInstruction, LElement, IndexedElement, DefaultDocument, DatatypeAttribute, DOMEntityReference, DefaultComment, DOMText, DefaultProcessingInstruction, AbstractAttribute, DefaultEntity, DefaultNamespace, AbstractBranch, DOMProcessingInstruction, Element
Node defines the polymorphic behavior for all XML nodes in a
dom4j tree.
A node can be output as its XML format, can be detached from its position in a document and can have XPath expressions evaluated on itself.
A node may optionally support the parent relationship and may be read only.
< - a href="mailto:jstrachan@apache.org">James Strachan $ - Revision: 1.31 $| Field Summary | ||
|---|---|---|
| short | ANY_NODE | Matches Element nodes |
| short | ELEMENT_NODE | Matches Element nodes |
| short | ATTRIBUTE_NODE | Matches elements nodes |
| short | TEXT_NODE | Matches elements nodes |
| short | CDATA_SECTION_NODE | Matches elements nodes |
| short | ENTITY_REFERENCE_NODE | Matches elements nodes |
| short | PROCESSING_INSTRUCTION_NODE | Matches ProcessingInstruction |
| short | COMMENT_NODE | Matches Comments nodes |
| short | DOCUMENT_NODE | Matches Document nodes |
| short | DOCUMENT_TYPE_NODE | Matches DocumentType nodes |
| short | NAMESPACE_NODE | Matchs a Namespace Node - NOTE this differs from DOM |
| short | UNKNOWN_NODE | Does not match any valid node |
| short | MAX_NODE_TYPE | The maximum number of node types for sizing purposes |
| Method from org.dom4j.Node Summary: |
|---|
| accept, asXML, asXPathResult, clone, createXPath, detach, getDocument, getName, getNodeType, getNodeTypeName, getParent, getPath, getPath, getStringValue, getText, getUniquePath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, setText, supportsParent, valueOf, write |
| Method from org.dom4j.Node Detail: |
|---|
|
|
|
|
|
Removes this node from its parent if there is one. If this node is the root element of a document then it is removed from the document as well. This method is useful if you want to remove a node from its source document and add it to another document. For example Node node = ...; Element someOtherElement = ...;
someOtherElement.add( node.detach() ); |
This method is an optional feature and may not be supported for all
|
|
|
|
This method is an optional feature and may not be supported for all
|
Returns the XPath expression which will return a node set containing the given node such as /a/b/@c. No indexing will be used to restrict the path if multiple elements with the same name occur on the path. |
|
|
Returns the text of this node. |
Returns the XPath expression which will return a nodeset of one node which is the current node. This method will use the XPath index operator to restrict the path if multiple elements with the same name occur on the path. |
Returns the relative unique XPath expression from the given context which will return a nodeset of one node which is the current node. This method will use the XPath index operator to restrict the path if multiple elements with the same name occur on the path. |
|
|
This method does not behave like the <xsl:if> element - if you want that behaviour, to evaluate if an XPath expression matches something, then you can use the following code to be equivalent... if ( node.selectSingleNode( "/some/path" ) != nulll ) |
|
|
|
|
|
|
This method should only be called from inside a |
Sets the text data of this node or this method will throw an
|
This method should only be called from inside an |
Sets the text data of this node or this method will throw an
|
Some XML tree implementations are singly linked and only support downward navigation through children relationships. The default case is that both parent and children relationships are supported though for memory and performance reasons the parent relationship may not be supported. |
|
|