New to Telerik UI for WPFStart a free 30-day trial

IDocument

Interface

Definition

Properties

The Document Type Declaration (see

csharp
DocumentType

) associated with this document. For HTML documents as well as XML documents without a document type declaration this returns

        <pre><code class="lang-csharp">null</code></pre>

. The DOM Level 2 does not support editing the Document Type Declaration.

csharp
docType

cannot be altered in any way, including through the use of methods inherited from the

        <pre><code class="lang-csharp">Node</code></pre>

interface, such as

csharp
insertNode

or

        <pre><code class="lang-csharp">removeNode</code></pre>

.

C#
IDocumentType Doctype { get; }

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".

C#
IElement DocumentElement { get; }

The

csharp
DOMImplementation

object that handles this document. A DOM application may use objects from multiple implementations.

C#
IDomImplementation Implementation { get; }

Methods

C#
IAttr CreateAttribute(string name)
Parameters:namestringReturns:

IAttr

Creates an attribute of the given qualified name and namespace URI. HTML-only DOM implementations do not need to implement this method.

C#
IAttr CreateAttributeNS(string namespaceUri, string qualifiedName)
Parameters:namespaceUristringqualifiedNamestring

IAttr

A new

csharp
Attr

object with the following attributes: AttributeValue

csharp
Node.nodeName

qualifiedName

        <pre><code class="lang-csharp">Node.namespaceURI</code></pre><pre><code class="lang-csharp">namespaceURI</code></pre>
        <pre><code class="lang-csharp">Node.prefix</code></pre>

prefix, extracted from

        <pre><code class="lang-csharp">qualifiedName</code></pre>

, or

csharp
null

if there is no prefix

csharp
Node.localName

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

DomException

        INVALID_CHARACTER_ERR: Raised if the specified qualified name 
        contains an illegal character.
        <br />NAMESPACE_ERR: Raised if the 
csharp
qualifiedName

is malformed, if the

csharp
qualifiedName

has a prefix and the

        <pre><code class="lang-csharp">namespaceURI</code></pre>

is

csharp
null

, if the

        <pre><code class="lang-csharp">qualifiedName</code></pre>

has a prefix that is "xml" and the

        <pre><code class="lang-csharp">namespaceURI</code></pre>

is different from " http://www.w3.org/XML/1998/namespace", or if the

        <pre><code class="lang-csharp">qualifiedName</code></pre>

is "xmlns" and the

        <pre><code class="lang-csharp">namespaceURI</code></pre>

is different from " http://www.w3.org/2000/xmlns/".

Creates a

csharp
CDATASection

node whose value is the specified string.

C#
ICdataSection CreateCdataSection(string data)
Parameters:datastring

ICdataSection

The new

csharp
CDATASection

object.

Exceptions:

DomException

NOT_SUPPORTED_ERR: Raised if this document is an HTML document.

Creates a

csharp
Comment

node given the specified string.

C#
IComment CreateComment(string data)
Parameters:datastring

IComment

The new

csharp
Comment

object.

Creates an empty

csharp
DocumentFragment

object.

C#
IDocumentFragment CreateDocumentFragment()

IDocumentFragment

A new

csharp
DocumentFragment

.

C#
IElement CreateElement(string tagName)
Parameters:tagNamestringReturns:

IElement

C#
IElement CreateElementNS(string namespaceUri, string qualifiedName)
Parameters:namespaceUristringqualifiedNamestringReturns:

IElement

Creates an

csharp
EntityReference

object. In addition, if the referenced entity is known, the child list of the

        <pre><code class="lang-csharp">EntityReference</code></pre>

node is made the same as that of the corresponding

csharp
Entity

node.If any descendant of the

        <pre><code class="lang-csharp">Entity</code></pre>

node has an unbound namespace prefix, the corresponding descendant of the created

csharp
EntityReference
        node is also unbound; (its 
csharp
namespaceURI

is

        <pre><code class="lang-csharp">null</code></pre>

). The DOM Level 2 does not support any mechanism to resolve namespace prefixes.

C#
IEntityReference CreateEntityReference(string name)
Parameters:namestring

IEntityReference

The new

csharp
EntityReference

object.

Exceptions:

DomException

INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
NOT_SUPPORTED_ERR: Raised if this document is an HTML document.

Creates a

csharp
ProcessingInstruction

node given the specified name and data strings.

C#
IProcessingInstruction CreateProcessingInstruction(string target, string data)
Parameters:targetstringdatastring

IProcessingInstruction

The new

csharp
ProcessingInstruction

object.

Exceptions:

DomException

INVALID_CHARACTER_ERR: Raised if the specified target contains an illegal character.
NOT_SUPPORTED_ERR: Raised if this document is an HTML document.

Creates a

csharp
Text

node given the specified string.

C#
IText CreateTextNode(string data)
Parameters:datastring

IText

The new

csharp
Text

object.

Returns the

csharp
Element

whose

csharp
ID

is given by

        <pre><code class="lang-csharp">elementId</code></pre>

. If no such element exists, returns

        <pre><code class="lang-csharp">null</code></pre>

. Behavior is not defined if more than one element has this

csharp
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

csharp
null

.

C#
IElement GetElementById(string elementId)
Parameters:elementIdstringReturns:

IElement

The matching element.

Returns a

csharp
NodeList

of all the

csharp
Elements

with a given tag name in the order in which they are encountered in a preorder traversal of the

csharp
Document

tree.

C#
INodeList GetElementsByTagName(string tagName)
Parameters:tagNamestring

INodeList

A new

csharp
NodeList

object containing all the matched

        <pre><code class="lang-csharp">Elements</code></pre>

.

Returns a

csharp
NodeList

of all the

csharp
Elements

with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the

csharp
Document

tree.

C#
INodeList GetElementsByTagNameNS(string namespaceUri, string localName)
Parameters:namespaceUristringlocalNamestring

INodeList

A new

csharp
NodeList

object containing all the matched

        <pre><code class="lang-csharp">Elements</code></pre>

.

C#
INode ImportNode(INode importedNode, bool deep)
Parameters:importedNodeINodedeepboolReturns:

INode