Save This Page
Home » dom4j-1.6.1 » org.dom4j » [javadoc | source]
org.dom4j
public interface: Document [javadoc | source]

All Implemented Interfaces:
    Branch

All Known Implementing Classes:
    DOMDocument, AbstractDocument, DefaultDocument

Document defines an XML Document.

Method from org.dom4j.Document Summary:
addComment,   addDocType,   addProcessingInstruction,   addProcessingInstruction,   getDocType,   getEntityResolver,   getRootElement,   getXMLEncoding,   setDocType,   setEntityResolver,   setRootElement,   setXMLEncoding
Method from org.dom4j.Document Detail:
 public Document addComment(String comment)
    Adds a new Comment node with the given text to this branch.
 public Document addDocType(String name,
    String publicId,
    String systemId)
    Adds a DOCTYPE declaration to this document
 public Document addProcessingInstruction(String target,
    String text)
    Adds a processing instruction for the given target
 public Document addProcessingInstruction(String target,
    Map data)
    Adds a processing instruction for the given target
 public DocumentType getDocType()
    DOCUMENT ME!
 public EntityResolver getEntityResolver()
    DOCUMENT ME!
 public Element getRootElement()
    Returns the root Element for this document.
 public 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.

    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.

 public  void setDocType(DocumentType docType)
    Sets the DocumentType property
 public  void setEntityResolver(EntityResolver entityResolver)
    Sets the EntityResolver used to find resolve URIs such as for DTDs, or XML Schema documents
 public  void setRootElement(Element rootElement)
    Sets the root element for this document
 public  void setXMLEncoding(String encoding)
    Sets the encoding of this document as it will appear in the XML declaration part of the document.