New to Telerik UI for WPF? Start a free 30-day trial

IDocument

Interface

Definition

Properties

The Document Type Declaration (see

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

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

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

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

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

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

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

object with the following attributes: AttributeValue

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

       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 

       <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

DomException

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

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

is malformed, if the

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

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

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

node whose value is the specified string.

C#
ICdataSection CreateCdataSection(string data)
Parameters:datastring

ICdataSection

The new

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

object.

Exceptions: DomException

NOT_SUPPORTED_ERR: Raised if this document is an HTML document.

Creates a

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

node given the specified string.

C#
IComment CreateComment(string data)
Parameters:datastring

IComment

The new

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

object.

Creates an empty

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

object.

C#
IDocumentFragment CreateDocumentFragment()

IDocumentFragment

A new

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

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

IElement

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

IElement

Creates an

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

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

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

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

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

       node is also unbound; (its 

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

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

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

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

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

node given the specified name and data strings.

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

IProcessingInstruction

The new

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

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

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

node given the specified string.

C#
IText CreateTextNode(string data)
Parameters:datastring

IText

The new

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

object.

Returns the

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

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 

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

       . 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 

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

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

IElement

The matching element.

Returns a

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

of all the

csharp
Elements

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

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

tree.

C#
INodeList GetElementsByTagName(string tagName)
Parameters:tagNamestring

INodeList

A new

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

object containing all the matched

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

        .

Returns a

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

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

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

tree.

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

INodeList

A new

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

object containing all the matched

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

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

INode