Example usage for Java org.dom4j Document fields, constructors, methods, implement or subclass
The text is from its open source code.
void | add(Node node) Adds the given Node or throws IllegalAddException if the given node is not of a valid type. |
Document | addComment(String comment) Adds a new Comment node with the given text to this branch. |
Document | addDocType(String name, String publicId, String systemId) Adds a DOCTYPE declaration to this document |
Element | addElement(String name) Adds a new Element node with the given name to this branch and returns a reference to the new node. |
Element | addElement(String qualifiedName, String namespaceURI) Adds a new Element node with the given qualified name and namespace URI to this branch and returns a reference to the new node. |
Document | addProcessingInstruction(String target, String text) Adds a processing instruction for the given target |
Document | addProcessingInstruction(String target, Map Adds a processing instruction for the given target |
void | clearContent() Clears the content for this branch, removing any Node instances this branch may contain. |
List | content() Returns the content nodes of this branch as a backed List so that the content of this branch may be modified directly using the List interface. |
DocumentType | getDocType() DOCUMENT ME! |
EntityResolver | getEntityResolver() DOCUMENT ME! |
Element | getRootElement() Returns the root Element for this document. |
String | getXMLEncoding() Return the encoding of this document, as part of the XML declaration This is null when unspecified or when it is not known (such as when the Document was created in memory) or when the implementation does not support this operation. |
Node | node(int index) Returns the Node at the specified index position. |
int | nodeCount() Returns the number of Node instances that this branch contains. |
Iterator | nodeIterator() Returns an iterator through the content nodes of this branch |
void | normalize() Puts all Text nodes in the full depth of the sub-tree underneath this Node , including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes. |
List | processingInstructions() Returns a list of all the processing instructions in this branch. |
boolean | remove(Node node) Removes the given Node if the node is an immediate child of this branch. |
boolean | removeProcessingInstruction(String target) Removes the processing instruction for the given target if it exists |
void | setDocType(DocumentType docType) Sets the DocumentType property |
void | setProcessingInstructions(List Sets all the processing instructions for this branch |
void | setRootElement(Element rootElement) Sets the root element for this document |
void | setXMLEncoding(String encoding) Sets the encoding of this document as it will appear in the XML declaration part of the document. |