org.kde.koala
public class Document extends Node
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.UNKNOWN: The Document
interface represents the entire HTML or XML document.
Constructor Summary | |
---|---|
protected | Document(Class dummy) |
Document() | |
Document(boolean arg1)
don't create an implementation if false
use at own risk | |
Document(Document other) | |
Document(Node other) |
Method Summary | |
---|---|
void | abort()
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. |
void | addStyleSheet(StyleSheet sheet)
Adds a new style sheet to the list of style sheets.
|
boolean | async()
Introduced in DOM Level 3
This method is from the DocumentLS interface
Indicates whether the method DocumentLS.load() should be synchronous or
asynchronous. |
String | completeURL(String url)
not part of the DOM
completes a given URL |
Attr | createAttribute(String name)
Creates an Attr of the given name. |
Attr | createAttributeNS(String namespaceURI, String qualifiedName)
Introduced in DOM Level 2
Creates an attribute of the given qualified name and namespace URI.
|
CDATASection | createCDATASection(String data)
Creates a CDATASection node whose value is the
specified string. |
Comment | createComment(String data)
Creates a Comment node given the specified
string. |
DocumentFragment | createDocumentFragment()
Creates an empty DocumentFragment object. |
Element | createElement(String tagName)
Creates an element of the type specified. |
Element | createElementNS(String namespaceURI, String qualifiedName)
Introduced in DOM Level 2
Creates an element of the given qualified name and namespace URI. |
EntityReference | createEntityReference(String name)
Creates an EntityReference object. |
Event | createEvent(String eventType)
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.
|
NodeIterator | createNodeIterator(Node root, long whatToShow, NodeFilter filter, boolean entityReferenceExpansion)
Introduced in DOM Level 2
This method is from the DocumentTraversal interface
Create a new NodeIterator over the subtree rooted at the specified node. |
ProcessingInstruction | createProcessingInstruction(String target, String data)
Creates a ProcessingInstruction node given the
specified name and data strings. |
Range | createRange()
Introduced in DOM Level 2
This method is from the DocumentRange interface |
Text | createTextNode(String data)
Creates a Text node given the specified string. |
TreeWalker | createTreeWalker(Node root, long whatToShow, NodeFilter filter, boolean entityReferenceExpansion)
Introduced in DOM Level 2
This method is from the DocumentTraversal interface
Create a new TreeWalker over the subtree rooted at the specified node. |
AbstractView | defaultView()
Introduced in DOM Level 2
This method is from the DocumentView interface
The default AbstractView for this Document, or null if none available. |
boolean | designMode()
not part of the official DOM
Documents are read-only by default, but they can be made editable by
entering "design mode". |
DocumentType | doctype()
The Document Type Declaration (see DocumentType
) associated with this document. |
Element | documentElement()
This is a convenience attribute that allows direct access to
the child node that is the root element of the document. |
Element | getElementById(String elementId)
Moved from HTMLDocument in DOM Level 2
Returns the Element whose id is given by
elementId. |
ArrayList | getElementsByTagName(String tagname)
No Exceptions.
|
ArrayList | getElementsByTagNameNS(String namespaceURI, String localName)
Introduced in DOM Level 2
No Exceptions
Returns an ArrayList 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. |
CSSStyleDeclaration | getOverrideStyle(Element elt, String pseudoElt)
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. |
DOMImplementation | implementation()
The DOMImplementation object that handles this
document. |
Node | importNode(Node importedNode, boolean deep)
Introduced in DOM Level 2
Imports a node from another document to this document. |
boolean | isHTMLDocument()
not part of the DOM |
void | load(String uri)
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. |
void | loadXML(String source)
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. |
String | preferredStylesheetSet()
CSS3 mechanism for selecting alternate stylesheets using the DOM.
|
void | removeStyleSheet(StyleSheet sheet)
Removes a style sheet to the list of style sheets.
|
String | selectedStylesheetSet() |
void | setAsync(boolean arg1)
Introduced in DOM Level 3
This method is from the DocumentLS interface
see async |
void | setDesignMode(boolean enable)
not part of the official DOM |
void | setSelectedStylesheetSet(String aString) |
ArrayList | styleSheets()
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. |
String | toString() |
void | updateRendering()
not part of the DOM
Updates the rendered display after one or more changes to
the DOM structure |
KHTMLView | view() |
UNKNOWN: don't create an implementation if false use at own risk
UNKNOWN: Introduced in DOM Level 3 This method is from the DocumentLS interface
DOMImplementation
.createCSSStyleSheet
This is not part of the official DOM.Parameters: sheet style sheet
UNKNOWN: Adds a new style sheet to the list of style sheets.
UNKNOWN: Introduced in DOM Level 3 This method is from the DocumentLS interface
UNKNOWN: not part of the DOM
Attr
of the given name. Note that the
Attr
instance can then be set on an Element
using the setAttribute
method.Parameters: name The name of the attribute.
Returns: A new Attr
object.
UNKNOWN: Creates an Attr
of the given name.
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
UNKNOWN: Introduced in DOM Level 2 Creates an attribute of the given qualified name and namespace URI.
CDATASection
node whose value is the
specified string.Parameters: data The data for the CDATASection
contents.
Returns: The new CDATASection
object.
UNKNOWN: Creates a CDATASection
node whose value is the specified string.
Comment
node given the specified
string.Parameters: data The data for the node.
Returns: The new Comment
object.
UNKNOWN: Creates a Comment
node given the specified string.
DocumentFragment
object.Returns: A new DocumentFragment
.
UNKNOWN: Creates an empty DocumentFragment
object.
Parameters: tagName The name of the element type to instantiate. For
XML, this is case-sensitive. For HTML, the tagName
parameter may be provided in any case, but it must be
mapped to the canonical uppercase form by the DOM
implementation.
Returns: A new Element
object.
UNKNOWN: Creates an element of the type specified.
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:
UNKNOWN: Introduced in DOM Level 2 Creates an element of the given qualified name and namespace URI.
Parameters: name The name of the entity to reference. NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
Returns: The new EntityReference
object.
UNKNOWN: Creates an EntityReference object.
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
UNKNOWN: Introduced in DOM Level 2 This method is from the DocumentEvent interface
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 NodeIterator, 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.
UNKNOWN: Introduced in DOM Level 2 This method is from the DocumentTraversal interface
ProcessingInstruction
node given the
specified name and data strings.Parameters: target The target part of the processing instruction. data The data for the node. NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
Returns: The new ProcessingInstruction
object.
UNKNOWN: Creates a ProcessingInstruction
node given the specified name and data strings.
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.
UNKNOWN: Introduced in DOM Level 2 This method is from the DocumentRange interface
Text
node given the specified string.Parameters: data The data for the node.
Returns: The new Text
object.
UNKNOWN: Creates a Text
node given the specified string.
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.
UNKNOWN: Introduced in DOM Level 2 This method is from the DocumentTraversal interface
UNKNOWN: Introduced in DOM Level 2 This method is from the DocumentView interface
Returns: whether this document is in design mode.
UNKNOWN: not part of the official DOM
DocumentType
) associated with this document. For HTML documents as well as
XML documents without a document type declaration this returns
null
. The DOM Level 1 does not support editing
the Document Type Declaration, therefore docType
cannot be altered in any way.UNKNOWN: The Document Type Declaration (see DocumentType
) associated with this document.
UNKNOWN: This is a convenience attribute that allows direct access to the child node that is the root element of the document.
id
is given by
elementId. If no such element exists, returns null
. Behavior is not defined if more than one element has
this id
.Parameters: elementId The unique id
value for an
element.
Returns: The matching element.
UNKNOWN: Moved from HTMLDocument in DOM Level 2 Returns the Element whose id
is given by elementId.
ArrayList
of all the Element
's
with a given tag name in the order in which they
would be encountered in a preorder traversal of the
Document
tree.Parameters: tagname The name of the tag to match on. The special value "*" matches all tags.
Returns: A new NodeList
object containing all the
matched Element
s.
UNKNOWN: No Exceptions.
Parameters: namespaceURI The namespace URI of the elements to match on. The special value "*" matches all namespaces. localName The local name of the elements to match on. The special value "*" matches all local names.
Returns: A new NodeList object containing all the matched Elements.
UNKNOWN: Introduced in DOM Level 2 No Exceptions
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.
UNKNOWN: Introduced in DOM Level 2 This method is from the DocumentCSS interface
DOMImplementation
object that handles this
document. A DOM application may use objects from multiple
implementations.UNKNOWN: The DOMImplementation
object that handles this document.
Parameters: importedNode The node to import. deep If true, recursively import the subtree under the specified node; if false, import only the node itself, as explained above. This has no effect on Attr, EntityReference, and Notation nodes.
Returns: The imported node that belongs to this Document.
UNKNOWN: Introduced in DOM Level 2
UNKNOWN:
Parameters: uri of type DOMString The URI reference for the XML file to be loaded. If this is a relative URI, the base URI used by the implementation is implementation dependent.
Returns: If async is set to true load returns true if the document load was successfully initiated. If an error occurred when initiating the document load, load returns false. If async is set to false load returns true if the document was successfully loaded and parsed. If an error occurred when either loading or parsing the URI, load returns false.
UNKNOWN: Introduced in DOM Level 3 This method is from the DocumentLS interface
Parameters: source A string containing an XML document.
UNKNOWN: Introduced in DOM Level 3 This method is from the DocumentLS interface
UNKNOWN: CSS3 mechanism for selecting alternate stylesheets using the DOM.
addStyleSheet
may be removed.
This is not part of the official DOM.Parameters: sheet style sheet to remove
UNKNOWN: Removes a style sheet to the list of style sheets.
UNKNOWN: Introduced in DOM Level 3 This method is from the DocumentLS interface
Parameters: enable true
to enable design mode, false
to disable.
See Also: Document
UNKNOWN: not part of the official DOM
UNKNOWN: Introduced in DOM Level 2 This method is from the DocumentStyle interface
UNKNOWN: not part of the DOM
Returns: The KHTML view widget of this document.
UNKNOWN: