Table of Contents

Interface IXmlElement

Namespace
SharpVectors.Dom
Assembly
SharpVectors.Core.dll

The IElement interface represents an element in an HTML or XML document.

public interface IXmlElement : INode, IXmlNode
Inherited Members

Remarks

Elements may have attributes associated with them; since the IElement interface inherits from INode, the generic INode interface attribute IAttribute may be used to retrieve the set of all attributes for an element.

There are methods on the IElement interface to retrieve either an IAttribute object by name or an attribute value by name. In XML, where an attribute value may contain entity references, an IAttribute object should be retrieved to examine the possibly fairly complex sub-tree representing the attribute value.

On the other hand, in HTML, where all attributes have simple string values, methods to directly access an attribute value can safely be used as a convenience. In DOM Level 2, the method Normalize() is inherited from the INode interface where it was moved.

Properties

HasAttributes

Gets a value indicating whether this node (if it is an element) has any attributes.

Methods

GetAttribute(string)

Returns the value for the attribute with the specified name.

GetAttribute(string, string)

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

GetAttributeNode(string)

Returns the XmlAttribute with the specified name.

GetAttributeNode(string, string)

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

GetElementsByTagName(string)

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

GetElementsByTagName(string, string)

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

HasAttribute(string)

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

HasAttribute(string, string)

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

RemoveAttribute(string)

Removes an attribute by name.

RemoveAttribute(string, string)

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

RemoveAttributeNode(string, string)

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

RemoveAttributeNode(XmlAttribute)

Removes the specified XmlAttribute.

SetAttribute(string, string)

Sets the value of the attribute with the specified name.

SetAttribute(string, string, string)

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

SetAttributeNode(string, string)

Adds the specified XmlAttribute.

SetAttributeNode(XmlAttribute)

Adds the specified XmlAttribute.

See Also