|
|
The <code> Document </code> 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 <code> Document </code> , the <code> Document </code> interface also contains the factory methods needed to create these objects. The <code> Node </code> objects created have a <code> ownerDocument </code> attribute which associates them with the <code> Document </code> within whose context they were created.
Document ()
| Document |
Document (bool)
| Document |
don't create an implementation if false use at own risk
Document (const Document &other)
| Document |
Document (const Node &other)
| Document |
Document & operator = (const Node &other)
| operator = |
Reimplemented from Node.
Document & operator = (const Document &other)
| operator = |
Reimplemented from Node.
~Document ()
| ~Document |
DocumentType doctype ()
| doctype |
[const]
The Document Type Declaration (see <code> DocumentType </code> ) associated with this document. For HTML documents as well as XML documents without a document type declaration this returns <code> null </code> . The DOM Level 1 does not support editing the Document Type Declaration, therefore <code> docType </code> cannot be altered in any way.
DOMImplementation implementation ()
| implementation |
[const]
The <code> DOMImplementation </code> object that handles this document. A DOM application may use objects from multiple implementations.
Element documentElement ()
| documentElement |
[const]
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".
Element createElement ( const DOMString &tagName )
| createElement |
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.
Parameters:
tagName | The name of the element type to instantiate. For XML, this is case-sensitive. For HTML, the <code> tagName </code> parameter may be provided in any case, but it must be mapped to the canonical uppercase form by the DOM implementation. |
Returns: A new <code> Element </code> object.
Throws: DOMException, INVALID_CHARACTER_ERR:, Raised, if, the, specified, name, contains, an, invalid, character.
Element createElementNS ( const DOMString &namespaceURI,
const DOMString &qualifiedName )
| createElementNS |
Introduced in DOM Level 2 Creates an element of the given qualified name and namespace URI.
Parameters:
namespaceURI | The namespace URI of the element to create. |
qualifiedName | The qualified name of the element type to instantiate. |
Returns: A new Element object with the following attributes:
Throws: INVALID_CHARACTER_ERR, Raised, if, the, specified, qualified, name, contains, an, illegal, character., NAMESPACE_ERR, Raised, if, the, qualifiedName, is, malformed, if, the, qualifiedName, has, a, prefix, and, the, namespaceURI, is, null, or, if, the, qualifiedName, has, a, prefix, that, is, "xml", and, the, namespaceURI, is, different, from, "http://www.w3.org/XML/1998/namespace"
DocumentFragment createDocumentFragment ( )
| createDocumentFragment |
Creates an empty <code> DocumentFragment </code> object.
Returns: A new <code> DocumentFragment </code> .
Text createTextNode ( const DOMString &data )
| createTextNode |
Creates a <code> Text </code> node given the specified string.
Parameters:
data | The data for the node. |
Returns: The new <code> Text </code> object.
Comment createComment ( const DOMString &data )
| createComment |
Creates a <code> Comment </code> node given the specified string.
Parameters:
data | The data for the node. |
Returns: The new <code> Comment </code> object.
CDATASection createCDATASection ( const DOMString &data )
| createCDATASection |
Creates a <code> CDATASection </code> node whose value is the specified string.
Parameters:
data | The data for the <code> CDATASection </code> contents. |
Returns: The new <code> CDATASection </code> object.
Throws: DOMException, NOT_SUPPORTED_ERR:, Raised, if, this, document, is, an, HTML, document.
ProcessingInstruction createProcessingInstruction ( const DOMString &target, const DOMString &data )
| createProcessingInstruction |
Creates a <code> ProcessingInstruction </code> node given the specified name and data strings.
NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
Parameters:
target | The target part of the processing instruction. |
data | The data for the node. |
Returns: The new <code> ProcessingInstruction </code> object.
Throws: DOMException, INVALID_CHARACTER_ERR:, Raised, if, an, invalid, character, is, specified.
Attr createAttribute ( const DOMString &name )
| createAttribute |
Creates an <code> Attr </code> of the given name. Note that the <code> Attr </code> instance can then be set on an <code> Element </code> using the <code> setAttribute </code> method.
Parameters:
name | The name of the attribute. |
Returns: A new <code> Attr </code> object.
Throws: DOMException, INVALID_CHARACTER_ERR:, Raised, if, the, specified, name, contains, an, invalid, character.
Attr createAttributeNS ( const DOMString &namespaceURI,
const DOMString &qualifiedName )
| createAttributeNS |
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.
Parameters:
namespaceURI | The namespace URI of the attribute to create. |
qualifiedName | The qualified name of the attribute to instantiate. |
Returns: A new Attr object with the following attributes: Node.nodeName - qualifiedName Node.namespaceURI - namespaceURI Node.prefix - prefix, extracted from qualifiedName, or null if there is no prefix Node.localName - local name, extracted from qualifiedName Attr.name - qualifiedName Node.nodeValue - the empty string
Throws: INVALID_CHARACTER_ERR, Raised, if, the, specified, qualified, name, contains, an, illegal, character., NAMESPACE_ERR, Raised, if, the, qualifiedName, is, malformed, if, the, qualifiedName, has, a, prefix, and, the, namespaceURI, is, null, if, the, qualifiedName, has, a, prefix, that, is, "xml", and, the, namespaceURI, is, different, from, "http://www.w3.org/XML/1998/namespace", or, if, the, qualifiedName, is, "xmlns", and, the, namespaceURI, is, different, from, "http://www.w3.org/2000/xmlns/".
EntityReference createEntityReference ( const DOMString &name )
| createEntityReference |
Creates an EntityReference object.
NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
Parameters:
name | The name of the entity to reference. |
Returns: The new <code> EntityReference </code> object.
Throws: DOMException, INVALID_CHARACTER_ERR:, Raised, if, the, specified, name, contains, an, invalid, character.
NodeList getElementsByTagName ( const DOMString &tagname )
| getElementsByTagName |
Returns a <code> NodeList </code> of all the <code> Element </code> s with a given tag name in the order in which they would be encountered in a preorder traversal of the <code> Document </code> tree.
Parameters:
tagname | The name of the tag to match on. The special value "*" matches all tags. |
Returns: A new <code> NodeList </code> object containing all the matched <code> Element </code> s.
bool isHTMLDocument ()
| isHTMLDocument |
[const]
not part of the DOM
Range createRange ()
| createRange |
Introduced in DOM Level 2 This method is from the DocumentRange interface
Returns: Range The initial state of the Range returned from this method is such that both of its boundary-points are positioned at the beginning of the corresponding Document, before any content. The Range returned can only be used to select content associated with this Document, or with DocumentFragments and Attrs for which this Document is the ownerDocument.
NodeIterator createNodeIterator (Node root, unsigned long whatToShow,
NodeFilter filter, bool entityReferenceExpansion)
| createNodeIterator |
Introduced in DOM Level 2 This method is from the DocumentTraversal interface
Create a new NodeIterator over the subtree rooted at the specified node.
Parameters:
root | The node which will be iterated together with its children. The iterator is initially positioned just before this node. The whatToShow flags and the filter, if any, are not considered when setting this position. The root must not be null. |
whatToShow | This flag specifies which node types may appear in the logical view of the tree presented by the iterator. See the description of NodeFilter for the set of possible SHOW_ values. These flags can be combined using OR. |
filter | The NodeFilter to be used with this TreeWalker, or null to indicate no filter. |
entityReferenceExpansion | The value of this flag determines whether entity reference nodes are expanded. |
Returns: NodeIterator The newly created NodeIterator.
Throws: DOMException, NOT_SUPPORTED_ERR:, Raised, if, the, specified, root, is, null.
TreeWalker createTreeWalker (Node root, unsigned long whatToShow, NodeFilter filter,
bool entityReferenceExpansion)
| createTreeWalker |
Introduced in DOM Level 2 This method is from the DocumentTraversal interface
Create a new TreeWalker over the subtree rooted at the specified node.
Parameters:
root | The node which will serve as the root for the TreeWalker. The whatToShow flags and the NodeFilter are not considered when setting this value; any node type will be accepted as the root. The currentNode of the TreeWalker is initialized to this node, whether or not it is visible. The root functions as a stopping point for traversal methods that look upward in the document structure, such as parentNode and nextNode. The root must not be null. |
whatToShow | This flag specifies which node types may appear in the logical view of the tree presented by the tree-walker. See the description of NodeFilter for the set of possible SHOW_ values. These flags can be combined using OR. |
filter | The NodeFilter to be used with this TreeWalker, or null to indicate no filter. |
entityReferenceExpansion | If this flag is false, the contents of EntityReference nodes are not presented in the logical view. |
Returns: The newly created TreeWalker.
Throws: DOMException, NOT_SUPPORTED_ERR:, Raised, if, the, specified, root, is, null.
Event createEvent (const DOMString &eventType)
| createEvent |
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.
Parameters:
eventType | The eventType parameter specifies the type of Event interface to be created. If the Event interface specified is supported by the implementation this method will return a new Event of the interface type requested. If the Event is to be dispatched via the dispatchEvent method the appropriate event init method must be called after creation in order to initialize the Event's values. As an example, a user wishing to synthesize some kind of UIEvent would call createEvent with the parameter "UIEvents". The initUIEvent method could then be called on the newly created UIEvent to set the specific type of UIEvent to be dispatched and set its context information. |
Returns: The newly created EventExceptions
Throws: DOMException, NOT_SUPPORTED_ERR:, Raised, if, the, implementation, does, not, support, the, type, of, Event, interface, requested
AbstractView defaultView ()
| defaultView |
[const]
Introduced in DOM Level 2 This method is from the DocumentView interface
The default AbstractView for this Document, or null if none available.
StyleSheetList styleSheets ()
| styleSheets |
[const]
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]).
KHTMLView * view ()
| view |
[const]
Returns: The KHTML view widget of this document.
CSSStyleDeclaration getOverrideStyle (const Element &elt, const DOMString &pseudoElt)
| getOverrideStyle |
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.
Parameters:
elt | The element whose style is to be modified. This parameter cannot be null. |
pseudoElt | The pseudo-element or null if none. |
Returns: The override style declaration.
Document ( DocumentImpl *i)
| Document |
[protected]
friend class Node | Node |
[protected]
Generated by: root@daffy.perf.redhat.com on Mon Jul 14 13:28:10 2003, using kdoc 2.0a53. |