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

IElement

Interface

Definition

Properties

The name of the element. For example, in:

        <pre> <elementExample 
        id="demo"> ... </elementExample> , </pre>
        <pre><code class="lang-csharp">tagName</code></pre>

has the value

csharp
"elementExample"

. Note that this is case-preserving in XML, as are all of the operations of the DOM. The HTML DOM returns the

csharp
tagName

of an HTML element in the canonical uppercase form, regardless of the case in the source HTML document.

C#
string TagName { get; }

Methods

Retrieves an attribute value by name.

C#
string GetAttribute(string name)
Parameters:namestring

string

The

csharp
Attr

value as a string, or the empty string if that attribute does not have a specified or default value.

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

IAttr

Retrieves an

csharp
Attr

node by local name and namespace URI. HTML-only DOM implementations do not need to implement this method.

C#
IAttr GetAttributeNodeNS(string namespaceUri, string localName)
Parameters:namespaceUristringlocalNamestring

IAttr

The

csharp
Attr

node with the specified attribute local name and namespace URI or

csharp
null

if there is no such attribute.

Retrieves an attribute value by local name and namespace URI. HTML-only DOM implementations do not need to implement this method.

C#
string GetAttributeNS(string namespaceUri, string localName)
Parameters:namespaceUristringlocalNamestring

string

The

csharp
Attr

value as a string, or the empty string if that attribute does not have a specified or default value.

Returns a

csharp
NodeList

of all descendant

csharp
Elements
        with a given tag name, in the order in which they are encountered in 
        a preorder traversal of this 
csharp
Element

tree.

C#
INodeList GetElementsByTagName(string name)
Parameters:namestring

INodeList

A list of matching

csharp
Element

nodes.

Returns a

csharp
NodeList

of all the descendant

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

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

csharp
Element

tree.
HTML-only DOM implementations do not need to implement this method.

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>

.

Returns

csharp
true

when an attribute with a given name is specified on this element or has a default value,

csharp
false
        otherwise.
C#
bool HasAttribute(string name)
Parameters:namestring

bool

csharp
true

if an attribute with the given name is specified on this element or has a default value,

csharp
false
        otherwise.

Returns

csharp
true

when an attribute with a given local name and namespace URI is specified on this element or has a default value,

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

otherwise. HTML-only DOM implementations do not need to implement this method.

C#
bool HasAttributeNS(string namespaceUri, string localName)
Parameters:namespaceUristringlocalNamestring

bool

csharp
true

if an attribute with the given local name and namespace URI is specified or has a default value on this element,

csharp
false

otherwise.

C#
void RemoveAttribute(string name)
Parameters:namestring

Removes the specified attribute node. If the removed

csharp
Attr
        has a default value it is immediately replaced. The replacing 
        attribute has the same namespace URI and local name, as well as the 
        original prefix, when applicable.
C#
IAttr RemoveAttributeNode(IAttr oldAttr)
Parameters:oldAttrIAttr

IAttr

The

csharp
Attr

node that was removed.

DomException

        NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
        <br />NOT_FOUND_ERR: Raised if 
csharp
oldAttr

is not an attribute of the element.

C#
void RemoveAttributeNS(string namespaceUri, string localName)
Parameters:namespaceUristringlocalNamestring
C#
void SetAttribute(string name, string value)
Parameters:namestringvaluestring
C#
IAttr SetAttributeNode(IAttr newAttr)
Parameters:newAttrIAttrReturns:

IAttr

C#
IAttr SetAttributeNodeNS(IAttr newAttr)
Parameters:newAttrIAttrReturns:

IAttr

C#
void SetAttributeNS(string namespaceUri, string qualifiedName, string value)
Parameters:namespaceUristringqualifiedNamestringvaluestring