XmlDocument 成员

表示 XML 文档。

下表列出了由 XmlDocument 类型公开的成员。

公共构造函数

(请参见 受保护的构造函数 )

  名称 说明
Public method Supported by the .NET Compact Framework XmlDocument 已重载。初始化 XmlDocument 类的新实例。

页首

受保护的构造函数

  名称 说明
Protected method Supported by the .NET Compact Framework XmlDocument 已重载。初始化 XmlDocument 类的新实例。

页首

公共属性

  名称 说明
Public property Supported by the .NET Compact Framework Attributes  获取一个 XmlAttributeCollection,它包含该节点的属性。(从 XmlNode 继承。)
Public property Supported by the .NET Compact Framework BaseURI 已重写。获取当前节点的基 URI。
Public property Supported by the .NET Compact Framework ChildNodes  获取节点的所有子节点。(从 XmlNode 继承。)
Public property Supported by the .NET Compact Framework DocumentElement 获取文档的根 XmlElement
Public property DocumentType 获取包含 DOCTYPE 声明的节点。
Public property Supported by the .NET Compact Framework FirstChild  获取节点的第一个子级。(从 XmlNode 继承。)
Public property Supported by the .NET Compact Framework HasChildNodes  获取一个值,该值指示节点是否有任何子节点。(从 XmlNode 继承。)
Public property Supported by the .NET Compact Framework Implementation 获取当前文档的 XmlImplementation 对象。
Public property Supported by the .NET Compact Framework InnerText  获取或设置节点及其所有子节点的串联值。(从 XmlNode 继承。)
Public property Supported by the .NET Compact Framework InnerXml 已重写。获取或设置表示当前节点子级的标记。
Public property Supported by the .NET Compact Framework IsReadOnly 已重写。获取一个值,该值指示当前节点是否是只读的。
Public property Supported by the .NET Compact Framework Item  已重载。获取指定的子元素。(从 XmlNode 继承。)
Public property Supported by the .NET Compact Framework LastChild  获取节点的最后一个子级。(从 XmlNode 继承。)
Public property Supported by the .NET Compact Framework LocalName 已重写。获取节点的本地名称。
Public property Supported by the .NET Compact Framework Name 已重写。获取节点的限定名。
Public property Supported by the .NET Compact Framework NamespaceURI  获取该节点的命名空间 URI。(从 XmlNode 继承。)
Public property Supported by the .NET Compact Framework NameTable 获取与此实现关联的 XmlNameTable
Public property Supported by the .NET Compact Framework NextSibling  获取紧接在该节点之后的节点。(从 XmlNode 继承。)
Public property Supported by the .NET Compact Framework NodeType 已重写。获取当前节点的类型。
Public property Supported by the .NET Compact Framework OuterXml  获取表示此节点及其所有子节点的标记。(从 XmlNode 继承。)
Public property Supported by the .NET Compact Framework OwnerDocument 已重写。获取当前节点所属的 XmlDocument
Public property Supported by the .NET Compact Framework ParentNode 已重写。获取该节点(对于可以具有父级的节点)的父级。
Public property Supported by the .NET Compact Framework Prefix  获取或设置该节点的命名空间前缀。(从 XmlNode 继承。)
Public property Supported by the .NET Compact Framework PreserveWhitespace 获取或设置一个值,该值指示是否在元素内容中保留空白。
Public property Supported by the .NET Compact Framework PreviousSibling  获取紧接在该节点之前的节点。(从 XmlNode 继承。)
Public property Supported by the .NET Compact Framework SchemaInfo 已重写。返回节点的后架构验证信息集 (PSVI)。
Public property Supported by the .NET Compact Framework Schemas 获取或设置与此 XmlDocument 关联的 XmlSchemaSet 对象。
Public property Supported by the .NET Compact Framework Value  获取或设置节点的值。(从 XmlNode 继承。)
Public property Supported by the .NET Compact Framework XmlResolver 设置 XmlResolver 以用于解析外部资源。

页首

公共方法

(请参见 受保护的方法 )

  名称 说明
Public method Supported by the .NET Compact Framework AppendChild  将指定的节点添加到该节点的子节点列表的末尾。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework Clone  创建此节点的一个副本。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework CloneNode 已重写。 创建此节点的一个副本。
Public method Supported by the .NET Compact Framework CreateAttribute 已重载。 创建具有指定名称的 XmlAttribute
Public method Supported by the .NET Compact Framework CreateCDataSection 创建包含指定数据的 XmlCDataSection
Public method Supported by the .NET Compact Framework CreateComment 创建包含指定数据的 XmlComment
Public method Supported by the .NET Compact Framework CreateDocumentFragment 创建 XmlDocumentFragment
Public method CreateDocumentType 返回新的 XmlDocumentType 对象。
Public method Supported by the .NET Compact Framework CreateElement 已重载。 创建 XmlElement
Public method Supported by the .NET Compact Framework CreateEntityReference 创建具有指定名称的 XmlEntityReference
Public method CreateNavigator 已重载。 已重写。 创建一个用于导航此文档的新 XPathNavigator 对象。
Public method Supported by the .NET Compact Framework CreateNode 已重载。 创建 XmlNode
Public method Supported by the .NET Compact Framework CreateProcessingInstruction 创建一个具有指定名称和数据的 XmlProcessingInstruction
Public method Supported by the .NET Compact Framework CreateSignificantWhitespace 创建一个 XmlSignificantWhitespace 节点。
Public method Supported by the .NET Compact Framework CreateTextNode 创建具有指定文本的 XmlText
Public method Supported by the .NET Compact Framework CreateWhitespace 创建一个 XmlWhitespace 节点。
Public method Supported by the .NET Compact Framework CreateXmlDeclaration 创建一个具有指定值的 XmlDeclaration 节点。
Public method Supported by the .NET Compact Framework Equals  已重载。 确定两个 Object 实例是否相等。 (从 Object 继承。)
Public method GetElementById 获取具有指定 ID 的 XmlElement
Public method Supported by the .NET Compact Framework GetElementsByTagName 已重载。 返回一个 XmlNodeList,它包含与指定名称匹配的所有子代元素的列表。
Public method Supported by the .NET Compact Framework GetEnumerator  提供对 XmlNode 中节点上“for each”样式迭代的支持。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework GetHashCode  用作特定类型的哈希函数。GetHashCode 适合在哈希算法和数据结构(如哈希表)中使用。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework GetNamespaceOfPrefix  查找当前节点范围内离给定的前缀最近的 xmlns 声明,并返回声明中的命名空间 URI。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework GetPrefixOfNamespace  查找当前节点范围内离给定的命名空间 URI 最近的 xmlns 声明,并返回声明中定义的前缀。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework GetType  获取当前实例的 Type。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework ImportNode 将节点从另一个文档导入到当前文档。
Public method Supported by the .NET Compact Framework InsertAfter  将指定的节点紧接着插入指定的引用节点之后。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework InsertBefore  将指定的节点紧接着插入指定的引用节点之前。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework Load 已重载。 加载指定的 XML 数据。
Public method Supported by the .NET Compact Framework LoadXml 从指定的字符串加载 XML 文档。
Public method Supported by the .NET Compact Framework Normalize  将此 XmlNode 下子树完全深度中的所有 XmlText 节点都转换成“正常”形式,在这种形式中只有标记(即标记、注释、处理指令、CDATA 节和实体引用)分隔 XmlText 节点,也就是说,没有相邻的 XmlText 节点。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework PrependChild  将指定的节点添加到该节点的子节点列表的开头。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework ReadNode 根据 XmlReader 中的信息创建一个 XmlNode 对象。读取器必须定位在节点或属性上。
Public method Static Supported by the .NET Compact Framework ReferenceEquals  确定指定的 Object 实例是否是相同的实例。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework RemoveAll  移除当前节点的所有子节点和/或属性。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework RemoveChild  移除指定的子节点。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework ReplaceChild  用 newChild 节点替换子节点 oldChild。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework Save 已重载。 将 XML 文档保存到指定的位置。
Public method Supported by the .NET Compact Framework SelectNodes  已重载。 选择匹配 XPath 表达式的节点列表。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework SelectSingleNode  已重载。 选择匹配 XPath 表达式的第一个 XmlNode。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework Supports  测试 DOM 实现是否实现特定的功能。 (从 XmlNode 继承。)
Public method Supported by the .NET Compact Framework ToString  返回表示当前 ObjectString。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework Validate 已重载。 验证 XmlDocument 是不是 Schemas 属性中包含的 XML 架构定义语言 (XSD) 架构。
Public method Supported by the .NET Compact Framework WriteContentTo 已重写。 将 XmlDocument 节点的所有子级保存到指定的 XmlWriter 中。
Public method Supported by the .NET Compact Framework WriteTo 已重写。 将 XmlDocument 节点保存到指定的 XmlWriter

页首

受保护的方法

  名称 说明
Protected method Supported by the .NET Compact Framework CreateDefaultAttribute 创建具有指定前缀、本地名称和命名空间 URI 的默认属性。
Protected method CreateNavigator 已重载。 创建一个用于导航此文档的新 XPathNavigator 对象。
Protected method Supported by the .NET Compact Framework Finalize  允许 Object 在“垃圾回收”回收 Object 之前尝试释放资源并执行其他清理操作。 (从 Object 继承。)
Protected method Supported by the .NET Compact Framework MemberwiseClone  创建当前 Object 的浅表副本。 (从 Object 继承。)

页首

公共事件

  名称 说明
Public event Supported by the .NET Compact Framework NodeChanged 当属于该文档的节点的 Value 已被更改时发生。
Public event Supported by the .NET Compact Framework NodeChanging 当属于该文档的节点的 Value 将被更改时发生。
Public event Supported by the .NET Compact Framework NodeInserted 当属于该文档的节点已被插入另一个节点时发生。
Public event Supported by the .NET Compact Framework NodeInserting 当属于该文档的节点将被插入另一个节点时发生。
Public event Supported by the .NET Compact Framework NodeRemoved 当属于该文档的节点已被从其父级移除时发生。
Public event Supported by the .NET Compact Framework NodeRemoving 当属于该文档的节点将被从文档中移除时发生。

页首

请参见

参考

XmlDocument 类
System.Xml 命名空间
XmlNodeChangedEventHandler

其他资源

在 DOM 中创建新节点