DOM::Document Class Reference
TheDocument
interface represents the entire HTML or XML document.
More...
#include <dom_doc.h>
Inheritance diagram for DOM::Document:

Public Methods | |
Document () | |
Document (bool) | |
Document (const Document &other) | |
Document (const Node &other) | |
Document & | operator= (const Node &other) |
Document & | operator= (const Document &other) |
~Document () | |
DocumentType | doctype () const |
DOMImplementation | implementation () const |
Element | documentElement () const |
Element | createElement (const DOMString &tagName) |
Element | createElementNS (const DOMString &namespaceURI, const DOMString &qualifiedName) |
DocumentFragment | createDocumentFragment () |
Text | createTextNode (const DOMString &data) |
Comment | createComment (const DOMString &data) |
CDATASection | createCDATASection (const DOMString &data) |
ProcessingInstruction | createProcessingInstruction (const DOMString &target, const DOMString &data) |
Attr | createAttribute (const DOMString &name) |
Attr | createAttributeNS (const DOMString &namespaceURI, const DOMString &qualifiedName) |
EntityReference | createEntityReference (const DOMString &name) |
Element | getElementById (const DOMString &elementId) const |
NodeList | getElementsByTagName (const DOMString &tagname) |
NodeList | getElementsByTagNameNS (const DOMString &namespaceURI, const DOMString &localName) |
Node | importNode (const Node &importedNode, bool deep) |
bool | isHTMLDocument () const |
Range | createRange () |
NodeIterator | createNodeIterator (Node root, unsigned long whatToShow, NodeFilter filter, bool entityReferenceExpansion) |
TreeWalker | createTreeWalker (Node root, unsigned long whatToShow, NodeFilter filter, bool entityReferenceExpansion) |
Event | createEvent (const DOMString &eventType) |
AbstractView | defaultView () const |
StyleSheetList | styleSheets () const |
DOMString | preferredStylesheetSet () |
DOMString | selectedStylesheetSet () |
void | setSelectedStylesheetSet (const DOMString &aString) |
KHTMLView * | view () const |
CSSStyleDeclaration | getOverrideStyle (const Element &elt, const DOMString &pseudoElt) |
bool | async () const |
void | setAsync (bool) |
void | abort () |
void | load (const DOMString &uri) |
void | loadXML (const DOMString &source) |
bool | designMode () const |
void | setDesignMode (bool enable) |
DOMString | completeURL (const DOMString &url) |
void | updateRendering () |
Protected Methods | |
Document (DocumentImpl *i) | |
Friends | |
class | ::KHTMLView |
class | ::KHTMLPart |
class | AbstractView |
class | DOMImplementation |
class | HTMLFrameElement |
class | HTMLIFrameElement |
class | HTMLObjectElement |
class | Node |
Detailed Description
TheDocument
interface represents the entire HTML or XML document.
Conceptually, it is the root of the document tree, and provides the primary access to the document's data.
Since elements, text nodes, comments, processing instructions, etc. cannot exist outside the context of a Document
, the Document
interface also contains the factory methods needed to create these objects. The Node
objects created have a ownerDocument
attribute which associates them with the Document
within whose context they were created.
Definition at line 245 of file dom_doc.h.
Constructor & Destructor Documentation
|
don't create an implementation if false use at own risk.
Definition at line 162 of file dom_doc.cpp. |
Member Function Documentation
|
The Document Type Declaration (see
For HTML documents as well as XML documents without a document type declaration this returns Definition at line 210 of file dom_doc.cpp. |
|
The A DOM application may use objects from multiple implementations. Definition at line 216 of file dom_doc.cpp. |
|
This is a convenience attribute that allows direct access to the child node that is the root element of the document. For HTML documents, this is the element with the tagName "HTML". Definition at line 222 of file dom_doc.cpp. |
|
Creates an element of the type specified. Note that the instance returned implements the Element interface, so attributes can be specified directly on the returned object.
Definition at line 228 of file dom_doc.cpp. |
|
Introduced in DOM Level 2 Creates an element of the given qualified name and namespace URI.
Definition at line 240 of file dom_doc.cpp. |
|
Creates an empty
Definition at line 252 of file dom_doc.cpp. |
|
Creates a
Definition at line 258 of file dom_doc.cpp. References DOM::DOMString::implementation(). |
|
Creates a
Definition at line 264 of file dom_doc.cpp. References DOM::DOMString::implementation(). |
|
Creates a
Definition at line 270 of file dom_doc.cpp. References DOM::DOMString::implementation(). |
|
Creates a
Definition at line 277 of file dom_doc.cpp. References DOM::DOMString::implementation(). |
|
Creates an
Note that the
Definition at line 283 of file dom_doc.cpp. References DOM::DOMString::isNull(). |
|
Introduced in DOM Level 2 Creates an attribute of the given qualified name and namespace URI. HTML-only DOM implementations do not need to implement this method.
Definition at line 294 of file dom_doc.cpp. References DOM::DOMString::isNull(). |
|
Creates an EntityReference object.
Definition at line 305 of file dom_doc.cpp. |
|
Moved from HTMLDocument in DOM Level 2 Returns the Element whose
If no such element exists, returns
Definition at line 311 of file dom_doc.cpp. |
|
No Exceptions.
Returns a
Definition at line 317 of file dom_doc.cpp. References DOM::DOMString::implementation(). |
|
Introduced in DOM Level 2 No Exceptions. Returns a NodeList of all the Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the Document tree.
Definition at line 328 of file dom_doc.cpp. |
|
Introduced in DOM Level 2. Imports a node from another document to this document. The returned node has no parent; (parentNode is null). The source node is not altered or removed from the original document; this method creates a new copy of the source node. For all nodes, importing a node creates a node object owned by the importing document, with attribute values identical to the source node's nodeName and nodeType, plus the attributes related to namespaces (prefix, localName, and namespaceURI). As in the cloneNode operation on a Node, the source node is not altered. Additional information is copied as appropriate to the nodeType, attempting to mirror the behavior expected if a fragment of XML or HTML source was copied from one document to another, recognizing that the two documents may have different DTDs in the XML case. The following list describes the specifics for each type of node. ATTRIBUTE_NODE The ownerElement attribute is set to null and the specified flag is set to true on the generated Attr. The descendants of the source Attr are recursively imported and the resulting nodes reassembled to form the corresponding subtree. Note that the deep parameter has no effect on Attr nodes; they always carry their children with them when imported. DOCUMENT_FRAGMENT_NODE If the deep option was set to true, the descendants of the source element are recursively imported and the resulting nodes reassembled to form the corresponding subtree. Otherwise, this simply generates an empty DocumentFragment. DOCUMENT_NODE Document nodes cannot be imported. DOCUMENT_TYPE_NODE DocumentType nodes cannot be imported. ELEMENT_NODE Specified attribute nodes of the source element are imported, and the generated Attr nodes are attached to the generated Element. Default attributes are not copied, though if the document being imported into defines default attributes for this element name, those are assigned. If the importNode deep parameter was set to true, the descendants of the source element are recursively imported and the resulting nodes reassembled to form the corresponding subtree. ENTITY_NODE Entity nodes can be imported, however in the current release of the DOM the DocumentType is readonly. Ability to add these imported nodes to a DocumentType will be considered for addition to a future release of the DOM. On import, the publicId, systemId, and notationName attributes are copied. If a deep import is requested, the descendants of the the source Entity are recursively imported and the resulting nodes reassembled to form the corresponding subtree. ENTITY_REFERENCE_NODE Only the EntityReference itself is copied, even if a deep import is requested, since the source and destination documents might have defined the entity differently. If the document being imported into provides a definition for this entity name, its value is assigned. NOTATION_NODE Notation nodes can be imported, however in the current release of the DOM the DocumentType is readonly. Ability to add these imported nodes to a DocumentType will be considered for addition to a future release of the DOM. On import, the publicId and systemId attributes are copied. Note that the deep parameter has no effect on Notation nodes since they never have any children. PROCESSING_INSTRUCTION_NODE The imported node copies its target and data values from those of the source node. TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE These three types of nodes inheriting from CharacterData copy their data and length attributes from those of the source node.
Definition at line 334 of file dom_doc.cpp. References DOM::Node::handle(). |
|
Introduced in DOM Level 2 This method is from the DocumentRange interface.
Definition at line 352 of file dom_doc.cpp. Referenced by KHTMLPart::selection(). |
|
Introduced in DOM Level 2 This method is from the DocumentTraversal interface. Create a new NodeIterator over the subtree rooted at the specified node.
Definition at line 358 of file dom_doc.cpp. References DOM::Node::handle(). |
|
Introduced in DOM Level 2 This method is from the DocumentTraversal interface. Create a new TreeWalker over the subtree rooted at the specified node.
Definition at line 372 of file dom_doc.cpp. References DOM::NodeFilter::handle(), and DOM::Node::handle(). |
|
Introduced in DOM Level 2 This method is from the DocumentEvent interface. The createEvent method is used in creating Events when it is either inconvenient or unnecessary for the user to create an Event themselves. In cases where the implementation provided Event is insufficient, users may supply their own Event implementations for use with the dispatchEvent method.
Definition at line 388 of file dom_doc.cpp. |
|
Introduced in DOM Level 2 This method is from the DocumentView interface. The default AbstractView for this Document, or null if none available. Definition at line 400 of file dom_doc.cpp. |
|
Introduced in DOM Level 2 This method is from the DocumentStyle interface. A list containing all the style sheets explicitly linked into or embedded in a document. For HTML documents, this includes external style sheets, included via the HTML LINK element, and inline STYLE elements. In XML, this includes external style sheets, included via style sheet processing instructions (see [XML-StyleSheet]). Definition at line 408 of file dom_doc.cpp. |
|
CSS3 mechanism for selecting alternate stylesheets using the DOM. Might change without further notice. Definition at line 416 of file dom_doc.cpp. |
|
Definition at line 441 of file dom_doc.cpp. |
|
Introduced in DOM Level 2 This method is from the DocumentCSS interface. This method is used to retrieve the override style declaration for a specified element and a specified pseudo-element.
Definition at line 448 of file dom_doc.cpp. References DOM::Node::handle(), and DOM::DOMString::implementation(). |
|
Introduced in DOM Level 3 This method is from the DocumentLS interface. Indicates whether the method DocumentLS.load() should be synchronous or asynchronous. When the async attribute is set to true the load method returns control to the caller before the document has completed loading. The default value of this attribute is true. Definition at line 460 of file dom_doc.cpp. |
|
Introduced in DOM Level 3 This method is from the DocumentLS interface. see async
Definition at line 468 of file dom_doc.cpp. |
|
Introduced in DOM Level 3 This method is from the DocumentLS interface. If the document is currently being loaded as a result of the method load being invoked the loading and parsing is immediately aborted. The possibly partial result of parsing the document is discarded and the document is cleared. Definition at line 476 of file dom_doc.cpp. |
|
Introduced in DOM Level 3 This method is from the DocumentLS interface. Replaces the content of the document with the result of parsing the given URI. Invoking this method will either block the caller or return to the caller immediately depending on the value of the async attribute. Once the document is fully loaded a "load" event (as defined in [DOM Level 3 Events], except that the Event.targetNode will be the document, not an element) will be dispatched on the document. If an error occurs, an implementation dependent "error" event will be dispatched on the document. If this method is called on a document that is currently loading, the current load is interrupted and the new URI load is initiated. When invoking this method the parameters used in the DOMParser interface are assumed to have their default values with the exception that the parameters "entities", "normalize-characters", "check-character-normalization" are set to "false". The result of a call to this method is the same the result of a call to DOMParser.parseWithContext with an input stream referencing the URI that was passed to this call, the document as the context node, and the action ACTION_REPLACE_CHILDREN.
Definition at line 485 of file dom_doc.cpp. |
|
Introduced in DOM Level 3 This method is from the DocumentLS interface. Replace the content of the document with the result of parsing the input string, this method is always synchronous. This method always parses from a DOMString, which means the data is always UTF-16. All other encoding information is ignored. The parameters used in the DOMParser interface are assumed to have their default values when invoking this method. The result of a call to this method is the same as the result of a call to DOMParser.parseWithContext with an input stream containing the string passed to this call, the document as the context node, and the action ACTION_REPLACE_CHILDREN.
Definition at line 493 of file dom_doc.cpp. |
|
not part of the official DOM. Documents are read-only by default, but they can be made editable by entering "design mode".
Definition at line 502 of file dom_doc.cpp. |
|
not part of the official DOM.
Definition at line 509 of file dom_doc.cpp. |
|
not part of the DOM. completes a given URL Definition at line 516 of file dom_doc.cpp. References DOM::DOMString::string(). |
|
not part of the DOM. Updates the rendered display after one or more changes to the DOM structure Definition at line 522 of file dom_doc.cpp. |
The documentation for this class was generated from the following files: