Interface IXmlNode
- Namespace
- SharpVectors.Dom
- Assembly
- SharpVectors.Core.dll
The IXmlNode interface is the primary datatype for the entire Document Object Model. It represents a single node in the document tree. XmlNode
public interface IXmlNode
Remarks
While all objects implementing the INode interface expose methods for dealing with children, not all objects implementing the INode interface may have children. For example, IText nodes may not have children, and adding children to such nodes results in a DomException being raised.
The attributes Name, Value and Attributes are included as a mechanism to get at node information without casting down to the specific derived interface. In cases where there is no obvious mapping of these attributes for a specific NodeType (e.g., Value for an IElement or Attributes for a IComment), this returns null. Note that the specialized interfaces may contain additional and more convenient mechanisms to get and set the relevant information.
Properties
- Attributes
Gets a INamedNodeMap containing the attributes of this node (if it is an IElement) or null otherwise.
This implementation returns an System.Xml.XmlAttributeCollection containing the attributes of this node.
- ChildNodes
Gets all the child nodes of the node.
- FirstChild
Gets the first child of this node. If there is no such node, this returns null.
- HasChildNodes
Gets a value indicating whether this node has any children.
- LocalName
Gets the local part of the qualified name of this node.
- Name
Gets the qualified name of the node.
- NextSibling
Gets the node immediately following this node. If there is no such node, this returns null.
- NodeType
Gets the type of the current node.
- OwnerDocument
The IDocument object associated with this node. This is also the IDocument object used to create new nodes. When this node is a IDocument or a IDocumentType which is not used with any IDocument yet, this is null.
This implementation returns the System.Xml.XmlDocument to which this node belongs.
- ParentNode
Gets the parent of this node (for nodes that can have parents).
- PreviousSibling
Gets the node immediately preceding this node. If there is no such node, this returns null.
- Value
Gets or sets the value of the node.
Methods
- AppendChild(XmlNode)
Adds the node
newChild
to the end of the list of children of this node. If thenewChild
is already in the tree, it is first removed.
- CloneNode(bool)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (ParentNode is null.).
- InsertBefore(XmlNode, XmlNode)
Inserts the node
newChild
before the existing child noderefChild
.
- Normalize()
Puts all IText nodes in the full depth of the sub-tree underneath this INode, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates IText nodes, i.e., there are neither adjacent IText nodes nor empty IText nodes.
- RemoveChild(XmlNode)
Removes the child node indicated by
oldChild
from the list of children, and returns it.
- ReplaceChild(XmlNode, XmlNode)
Replaces the child node
oldChild
withnewChild
in the list of children, and returns theoldChild
node.
- Supports(string, string)
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.