XmlNodeList 类

定义

表示节点的有序集合。Represents an ordered collection of nodes.

public ref class XmlNodeList abstract : IDisposable, System::Collections::IEnumerable
public ref class XmlNodeList abstract : System::Collections::IEnumerable
public abstract class XmlNodeList : IDisposable, System.Collections.IEnumerable
public abstract class XmlNodeList : System.Collections.IEnumerable
type XmlNodeList = class
    interface IEnumerable
    interface IDisposable
type XmlNodeList = class
    interface IEnumerable
Public MustInherit Class XmlNodeList
Implements IDisposable, IEnumerable
Public MustInherit Class XmlNodeList
Implements IEnumerable
继承
XmlNodeList
实现

注解

对创建集合的节点对象的子级的更改 XmlNodeList 会立即反映在属性和方法返回的节点中 XmlNodeListChanges to the children of the node object that the XmlNodeList collection was created from are immediately reflected in the nodes returned by the XmlNodeList properties and methods. XmlNodeList 支持迭代和索引访问。XmlNodeList supports iteration and indexed access.

XmlNodeList 由以下属性和方法返回。XmlNodeList is returned by the following properties and methods.

  • XmlNode.ChildNodes -返回 XmlNodeList 包含节点的所有子级的。XmlNode.ChildNodes - Returns an XmlNodeList containing all the children of the node.

  • XmlNode.SelectNodes -返回一个,该字符串 XmlNodeList 包含与 XPath 查询匹配的节点的集合。XmlNode.SelectNodes - Returns an XmlNodeList containing a collection of nodes matching the XPath query.

  • GetElementsByTagName -返回一个,它 XmlNodeList 包含与指定名称匹配的所有子代元素的列表。GetElementsByTagName - Returns an XmlNodeList containing a list of all descendant elements that match the specified name. 此方法在和类中可用 XmlDocument XmlElementThis method is available in both the XmlDocument and XmlElement classes.

构造函数

XmlNodeList()

初始化 XmlNodeList 类的新实例。Initializes a new instance of the XmlNodeList class.

属性

Count

获取 XmlNodeList 中的节点数。Gets the number of nodes in the XmlNodeList.

ItemOf[Int32]

获取给定索引处的节点。Gets a node at the given index.

方法

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetEnumerator()

获取一个循环访问其集合节点的枚举数。Gets an enumerator that iterates through the collection of nodes.

GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
Item(Int32)

检索给定索引处的节点。Retrieves a node at the given index.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
PrivateDisposeNodeList()

私下释放节点列表里的资源。Disposes resources in the node list privately.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

显式接口实现

IDisposable.Dispose()

释放 XmlNodeList 类使用的所有资源。Releases all resources used by the XmlNodeList class.

扩展方法

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于