XmlNode Class

Represents a single node in the XML document.

Namespace:  System.Xml8
Assembly:  System.Xml (in System.Xml.dll)
C#
public abstract class XmlNode : ICloneable, 
	IEnumerable, IXPathNavigable

The XmlNode type exposes the following members.

  Name Description
Public property Supported by the XNA Framework Attributes9 Gets an XmlAttributeCollection10 containing the attributes of this node.
Public property Supported by the XNA Framework BaseURI11 Gets the base URI of the current node.
Public property Supported by the XNA Framework ChildNodes12 Gets all the child nodes of the node.
Public property Supported by the XNA Framework FirstChild13 Gets the first child of the node.
Public property Supported by the XNA Framework HasChildNodes14 Gets a value indicating whether this node has any child nodes.
Public property Supported by the XNA Framework InnerText15 Gets or sets the concatenated values of the node and all its child nodes.
Public property Supported by the XNA Framework InnerXml16 Gets or sets the markup representing only the child nodes of this node.
Public property Supported by the XNA Framework IsReadOnly17 Gets a value indicating whether the node is read-only.
Public property Supported by the XNA Framework Item[String]18 Gets the first child element with the specified Name19.
Public property Supported by the XNA Framework Item[String, String]20 Gets the first child element with the specified LocalName21 and NamespaceURI22.
Public property Supported by the XNA Framework LastChild23 Gets the last child of the node.
Public property Supported by the XNA Framework LocalName21 When overridden in a derived class, gets the local name of the node.
Public property Supported by the XNA Framework Name19 When overridden in a derived class, gets the qualified name of the node.
Public property Supported by the XNA Framework NamespaceURI22 Gets the namespace URI of this node.
Public property Supported by the XNA Framework NextSibling24 Gets the node immediately following this node.
Public property Supported by the XNA Framework NodeType25 When overridden in a derived class, gets the type of the current node.
Public property Supported by the XNA Framework OuterXml26 Gets the markup representing this node and all its child nodes.
Public property Supported by the XNA Framework OwnerDocument27 Gets the XmlDocument3 to which this node belongs.
Public property Supported by the XNA Framework ParentNode28 Gets the parent of this node (for nodes that can have parents).
Public property Supported by the XNA Framework Prefix29 Gets or sets the namespace prefix of this node.
Public property Supported by the XNA Framework PreviousSibling30 Gets the node immediately preceding this node.
Public property Supported by the XNA Framework SchemaInfo31 Gets the post schema validation infoset that has been assigned to this node as a result of schema validation.
Public property Supported by the XNA Framework Value32 Gets or sets the value of the node.
Top
  Name Description
Public method Supported by the XNA Framework AppendChild33 Adds the specified node to the end of the list of child nodes, of this node.
Public method Supported by the XNA Framework Clone34 Creates a duplicate of this node.
Public method Supported by the XNA Framework CloneNode35 When overridden in a derived class, creates a duplicate of the node.
Public method CreateNavigator36 Creates an XPathNavigator37 for navigating this object.
Public method Supported by the XNA Framework Equals(Object)38 Determines whether the specified Object1 is equal to the current Object1. (Inherited from Object1.)
Protected method Supported by the XNA Framework Finalize39 Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object1.)
Public method Supported by the XNA Framework GetEnumerator40 Provides support for the for each style iteration over the nodes in the XmlNode.
Public method Supported by the XNA Framework GetHashCode41 Serves as a hash function for a particular type. (Inherited from Object1.)
Public method Supported by the XNA Framework GetNamespaceOfPrefix42 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.
Public method Supported by the XNA Framework GetPrefixOfNamespace43 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.
Public method Supported by the XNA Framework GetType44 Gets the Type45 of the current instance. (Inherited from Object1.)
Public method Supported by the XNA Framework InsertAfter46 Inserts the specified node immediately after the specified reference node.
Public method Supported by the XNA Framework InsertBefore47 Inserts the specified node immediately before the specified reference node.
Protected method Supported by the XNA Framework MemberwiseClone48 Creates a shallow copy of the current Object1. (Inherited from Object1.)
Public method Supported by the XNA Framework Normalize49 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.
Public method Supported by the XNA Framework PrependChild50 Adds the specified node to the beginning of the list of child nodes for this node.
Public method Supported by the XNA Framework RemoveAll51 Removes all the child nodes and/or attributes of the current node.
Public method Supported by the XNA Framework RemoveChild52 Removes specified child node.
Public method Supported by the XNA Framework ReplaceChild53 Replaces the child node oldChild with newChild node.
Public method Supported by the XNA Framework SelectNodes(String)54 Selects a list of nodes matching the XPath expression.
Public method Supported by the XNA Framework SelectNodes(String, XmlNamespaceManager)55 Selects a list of nodes matching the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied XmlNamespaceManager56.
Public method Supported by the XNA Framework SelectSingleNode(String)57 Selects the first XmlNode that matches the XPath expression.
Public method Supported by the XNA Framework SelectSingleNode(String, XmlNamespaceManager)58 Selects the first XmlNode that matches the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied XmlNamespaceManager56.
Public method Supported by the XNA Framework Supports59 Test if the DOM implementation implements a specific feature.
Public method Supported by the XNA Framework ToString60 Returns a string that represents the current object. (Inherited from Object1.)
Public method Supported by the XNA Framework WriteContentTo61 When overridden in a derived class, saves all the child nodes of the node to the specified XmlWriter62.
Public method Supported by the XNA Framework WriteTo63 When overridden in a derived class, saves the current node to the specified XmlWriter62.
Top
  Name Description
Public Extension Method AsParallel64 Enables parallelization of a query. (Defined by ParallelEnumerable65.)
Public Extension Method AsQueryable66 Converts an IEnumerable67 to an IQueryable68. (Defined by Queryable69.)
Public Extension Method Supported by the XNA Framework Cast<TResult>70 Converts the elements of an IEnumerable67 to the specified type. (Defined by Enumerable71.)
Public Extension Method Supported by the XNA Framework OfType<TResult>72 Filters the elements of an IEnumerable67 based on a specified type. (Defined by Enumerable71.)
Top
  Name Description
Explicit interface implemetation Private method Supported by the XNA Framework ICloneable.Clone73 For a description of this member, see XmlNode.Clone34.
Explicit interface implemetation Private method Supported by the XNA Framework IEnumerable.GetEnumerator74 For a description of this member, see XmlNode.GetEnumerator40.
Top

This class implements the W3C Document Object Model (DOM) Level 1 Core and the Core DOM Level 2. The DOM is an in-memory (cache) tree representation of an XML document. XmlNode is the base class in the.NET implementation of the DOM. It supports XPath selections and provides editing capabilities. The XmlDocument3 class extends XmlNode and represents an XML document. You can use XmlDocument to load and save XML data. It also includes methods for node creation. See XML Document Object Model (DOM)75 for more information.

Security note Security Note

Exceptions raised as a result of using the XmlNode class, such as the XmlException76 class may contain sensitive information that should not be exposed in untrusted scenarios. Exceptions should be properly handled so that this sensitive information is not exposed in untrusted scenarios.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements77.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Links Table
1http://msdn.microsoft.com/en-us/library/system.object.aspx
2http://msdn.microsoft.com/en-us/library/system.xml.xmlattribute.aspx
3http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx
4http://msdn.microsoft.com/en-us/library/system.xml.xmldocumentfragment.aspx
5http://msdn.microsoft.com/en-us/library/system.xml.xmlentity.aspx
6http://msdn.microsoft.com/en-us/library/system.xml.xmllinkednode.aspx
7http://msdn.microsoft.com/en-us/library/system.xml.xmlnotation.aspx
8http://msdn.microsoft.com/en-us/library/system.xml.aspx
9http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.attributes.aspx
10http://msdn.microsoft.com/en-us/library/system.xml.xmlattributecollection.aspx
11http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.baseuri.aspx
12http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.childnodes.aspx
13http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.firstchild.aspx
14http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.haschildnodes.aspx
15http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.innertext.aspx
16http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.innerxml.aspx
17http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.isreadonly.aspx
18http://msdn.microsoft.com/en-us/library/sss31aas.aspx
19http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.name.aspx
20http://msdn.microsoft.com/en-us/library/f4e60238.aspx
21http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.localname.aspx
22http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.namespaceuri.aspx
23http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.lastchild.aspx
24http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.nextsibling.aspx
25http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.nodetype.aspx
26http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.outerxml.aspx
27http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.ownerdocument.aspx
28http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.parentnode.aspx
29http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.prefix.aspx
30http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.previoussibling.aspx
31http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.schemainfo.aspx
32http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.value.aspx
33http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.appendchild.aspx
34http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.clone.aspx
35http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.clonenode.aspx
36http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.createnavigator.aspx
37http://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathnavigator.aspx
38http://msdn.microsoft.com/en-us/library/bsc2ak47.aspx
39http://msdn.microsoft.com/en-us/library/system.object.finalize.aspx
40http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.getenumerator.aspx
41http://msdn.microsoft.com/en-us/library/system.object.gethashcode.aspx
42http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.getnamespaceofprefix.aspx
43http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.getprefixofnamespace.aspx
44http://msdn.microsoft.com/en-us/library/system.object.gettype.aspx
45http://msdn.microsoft.com/en-us/library/system.type.aspx
46http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.insertafter.aspx
47http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.insertbefore.aspx
48http://msdn.microsoft.com/en-us/library/system.object.memberwiseclone.aspx
49http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.normalize.aspx
50http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.prependchild.aspx
51http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.removeall.aspx
52http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.removechild.aspx
53http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.replacechild.aspx
54http://msdn.microsoft.com/en-us/library/hcebdtae.aspx
55http://msdn.microsoft.com/en-us/library/4bektfx9.aspx
56http://msdn.microsoft.com/en-us/library/system.xml.xmlnamespacemanager.aspx
57http://msdn.microsoft.com/en-us/library/fb63z0tw.aspx
58http://msdn.microsoft.com/en-us/library/h0hw012b.aspx
59http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.supports.aspx
60http://msdn.microsoft.com/en-us/library/system.object.tostring.aspx
61http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.writecontentto.aspx
62http://msdn.microsoft.com/en-us/library/system.xml.xmlwriter.aspx
63http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.writeto.aspx
64http://msdn.microsoft.com/en-us/library/dd413237.aspx
65http://msdn.microsoft.com/en-us/library/system.linq.parallelenumerable.aspx
66http://msdn.microsoft.com/en-us/library/bb353734.aspx
67http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx
68http://msdn.microsoft.com/en-us/library/system.linq.iqueryable.aspx
69http://msdn.microsoft.com/en-us/library/system.linq.queryable.aspx
70http://msdn.microsoft.com/en-us/library/bb341406.aspx
71http://msdn.microsoft.com/en-us/library/system.linq.enumerable.aspx
72http://msdn.microsoft.com/en-us/library/bb360913.aspx
73http://msdn.microsoft.com/en-us/library/bb300910.aspx
74http://msdn.microsoft.com/en-us/library/bb298294.aspx
75http://msdn.microsoft.com/en-us/library/hf9hbf87.aspx
76http://msdn.microsoft.com/en-us/library/system.xml.xmlexception.aspx
77http://msdn.microsoft.com/en-us/library/8z6watww.aspx
78http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.selectnodes.aspx
79http://msdn.microsoft.com/en-us/library/k44daxya.aspx
Community Content Add
Annotations FAQ
XmlNode method
How can I use XmlNode class? Any reference?