only for RuBoard |
XmlNode class in the System.Xml namespace is the implementation of the W3C Node interface. It's an abstract class and is implemented and extended by the other classes in the System.Xml namespace, such as XmlAttribute , XmlDocument , XmlDocumentFragment , XmlEntity , XmlLinkedNode and XmlNotation . Because these classes represent the items in the XML document, these items can be treated as nodes and can be accessed through DOM. XmlNode class provides different properties and methods to work with different types of nodes in an XML document. Table B.1 and Table B.2 list these properties and methods , respectively. The corresponding MSXML interface IXMLDOMNode provides methods for XSLT transformation, like transformNode . In the System.Xml namespace, this is achieved by using the Transform method in the System.Xml.Xsl.xslTransform class.
XmlNode | Description | MSXML IXMLDOMNode |
---|---|---|
Attributes | Gets an XmlAttributeCollection containing the attributes of this node. XmlAttributeCollection inherits from System.Xml.XmlNamedNodeMap . | Gets IXMLDOMNamedNodeMap . |
BaseURI | Gets the base URI of the current node. Indicates where the node was loaded from. | |
ChildNodes | Gets all the children of the current node. | childNodes |
FirstChild | Gets the first child of the current node. | firstChild |
HasChildNodes | Returns Boolean indicating if the current node has child nodes. | Implements this functionality as a method named hasChildNodes . |
InnerText | Gets or sets the concatenated values of the node and all its children. | text* |
InnerXml | Gets or sets the markup representing the children of the current node. | |
IsReadOnly | Returns a Boolean indicating whether the current node is read-only. | |
Item | Returns the specified child element ( XmlElement ). This is the indexer in C# for the XmlDocument class. | |
LastChild | The last child of the node. | lastChild |
LocalName | Gets the name of the node without the namespace prefix. | baseName |
Name | Should get the qualified name of the current node when overridden in the derived classes. | nodeName |
NamespaceURI Gets the namespace URI of this node. | Returns the namespace URI of the current node. | namespaceURI |
NextSibling | Returns the node following this node at the same level in the document hierarchy. | nextSibling |
NodeType | Should get the type of the current node when overridden in the derived classes. (Type is an XmlNodeType Enumeration member.) | nodeType (Type is an IXMLDOMNodeType Enumeration member.) |
OuterXml | Gets the XML markup representing the current node and its children. Similar to InnerXml , except the current node is also returned. | xml |
OwnerDocument | Gets the XmlDocument to which the current node belongs. | ownerDocument |
ParentNode | Gets the parent of the current node. If the node has been created but not added to the tree, this returns a null reference in C#, or Nothing in Visual Basic .NET. | parentNode |
Prefix | Gets or sets the namespace prefix for the current node. | Prefix |
PreviousSibling | Gets the node previous to this node at the same level in the document hierarchy. | previousSibling |
Value | Gets or sets the value (text) of the current node. | nodeValue |
XmlNode | Description | MSXML IXMLDOMNode Implementation |
---|---|---|
AppendChild | Adds the specified node to the end of the list of children of the current node. | appendChild Appends new Child as the last child of this node. |
Clone | Creates a duplicate of the current node. ---- ---- | CloneNode |
CloneNode | Similar to Clone , but accepts a deep Boolean parameter indicating if the subtree should be duplicated . | |
CreateNavigator | Creates an XpathNavigator for navigating this object as a DOM structure. | |
GetEnumerator | Enables For Each enumerations on the object. | |
GetNamespace OfPrefix | Retrieves the namespace URI in the closest xmlns declaration for the given prefix. | |
GetPrefix OfNamespace | Retrieves the prefix in the closest xmlns declaration for the given URI. | |
InsertAfter | Inserts the node immediately after the specified reference node. | |
InsertBefore | Inserts the node immediately before the specified reference node or at the end of the list. | insertBefore |
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. | |
PrependChild | Adds the specified node as the first child of the current node. | |
RemoveAll | Removes all children and/or attributes of the current node. | |
RemoveChild | Removes the specified child node associated with the current node. | removeChild |
ReplaceChild | Removes the old child node and replaces it with the new child node. | replaceChild |
SelectNodes | Selects an XmlNodeList of nodes matching the specified XPath expression. | selectNodes* Selects IXMLDOMNodeList . |
SelectSingle Node | Selects an XmlNode matching the specified XPath expression. If more than one match is found, only the first match is returned. | selectSingleNode* Selects an IXMLDOMNode . |
Supports | Tests if the DOM implementation supports a specific feature. | |
WriteContentTo | Should save the contents of the XmlDocument node to the specified XmlWriter when overridden in the derived classes. | |
WriteTo When over ridden in a derived class, saves the current node to the specified XmlWriter . | Should save the XmlDocument node to the specified XmlWriter when overridden in the derived classes. |
only for RuBoard |