XmlElement Class
 

Represents an element.

Namespace:   System.Xml
Assembly:  System.Xml (in System.Xml.dll)

Inheritance Hierarchy
SystemObject
   System.XmlXmlNode
     System.XmlXmlLinkedNode
      System.XmlXmlElement

Syntax
public class XmlElement : XmlLinkedNode
public ref class XmlElement : XmlLinkedNode
type XmlElement = 
    class
        inherit XmlLinkedNode
    end
Public Class XmlElement
	Inherits XmlLinkedNode
Constructors
NameDescription
System_CAPS_protmethod XmlElement

This API supports the product infrastructure and is not intended to be used directly from your code. Initializes a new instance of the XmlElement class.

Properties
NameDescription
System_CAPS_pubproperty

Gets an XmlAttributeCollection containing the list of attributes for this node.(Overrides .)

System_CAPS_pubproperty

Gets the base URI of the current node.(Inherited from XmlNode.)

System_CAPS_pubproperty

Gets all the child nodes of the node.(Inherited from XmlNode.)

System_CAPS_pubproperty

Gets the first child of the node.(Inherited from XmlNode.)

System_CAPS_pubproperty

Gets a boolean value indicating whether the current node has any attributes.

System_CAPS_pubproperty

Gets a value indicating whether this node has any child nodes.(Inherited from XmlNode.)

System_CAPS_pubproperty

Gets or sets the concatenated values of the node and all its children.(Overrides .)

System_CAPS_pubproperty

Gets or sets the markup representing just the children of this node.(Overrides .)

System_CAPS_pubproperty

Gets or sets the tag format of the element.

System_CAPS_pubproperty

Gets a value indicating whether the node is read-only.(Inherited from XmlNode.)

System_CAPS_pubproperty

Gets the first child element with the specified .(Inherited from XmlNode.)

System_CAPS_pubproperty

Gets the first child element with the specified and .(Inherited from XmlNode.)

System_CAPS_pubproperty

Gets the last child of the node.(Inherited from XmlNode.)

System_CAPS_pubproperty

Gets the local name of the current node.(Overrides .)

System_CAPS_pubproperty

Gets the qualified name of the node.(Overrides .)

System_CAPS_pubproperty

Gets the namespace URI of this node.(Overrides .)

System_CAPS_pubproperty

Gets the XmlNode immediately following this element.(Overrides .)

System_CAPS_pubproperty

Gets the type of the current node.(Overrides .)

System_CAPS_pubproperty

Gets the markup containing this node and all its child nodes.(Inherited from XmlNode.)

System_CAPS_pubproperty

Gets the XmlDocument to which this node belongs.(Overrides .)

System_CAPS_pubproperty

Gets the parent of this node (for nodes that can have parents).(Overrides .)

System_CAPS_pubproperty

Gets or sets the namespace prefix of this node.(Overrides .)

System_CAPS_pubproperty

Gets the node immediately preceding this node.(Inherited from XmlLinkedNode.)

System_CAPS_pubproperty

Gets the text node that immediately precedes this node.(Inherited from XmlNode.)

System_CAPS_pubproperty

Gets the post schema validation infoset that has been assigned to this node as a result of schema validation.(Overrides .)

System_CAPS_pubproperty

Gets or sets the value of the node.(Inherited from XmlNode.)

Methods
NameDescription
System_CAPS_pubmethod AppendChild

Adds the specified node to the end of the list of child nodes, of this node.(Inherited from XmlNode.)

System_CAPS_pubmethod Clone

Creates a duplicate of this node.(Inherited from XmlNode.)

System_CAPS_pubmethod CloneNode

Creates a duplicate of this node.(Overrides XmlNodeCloneNode.)

System_CAPS_pubmethod CreateNavigator

Creates an XPathNavigator for navigating this object.(Inherited from XmlNode.)

System_CAPS_pubmethod Equals

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethod Finalize

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethod GetAttribute

Returns the value for the attribute with the specified name.

System_CAPS_pubmethod GetAttribute

Returns the value for the attribute with the specified local name and namespace URI.

System_CAPS_pubmethod GetAttributeNode

Returns the XmlAttribute with the specified name.

System_CAPS_pubmethod GetAttributeNode

Returns the XmlAttribute with the specified local name and namespace URI.

System_CAPS_pubmethod GetElementsByTagName

Returns an XmlNodeList containing a list of all descendant elements that match the specified .

System_CAPS_pubmethod GetElementsByTagName

Returns an XmlNodeList containing a list of all descendant elements that match the specified and .

System_CAPS_pubmethod GetEnumerator

Get an enumerator that iterates through the child nodes in the current node.(Inherited from XmlNode.)

System_CAPS_pubmethod GetHashCode

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethod GetNamespaceOfPrefix

Looks up the closest xmlns declaration for the given prefix that is in scope for the current node and returns the namespace URI in the declaration.(Inherited from XmlNode.)

System_CAPS_pubmethod GetPrefixOfNamespace

Looks up the closest xmlns declaration for the given namespace URI that is in scope for the current node and returns the prefix defined in that declaration.(Inherited from XmlNode.)

System_CAPS_pubmethod GetType

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethod HasAttribute

Determines whether the current node has an attribute with the specified name.

System_CAPS_pubmethod HasAttribute

Determines whether the current node has an attribute with the specified local name and namespace URI.

System_CAPS_pubmethod InsertAfter

Inserts the specified node immediately after the specified reference node.(Inherited from XmlNode.)

System_CAPS_pubmethod InsertBefore

Inserts the specified node immediately before the specified reference node.(Inherited from XmlNode.)

System_CAPS_protmethod MemberwiseClone

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethod Normalize

Puts all XmlText nodes in the full depth of the sub-tree underneath this XmlNode into a "normal" form where only markup (that is, tags, comments, processing instructions, CDATA sections, and entity references) separates XmlText nodes, that is, there are no adjacent XmlText nodes.(Inherited from XmlNode.)

System_CAPS_pubmethod PrependChild

Adds the specified node to the beginning of the list of child nodes for this node.(Inherited from XmlNode.)

System_CAPS_pubmethod RemoveAll

Removes all specified attributes and children of the current node. Default attributes are not removed.(Overrides XmlNodeRemoveAll.)

System_CAPS_pubmethod RemoveAllAttributes

Removes all specified attributes from the element. Default attributes are not removed.

System_CAPS_pubmethod RemoveAttribute

Removes an attribute by name.

System_CAPS_pubmethod RemoveAttribute

Removes an attribute with the specified local name and namespace URI. (If the removed attribute has a default value, it is immediately replaced).

System_CAPS_pubmethod RemoveAttributeAt

Removes the attribute node with the specified index from the element. (If the removed attribute has a default value, it is immediately replaced).

System_CAPS_pubmethod RemoveAttributeNode

Removes the XmlAttribute specified by the local name and namespace URI. (If the removed attribute has a default value, it is immediately replaced).

System_CAPS_pubmethod RemoveAttributeNode

Removes the specified XmlAttribute.

System_CAPS_pubmethod RemoveChild

Removes specified child node.(Inherited from XmlNode.)

System_CAPS_pubmethod ReplaceChild

Replaces the child node oldChild with newChild node.(Inherited from XmlNode.)

System_CAPS_pubmethod SelectNodes

Selects a list of nodes matching the XPath expression.(Inherited from XmlNode.)

System_CAPS_pubmethod SelectNodes

Selects a list of nodes matching the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied XmlNamespaceManager.(Inherited from XmlNode.)

System_CAPS_pubmethod SelectSingleNode

Selects the first XmlNode that matches the XPath expression.(Inherited from XmlNode.)

System_CAPS_pubmethod SelectSingleNode

Selects the first XmlNode that matches the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied XmlNamespaceManager.(Inherited from XmlNode.)

System_CAPS_pubmethod SetAttribute

Sets the value of the attribute with the specified name.

System_CAPS_pubmethod SetAttribute

Sets the value of the attribute with the specified local name and namespace URI.

System_CAPS_pubmethod SetAttributeNode

Adds the specified XmlAttribute.

System_CAPS_pubmethod SetAttributeNode

Adds the specified XmlAttribute.

System_CAPS_pubmethod Supports

Tests if the DOM implementation implements a specific feature.(Inherited from XmlNode.)

System_CAPS_pubmethod ToString

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubmethod WriteContentTo

Saves all the children of the node to the specified XmlWriter.(Overrides XmlNodeWriteContentTo.)

System_CAPS_pubmethod WriteTo

Saves the current node to the specified XmlWriter.(Overrides XmlNodeWriteTo.)

Explicit Interface Implementations
NameDescription
System_CAPS_pubinterface System_CAPS_privmethod IEnumerableGetEnumerator

For a description of this member, see XmlNodeGetEnumerator.(Inherited from XmlNode.)

System_CAPS_pubinterface System_CAPS_privmethod ICloneableClone

For a description of this member, see XmlNodeClone.(Inherited from XmlNode.)

Extension Methods
NameDescription
System_CAPS_pubmethod AsParallel

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethod AsQueryable

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethod Cast

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethod OfType

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

Remarks

Elements are one of the most common nodes in the W3C Document Object Model (DOM). Elements can have attributes associated with them. The XmlElement class has many methods for accessing attributes ( GetAttribute, SetAttribute, RemoveAttribute, GetAttributeNode, and so on). You can also use the property which returns an XmlAttributeCollection enabling you to access attributes by name or index from the collection.

Version Information
Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top