InterfaceIDocument
Definition
Namespace:Telerik.Windows.Documents.FormatProviders.Html.Parsing.Dom
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public interface IDocument : INode
Inherited Members
Properties
Doctype
The Document Type Declaration (see
DocumentType)
associated with this document. For HTML documents as well as XML
documents without a document type declaration this returns
null. The DOM Level 2 does not support editing the
Document Type Declaration. docType cannot be altered in
any way, including through the use of methods inherited from the
Node interface, such as insertNode or
removeNode.Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Doctype")]
IDocumentType Doctype { get; }
Property Value
DocumentElement
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".
Implementation
The
DOMImplementation object that handles this document. A
DOM application may use objects from multiple implementations.Declaration
IDomImplementation Implementation { get; }
Property Value
Methods
CreateAttributeNS(string, string)
Creates an attribute of the given qualified name and namespace URI. HTML-only DOM implementations do not need to implement this method.
Declaration
IAttr CreateAttributeNS(string namespaceUri, string qualifiedName)
Parameters
namespaceUri
qualifiedName
Returns
A new
Attr object with the following attributes:
AttributeValueNode.nodeNamequalifiedName
Node.namespaceURInamespaceURI
<pre><code class="lang-csharp">Node.prefix</code></pre>prefix, extracted from
<pre><code class="lang-csharp">qualifiedName</code></pre>, or <pre><code class="lang-csharp">null</code></pre> if there is no
prefix<pre><code class="lang-csharp">Node.localName</code></pre>local name, extracted from
<pre><code class="lang-csharp">qualifiedName</code></pre><pre><code class="lang-csharp">Attr.name</code></pre>
<pre><code class="lang-csharp">qualifiedName</code></pre><pre><code class="lang-csharp">Node.nodeValue</code></pre>the empty
string
Exceptions
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 "
CreateCdataSection(string)
Creates a
CDATASection node whose value is the specified
string.Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Cdata")]
ICdataSection CreateCdataSection(string data)
Parameters
data
Returns
The new
CDATASection object.
Exceptions
NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
CreateComment(string)
Creates a
Comment node given the specified string.CreateDocumentFragment()
Creates an empty
DocumentFragment object.Declaration
IDocumentFragment CreateDocumentFragment()
Returns
A new
DocumentFragment.
CreateEntityReference(string)
Creates an
EntityReference object. In addition, if the
referenced entity is known, the child list of the
EntityReference node is made the same as that of the
corresponding Entity node.If any descendant of the
Entity node has an unbound namespace prefix, the
corresponding descendant of the created EntityReference
node is also unbound; (its namespaceURI is
null). The DOM Level 2 does not support any mechanism to
resolve namespace prefixes.Declaration
IEntityReference CreateEntityReference(string name)
Parameters
name
Returns
The new
EntityReference object.
Exceptions
INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.
NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
CreateProcessingInstruction(string, string)
Creates a
ProcessingInstruction node given the specified
name and data strings.Declaration
IProcessingInstruction CreateProcessingInstruction(string target, string data)
Parameters
target
data
Returns
The new
ProcessingInstruction object.
Exceptions
INVALID_CHARACTER_ERR: Raised if the specified target contains an
illegal character.
NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
CreateTextNode(string)
Creates a
Text node given the specified string.GetElementById(string)
Returns the
Element whose ID is given by
elementId. If no such element exists, returns
null. Behavior is not defined if more than one element
has this ID. The DOM implementation must have
information that says which attributes are of type ID. Attributes
with the name "ID" are not of type ID unless so defined.
Implementations that do not know whether attributes are of type ID or
not are expected to return null.GetElementsByTagName(string)
Returns a
NodeList of all the Elements with a
given tag name in the order in which they are encountered in a
preorder traversal of the Document tree.GetElementsByTagNameNS(string, string)
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.