XmlDocument 成员
表示 XML 文档。
下表列出了由 XmlDocument 类型公开的成员。
公共构造函数
(请参见 受保护的构造函数 )
名称 | 说明 | |
---|---|---|
XmlDocument | 已重载。初始化 XmlDocument 类的新实例。 |
页首
受保护的构造函数
名称 | 说明 | |
---|---|---|
XmlDocument | 已重载。初始化 XmlDocument 类的新实例。 |
页首
公共属性
名称 | 说明 | |
---|---|---|
Attributes | 获取一个 XmlAttributeCollection,它包含该节点的属性。(从 XmlNode 继承。) | |
BaseURI | 已重写。获取当前节点的基 URI。 | |
ChildNodes | 获取节点的所有子节点。(从 XmlNode 继承。) | |
DocumentElement | 获取文档的根 XmlElement。 | |
DocumentType | 获取包含 DOCTYPE 声明的节点。 | |
FirstChild | 获取节点的第一个子级。(从 XmlNode 继承。) | |
HasChildNodes | 获取一个值,该值指示节点是否有任何子节点。(从 XmlNode 继承。) | |
Implementation | 获取当前文档的 XmlImplementation 对象。 | |
InnerText | 获取或设置节点及其所有子节点的串联值。(从 XmlNode 继承。) | |
InnerXml | 已重写。获取或设置表示当前节点子级的标记。 | |
IsReadOnly | 已重写。获取一个值,该值指示当前节点是否是只读的。 | |
Item | 已重载。获取指定的子元素。(从 XmlNode 继承。) | |
LastChild | 获取节点的最后一个子级。(从 XmlNode 继承。) | |
LocalName | 已重写。获取节点的本地名称。 | |
Name | 已重写。获取节点的限定名。 | |
NamespaceURI | 获取该节点的命名空间 URI。(从 XmlNode 继承。) | |
NameTable | 获取与此实现关联的 XmlNameTable。 | |
NextSibling | 获取紧接在该节点之后的节点。(从 XmlNode 继承。) | |
NodeType | 已重写。获取当前节点的类型。 | |
OuterXml | 获取表示此节点及其所有子节点的标记。(从 XmlNode 继承。) | |
OwnerDocument | 已重写。获取当前节点所属的 XmlDocument。 | |
ParentNode | 已重写。获取该节点(对于可以具有父级的节点)的父级。 | |
Prefix | 获取或设置该节点的命名空间前缀。(从 XmlNode 继承。) | |
PreserveWhitespace | 获取或设置一个值,该值指示是否在元素内容中保留空白。 | |
PreviousSibling | 获取紧接在该节点之前的节点。(从 XmlNode 继承。) | |
SchemaInfo | 已重写。返回节点的后架构验证信息集 (PSVI)。 | |
Schemas | 获取或设置与此 XmlDocument 关联的 XmlSchemaSet 对象。 | |
Value | 获取或设置节点的值。(从 XmlNode 继承。) | |
XmlResolver | 设置 XmlResolver 以用于解析外部资源。 |
页首
公共方法
(请参见 受保护的方法 )
名称 | 说明 | |
---|---|---|
AppendChild | 将指定的节点添加到该节点的子节点列表的末尾。 (从 XmlNode 继承。) | |
Clone | 创建此节点的一个副本。 (从 XmlNode 继承。) | |
CloneNode | 已重写。 创建此节点的一个副本。 | |
CreateAttribute | 已重载。 创建具有指定名称的 XmlAttribute。 | |
CreateCDataSection | 创建包含指定数据的 XmlCDataSection。 | |
CreateComment | 创建包含指定数据的 XmlComment。 | |
CreateDocumentFragment | 创建 XmlDocumentFragment。 | |
CreateDocumentType | 返回新的 XmlDocumentType 对象。 | |
CreateElement | 已重载。 创建 XmlElement。 | |
CreateEntityReference | 创建具有指定名称的 XmlEntityReference。 | |
CreateNavigator | 已重载。 已重写。 创建一个用于导航此文档的新 XPathNavigator 对象。 | |
CreateNode | 已重载。 创建 XmlNode。 | |
CreateProcessingInstruction | 创建一个具有指定名称和数据的 XmlProcessingInstruction。 | |
CreateSignificantWhitespace | 创建一个 XmlSignificantWhitespace 节点。 | |
CreateTextNode | 创建具有指定文本的 XmlText。 | |
CreateWhitespace | 创建一个 XmlWhitespace 节点。 | |
CreateXmlDeclaration | 创建一个具有指定值的 XmlDeclaration 节点。 | |
Equals | 已重载。 确定两个 Object 实例是否相等。 (从 Object 继承。) | |
GetElementById | 获取具有指定 ID 的 XmlElement。 | |
GetElementsByTagName | 已重载。 返回一个 XmlNodeList,它包含与指定名称匹配的所有子代元素的列表。 | |
GetEnumerator | 提供对 XmlNode 中节点上“for each”样式迭代的支持。 (从 XmlNode 继承。) | |
GetHashCode | 用作特定类型的哈希函数。GetHashCode 适合在哈希算法和数据结构(如哈希表)中使用。 (从 Object 继承。) | |
GetNamespaceOfPrefix | 查找当前节点范围内离给定的前缀最近的 xmlns 声明,并返回声明中的命名空间 URI。 (从 XmlNode 继承。) | |
GetPrefixOfNamespace | 查找当前节点范围内离给定的命名空间 URI 最近的 xmlns 声明,并返回声明中定义的前缀。 (从 XmlNode 继承。) | |
GetType | 获取当前实例的 Type。 (从 Object 继承。) | |
ImportNode | 将节点从另一个文档导入到当前文档。 | |
InsertAfter | 将指定的节点紧接着插入指定的引用节点之后。 (从 XmlNode 继承。) | |
InsertBefore | 将指定的节点紧接着插入指定的引用节点之前。 (从 XmlNode 继承。) | |
Load | 已重载。 加载指定的 XML 数据。 | |
LoadXml | 从指定的字符串加载 XML 文档。 | |
Normalize | 将此 XmlNode 下子树完全深度中的所有 XmlText 节点都转换成“正常”形式,在这种形式中只有标记(即标记、注释、处理指令、CDATA 节和实体引用)分隔 XmlText 节点,也就是说,没有相邻的 XmlText 节点。 (从 XmlNode 继承。) | |
PrependChild | 将指定的节点添加到该节点的子节点列表的开头。 (从 XmlNode 继承。) | |
ReadNode | 根据 XmlReader 中的信息创建一个 XmlNode 对象。读取器必须定位在节点或属性上。 | |
ReferenceEquals | 确定指定的 Object 实例是否是相同的实例。 (从 Object 继承。) | |
RemoveAll | 移除当前节点的所有子节点和/或属性。 (从 XmlNode 继承。) | |
RemoveChild | 移除指定的子节点。 (从 XmlNode 继承。) | |
ReplaceChild | 用 newChild 节点替换子节点 oldChild。 (从 XmlNode 继承。) | |
Save | 已重载。 将 XML 文档保存到指定的位置。 | |
SelectNodes | 已重载。 选择匹配 XPath 表达式的节点列表。 (从 XmlNode 继承。) | |
SelectSingleNode | 已重载。 选择匹配 XPath 表达式的第一个 XmlNode。 (从 XmlNode 继承。) | |
Supports | 测试 DOM 实现是否实现特定的功能。 (从 XmlNode 继承。) | |
ToString | 返回表示当前 Object 的 String。 (从 Object 继承。) | |
Validate | 已重载。 验证 XmlDocument 是不是 Schemas 属性中包含的 XML 架构定义语言 (XSD) 架构。 | |
WriteContentTo | 已重写。 将 XmlDocument 节点的所有子级保存到指定的 XmlWriter 中。 | |
WriteTo | 已重写。 将 XmlDocument 节点保存到指定的 XmlWriter。 |
页首
受保护的方法
名称 | 说明 | |
---|---|---|
CreateDefaultAttribute | 创建具有指定前缀、本地名称和命名空间 URI 的默认属性。 | |
CreateNavigator | 已重载。 创建一个用于导航此文档的新 XPathNavigator 对象。 | |
Finalize | 允许 Object 在“垃圾回收”回收 Object 之前尝试释放资源并执行其他清理操作。 (从 Object 继承。) | |
MemberwiseClone | 创建当前 Object 的浅表副本。 (从 Object 继承。) |
页首
公共事件
名称 | 说明 | |
---|---|---|
NodeChanged | 当属于该文档的节点的 Value 已被更改时发生。 | |
NodeChanging | 当属于该文档的节点的 Value 将被更改时发生。 | |
NodeInserted | 当属于该文档的节点已被插入另一个节点时发生。 | |
NodeInserting | 当属于该文档的节点将被插入另一个节点时发生。 | |
NodeRemoved | 当属于该文档的节点已被从其父级移除时发生。 | |
NodeRemoving | 当属于该文档的节点将被从文档中移除时发生。 |
页首
请参见
参考
XmlDocument 类
System.Xml 命名空间
XmlNodeChangedEventHandler