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


Public Member Functions | |
Document (bool) | |
don't create an implementation if false use at own risk | |
Document (const Document &other) | |
Document (const Node &other) | |
Document & | operator= (const Node &other) |
Document & | operator= (const Document &other) |
DocumentType | doctype () const |
The Document Type Declaration (see DocumentType ) associated with this document. | |
DOMImplementation | implementation () const |
The DOMImplementation object that handles this document. | |
Element | documentElement () const |
This is a convenience attribute that allows direct access to the child node that is the root element of the document. | |
Element | createElement (const DOMString &tagName) |
Creates an element of the type specified. | |
Element | createElementNS (const DOMString &namespaceURI, const DOMString &qualifiedName) |
Introduced in DOM Level 2 Creates an element of the given qualified name and namespace URI. | |
DocumentFragment | createDocumentFragment () |
Creates an empty DocumentFragment object. | |
Text | createTextNode (const DOMString &data) |
Creates a Text node given the specified string. | |
Comment | createComment (const DOMString &data) |
Creates a Comment node given the specified string. | |
CDATASection | createCDATASection (const DOMString &data) |
Creates a CDATASection node whose value is the specified string. | |
ProcessingInstruction | createProcessingInstruction (const DOMString &target, const DOMString &data) |
Creates a ProcessingInstruction node given the specified name and data strings. | |
Attr | createAttribute (const DOMString &name) |
Creates an Attr of the given name. | |
Attr | createAttributeNS (const DOMString &namespaceURI, const DOMString &qualifiedName) |
Introduced in DOM Level 2 Creates an attribute of the given qualified name and namespace URI. | |
EntityReference | createEntityReference (const DOMString &name) |
Creates an EntityReference object. | |
Element | getElementById (const DOMString &elementId) const |
Moved from HTMLDocument in DOM Level 2 Returns the Element whose id is given by elementId. | |
NodeList | getElementsByTagName (const DOMString &tagname) |
No Exceptions. | |
NodeList | getElementsByTagNameNS (const DOMString &namespaceURI, const DOMString &localName) |
Introduced in DOM Level 2 No Exceptions. | |
Node | importNode (const Node &importedNode, bool deep) |
Introduced in DOM Level 2. | |
bool | isHTMLDocument () const |
Range | createRange () |
Introduced in DOM Level 2 This method is from the DocumentRange interface. | |
NodeIterator | createNodeIterator (Node root, unsigned long whatToShow, NodeFilter filter, bool entityReferenceExpansion) |
Introduced in DOM Level 2 This method is from the DocumentTraversal interface. | |
TreeWalker | createTreeWalker (Node root, unsigned long whatToShow, NodeFilter filter, bool entityReferenceExpansion) |
Introduced in DOM Level 2 This method is from the DocumentTraversal interface. | |
Event | createEvent (const DOMString &eventType) |
Introduced in DOM Level 2 This method is from the DocumentEvent interface. | |
AbstractView | defaultView () const |
Introduced in DOM Level 2 This method is from the DocumentView interface. | |
StyleSheetList | styleSheets () const |
Introduced in DOM Level 2 This method is from the DocumentStyle interface. | |
KHTMLView * | view () const |
CSSStyleDeclaration | getOverrideStyle (const Element &elt, const DOMString &pseudoElt) |
Introduced in DOM Level 2 This method is from the DocumentCSS interface. | |
DOMString | completeURL (const DOMString &url) |
not part of the DOM | |
Protected Member Functions | |
Document (DocumentImpl *i) | |
Friends | |
class | ::KHTMLView |
class | ::KHTMLPart |
class | AbstractView |
class | DOMImplementation |
class | HTMLFrameElement |
class | HTMLIFrameElement |
class | HTMLObjectElement |
class | Node |
Detailed Description
The Document
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 244 of file dom_doc.h.
Constructor & Destructor Documentation
|
don't create an implementation if false use at own risk
Definition at line 163 of file dom_doc.cpp. References KStdAction::create(). |
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 211 of file dom_doc.cpp. |
|
The A DOM application may use objects from multiple implementations. Definition at line 217 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 223 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 229 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 251 of file dom_doc.cpp. |
|
Creates a
Definition at line 257 of file dom_doc.cpp. References DOM::DOMString::implementation(). |
|
Creates a
Definition at line 263 of file dom_doc.cpp. References DOM::DOMString::implementation(). |
|
Creates a
Definition at line 269 of file dom_doc.cpp. References DOM::DOMString::implementation(). |
|
Creates a
Definition at line 276 of file dom_doc.cpp. References DOM::DOMString::implementation(). |
|
Creates an
Note that the
Definition at line 282 of file dom_doc.cpp. References createAttributeNS(), and KStdAccel::name(). |
|
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 287 of file dom_doc.cpp. References DOM::DOMString::copy(), DOM::DOMString::find(), DOM::Node::handle(), DOM::DOMString::implementation(), DOM::DOMString::isNull(), DOM::Node::localName(), DOM::Node::prefix(), DOM::DOMString::remove(), and DOM::DOMString::truncate(). Referenced by createAttribute(). |
|
Creates an EntityReference object.
Definition at line 314 of file dom_doc.cpp. References KStdAccel::name(). |
|
Moved from HTMLDocument in DOM Level 2 Returns the Element whose
If no such element exists, returns
Definition at line 320 of file dom_doc.cpp. |
|
No Exceptions.
Returns a
Definition at line 326 of file dom_doc.cpp. References getElementsByTagNameNS(), and 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 333 of file dom_doc.cpp. References DOM::DOMString::implementation(). Referenced by getElementsByTagName(). |
|
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 340 of file dom_doc.cpp. References DOM::Node::handle(). |
|
Introduced in DOM Level 2 This method is from the DocumentRange interface.
Definition at line 358 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 364 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 378 of file dom_doc.cpp. |
|
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 385 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 397 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 405 of file dom_doc.cpp. |
|
Definition at line 414 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 427 of file dom_doc.cpp. References DOM::Node::handle(), and DOM::DOMString::implementation(). |
|
not part of the DOM completes a given URL Definition at line 421 of file dom_doc.cpp. References DOM::DOMString::string(). Referenced by DOM::HTMLImageElement::src(), and DOM::HTMLInputElement::src(). |
The documentation for this class was generated from the following files: