|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Document
defines an XML Document.
Field Summary |
Fields inherited from interface org.dom4j.Node |
ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE |
Method Summary | |
Document |
addComment(java.lang.String comment)
Adds a new Comment node with the given text to this branch. |
Document |
addDocType(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
Adds a DOCTYPE declaration to this document |
Document |
addProcessingInstruction(java.lang.String target,
java.util.Map data)
Adds a processing instruction for the given target |
Document |
addProcessingInstruction(java.lang.String target,
java.lang.String text)
Adds a processing instruction for the given target |
DocumentType |
getDocType()
|
EntityResolver |
getEntityResolver()
|
Element |
getRootElement()
Returns the root Element for this document. |
java.lang.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. |
void |
setDocType(DocumentType docType)
Sets the DocumentType property |
void |
setEntityResolver(EntityResolver entityResolver)
Sets the EntityResolver used to find resolve URIs such as for DTDs, or XML Schema documents |
void |
setRootElement(Element rootElement)
Sets the root element for this document |
Methods inherited from interface org.dom4j.Branch |
add, add, add, add, addElement, addElement, addElement, appendContent, clearContent, content, elementByID, indexOf, node, nodeCount, nodeIterator, normalize, processingInstruction, processingInstructions, processingInstructions, remove, remove, remove, remove, removeProcessingInstruction, setContent, setProcessingInstructions |
Methods inherited from interface org.dom4j.Node |
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 Detail |
public Element getRootElement()
Element
for this document.
public void setRootElement(Element rootElement)
rootElement
- the new root element for this documentpublic Document addComment(java.lang.String comment)
Comment
node with the given text to this branch.
comment
- is the text for the Comment
node.
Document
instance.public Document addProcessingInstruction(java.lang.String target, java.lang.String text)
target
- is the target of the processing instructiontext
- is the textual data (key/value pairs) of the processing instruction
Document
instance.public Document addProcessingInstruction(java.lang.String target, java.util.Map data)
target
- is the target of the processing instructiondata
- is a Map of the key / value pairs of the processing instruction
Document
instance.public Document addDocType(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
name
- is the name of the root elementpublicId
- is the PUBLIC URIsystemId
- is the SYSTEM URI
Document instance.
public DocumentType getDocType()
public void setDocType(DocumentType docType)
public EntityResolver getEntityResolver()
public void setEntityResolver(EntityResolver entityResolver)
public java.lang.String getXMLEncoding()
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.
The way this encoding is retrieved also depends on the way the XML
source is parsed. For instance, if the SAXReader is used and if the
underlying XMLReader implementation support the
org.xml.sax.ext.Locator2
interface, the result returned
by this method is specified by the getEncoding()
method of that interface.
null
if unknown.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |