ConfigXmlDocument 类

定义

包装相应的 XmlDocument 类型并带有报告文件名和行号所需的信息。Wraps the corresponding XmlDocument type and also carries the necessary information for reporting file-name and line numbers.

此 API 支持产品基础结构,不能在代码中直接使用。

public ref class ConfigXmlDocument sealed : System::Xml::XmlDocument, System::Configuration::Internal::IConfigErrorInfo
public ref class ConfigXmlDocument sealed : System::Xml::XmlDocument
public sealed class ConfigXmlDocument : System.Xml.XmlDocument, System.Configuration.Internal.IConfigErrorInfo
public sealed class ConfigXmlDocument : System.Xml.XmlDocument
type ConfigXmlDocument = class
    inherit XmlDocument
    interface IConfigErrorInfo
type ConfigXmlDocument = class
    inherit XmlDocument
Public NotInheritable Class ConfigXmlDocument
Inherits XmlDocument
Implements IConfigErrorInfo
Public NotInheritable Class ConfigXmlDocument
Inherits XmlDocument
继承
ConfigXmlDocument
实现

注解

ConfigXmlDocument 包装相应的 XmlDocument 类型,以提供报告文件名和行号所需的信息。The ConfigXmlDocument wraps the corresponding XmlDocument type to carry the necessary information for reporting file-name and line numbers. 当系统发出配置错误时,此信息是必需的。This information is necessary when the system issues configuration errors.

构造函数

ConfigXmlDocument()

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

属性

Attributes

获取一个 XmlAttributeCollection,它包含该节点的特性。Gets an XmlAttributeCollection containing the attributes of this node.

(继承自 XmlNode)
BaseURI

获取当前节点的基 URI。Gets the base URI of the current node.

(继承自 XmlDocument)
ChildNodes

获取节点的所有子节点。Gets all the child nodes of the node.

(继承自 XmlNode)
DocumentElement

获取文档的根 XmlElementGets the root XmlElement for the document.

(继承自 XmlDocument)
DocumentType

获取包含 DOCTYPE 声明的节点。Gets the node containing the DOCTYPE declaration.

(继承自 XmlDocument)
Filename

获取配置文件名。Gets the configuration file name.

FirstChild

获取节点的第一个子级。Gets the first child of the node.

(继承自 XmlNode)
HasChildNodes

获取一个值,该值指示此节点是否有任何子节点。Gets a value indicating whether this node has any child nodes.

(继承自 XmlNode)
Implementation

获取当前文档的 XmlImplementation 对象。Gets the XmlImplementation object for the current document.

(继承自 XmlDocument)
InnerText

在所有情况下引发 InvalidOperationExceptionThrows an InvalidOperationException in all cases.

(继承自 XmlDocument)
InnerXml

获取或设置表示当前节点的子级的标记。Gets or sets the markup representing the children of the current node.

(继承自 XmlDocument)
IsReadOnly

获取一个值,该值指示当前节点是否是只读的。Gets a value indicating whether the current node is read-only.

(继承自 XmlDocument)
Item[String, String]

获取具有指定 LocalNameNamespaceURI 的第一个子元素。Gets the first child element with the specified LocalName and NamespaceURI.

(继承自 XmlNode)
Item[String]

获取具有指定 Name 的第一个子元素。Gets the first child element with the specified Name.

(继承自 XmlNode)
LastChild

获取节点的最后一个子级。Gets the last child of the node.

(继承自 XmlNode)
LineNumber

获取当前节点行号。Gets the current node line number.

LocalName

获取节点的本地名称。Gets the local name of the node.

(继承自 XmlDocument)
Name

获取节点的限定名称。Gets the qualified name of the node.

(继承自 XmlDocument)
NamespaceURI

获取该节点的命名空间 URI。Gets the namespace URI of this node.

(继承自 XmlNode)
NameTable

获取与此实现关联的 XmlNameTableGets the XmlNameTable associated with this implementation.

(继承自 XmlDocument)
NextSibling

获取紧接在该节点之后的节点。Gets the node immediately following this node.

(继承自 XmlNode)
NodeType

获取当前节点的类型。Gets the type of the current node.

(继承自 XmlDocument)
OuterXml

获取包含此节点及其所有子节点的标记。Gets the markup containing this node and all its child nodes.

(继承自 XmlNode)
OwnerDocument

获取当前节点所属的 XmlDocumentGets the XmlDocument to which the current node belongs.

(继承自 XmlDocument)
ParentNode

获取该节点的父节点(针对可以拥有父级的节点)。Gets the parent node of this node (for nodes that can have parents).

(继承自 XmlDocument)
Prefix

获取或设置该节点的命名空间前缀。Gets or sets the namespace prefix of this node.

(继承自 XmlNode)
PreserveWhitespace

获取或设置一个值,该值指示是否在元素内容中保留空白区域。Gets or sets a value indicating whether to preserve white space in element content.

(继承自 XmlDocument)
PreviousSibling

获取紧接在该节点之前的节点。Gets the node immediately preceding this node.

(继承自 XmlNode)
PreviousText

获取紧接在该节点之前的文本节点。Gets the text node that immediately precedes this node.

(继承自 XmlNode)
SchemaInfo

返回节点的后架构验证信息集 (PSVI)。Returns the Post-Schema-Validation-Infoset (PSVI) of the node.

(继承自 XmlDocument)
Schemas

获取或设置与此 XmlDocument 关联的 XmlSchemaSet 对象。Gets or sets the XmlSchemaSet object associated with this XmlDocument.

(继承自 XmlDocument)
Value

获取或设置节点的值。Gets or sets the value of the node.

(继承自 XmlNode)
XmlResolver

设置 XmlResolver 以用于解析外部资源。Sets the XmlResolver to use for resolving external resources.

(继承自 XmlDocument)

方法

AppendChild(XmlNode)

将指定的节点添加到该节点的子节点列表的末尾。Adds the specified node to the end of the list of child nodes, of this node.

(继承自 XmlNode)
Clone()

创建此节点的副本。Creates a duplicate of this node.

(继承自 XmlNode)
CloneNode(Boolean)

创建此节点的副本。Creates a duplicate of this node.

(继承自 XmlDocument)
CreateAttribute(String)

创建具有指定 NameXmlAttributeCreates an XmlAttribute with the specified Name.

(继承自 XmlDocument)
CreateAttribute(String, String)

创建具有指定限定名和 NamespaceURIXmlAttributeCreates an XmlAttribute with the specified qualified name and NamespaceURI.

(继承自 XmlDocument)
CreateAttribute(String, String, String)

创建配置元素特性。Creates a configuration element attribute.

CreateCDataSection(String)

创建 XML CData 节。Creates an XML CData section.

CreateComment(String)

创建 XML 注释。Create an XML comment.

CreateDefaultAttribute(String, String, String)

创建具有指定前缀、本地名称和命名空间 URI 的默认属性。Creates a default attribute with the specified prefix, local name and namespace URI.

(继承自 XmlDocument)
CreateDocumentFragment()

创建 XmlDocumentFragmentCreates an XmlDocumentFragment.

(继承自 XmlDocument)
CreateDocumentType(String, String, String, String)

返回新 XmlDocumentType 对象。Returns a new XmlDocumentType object.

(继承自 XmlDocument)
CreateElement(String)

创建具有指定名称的元素。Creates an element with the specified name.

(继承自 XmlDocument)
CreateElement(String, String)

创建具有限定名和 NamespaceURIXmlElementCreates an XmlElement with the qualified name and NamespaceURI.

(继承自 XmlDocument)
CreateElement(String, String, String)

创建配置元素。Creates a configuration element.

CreateEntityReference(String)

创建具有指定名称的 XmlEntityReferenceCreates an XmlEntityReference with the specified name.

(继承自 XmlDocument)
CreateNavigator()

创建一个用于导航此文档的新 XPathNavigator 对象。Creates a new XPathNavigator object for navigating this document.

(继承自 XmlDocument)
CreateNavigator(XmlNode)

创建 XPathNavigator 对象,以定位位于指定的 XmlNode 上的此文档。Creates an XPathNavigator object for navigating this document positioned on the XmlNode specified.

(继承自 XmlDocument)
CreateNode(String, String, String)

创建具有指定的节点类型、NameNamespaceURIXmlNodeCreates an XmlNode with the specified node type, Name, and NamespaceURI.

(继承自 XmlDocument)
CreateNode(XmlNodeType, String, String)

创建一个具有指定的 XmlNodeTypeNameNamespaceURIXmlNodeCreates an XmlNode with the specified XmlNodeType, Name, and NamespaceURI.

(继承自 XmlDocument)
CreateNode(XmlNodeType, String, String, String)

创建一个具有指定的XmlNodeTypePrefixNameNamespaceURIXmlNodeCreates a XmlNode with the specified XmlNodeType, Prefix, Name, and NamespaceURI.

(继承自 XmlDocument)
CreateProcessingInstruction(String, String)

创建一个具有指定名称和数据的 XmlProcessingInstructionCreates an XmlProcessingInstruction with the specified name and data.

(继承自 XmlDocument)
CreateSignificantWhitespace(String)

创建空格。Creates white spaces.

CreateTextNode(String)

创建文本节点。Create a text node.

CreateWhitespace(String)

创建空格。Creates white space.

CreateXmlDeclaration(String, String, String)

创建一个具有指定值的 XmlDeclaration 节点。Creates an XmlDeclaration node with the specified values.

(继承自 XmlDocument)
Equals(Object)

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

(继承自 Object)
GetElementById(String)

获取具有指定 ID 的 XmlElementGets the XmlElement with the specified ID.

(继承自 XmlDocument)
GetElementsByTagName(String)

返回一个 XmlNodeList,它包含与指定 Name 匹配的所有子代元素的列表。Returns an XmlNodeList containing a list of all descendant elements that match the specified Name.

(继承自 XmlDocument)
GetElementsByTagName(String, String)

返回一个 XmlNodeList,它包含与指定 LocalNameNamespaceURI 匹配的所有子代元素的列表。Returns an XmlNodeList containing a list of all descendant elements that match the specified LocalName and NamespaceURI.

(继承自 XmlDocument)
GetEnumerator()

获取循环访问当前节点中子节点的枚举数。Gets an enumerator that iterates through the child nodes in the current node.

(继承自 XmlNode)
GetHashCode()

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

(继承自 Object)
GetNamespaceOfPrefix(String)

查找当前节点范围内离给定的前缀最近的 xmlns 声明,并返回声明中的命名空间 URI。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.

(继承自 XmlNode)
GetPrefixOfNamespace(String)

查找当前节点范围内离给定的命名空间 URI 最近的 xmlns 声明,并返回声明中定义的前缀。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.

(继承自 XmlNode)
GetType()

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

(继承自 Object)
ImportNode(XmlNode, Boolean)

将节点从另一个文档导入到当前文档。Imports a node from another document to the current document.

(继承自 XmlDocument)
InsertAfter(XmlNode, XmlNode)

将指定的节点紧接着插入指定的引用节点之后。Inserts the specified node immediately after the specified reference node.

(继承自 XmlNode)
InsertBefore(XmlNode, XmlNode)

将指定的节点紧接着插入指定的引用节点之前。Inserts the specified node immediately before the specified reference node.

(继承自 XmlNode)
Load(Stream)

从指定的流加载 XML 文档。Loads the XML document from the specified stream.

(继承自 XmlDocument)
Load(String)

加载配置文件。Loads the configuration file.

Load(TextReader)

从指定的 TextReader 加载 XML 文档。Loads the XML document from the specified TextReader.

(继承自 XmlDocument)
Load(XmlReader)

从指定的 XmlReader 加载 XML 文档。Loads the XML document from the specified XmlReader.

(继承自 XmlDocument)
LoadSingleElement(String, XmlTextReader)

加载单个配置元素。Loads a single configuration element.

LoadXml(String)

从指定的字符串加载 XML 文档。Loads the XML document from the specified string.

(继承自 XmlDocument)
MemberwiseClone()

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

(继承自 Object)
Normalize()

将此 XmlNode 下子树完全深度中的所有 XmlText 节点都转换成“正常”形式,在这种形式中只有标记(即标记、注释、处理指令、CDATA 节和实体引用)分隔 XmlText 节点,也就是说,没有相邻的 XmlText 节点。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.

(继承自 XmlNode)
PrependChild(XmlNode)

将指定的节点添加到该节点的子节点列表的开头。Adds the specified node to the beginning of the list of child nodes for this node.

(继承自 XmlNode)
ReadNode(XmlReader)

根据 XmlReader 中的信息创建一个 XmlNode 对象。Creates an XmlNode object based on the information in the XmlReader. 读取器必须定位在节点或属性上。The reader must be positioned on a node or attribute.

(继承自 XmlDocument)
RemoveAll()

移除当前节点的所有子节点和/或属性。Removes all the child nodes and/or attributes of the current node.

(继承自 XmlNode)
RemoveChild(XmlNode)

移除指定的子节点。Removes specified child node.

(继承自 XmlNode)
ReplaceChild(XmlNode, XmlNode)

oldChild 节点替换子节点 newChildReplaces the child node oldChild with newChild node.

(继承自 XmlNode)
Save(Stream)

将 XML 文档保存到指定的流。Saves the XML document to the specified stream.

(继承自 XmlDocument)
Save(String)

将 XML 文档保存到指定的文件。Saves the XML document to the specified file. 如果存在指定文件,则此方法会覆盖它。If the specified file exists, this method overwrites it.

(继承自 XmlDocument)
Save(TextWriter)

将 XML 文档保存到指定的 TextWriterSaves the XML document to the specified TextWriter.

(继承自 XmlDocument)
Save(XmlWriter)

将 XML 文档保存到指定的 XmlWriterSaves the XML document to the specified XmlWriter.

(继承自 XmlDocument)
SelectNodes(String)

选择匹配 XPath 表达式的节点列表。Selects a list of nodes matching the XPath expression.

(继承自 XmlNode)
SelectNodes(String, XmlNamespaceManager)

选择匹配 XPath 表达式的节点列表。Selects a list of nodes matching the XPath expression. XPath 表达式中的任何前缀都使用提供的 XmlNamespaceManager 进行解析。Any prefixes found in the XPath expression are resolved using the supplied XmlNamespaceManager.

(继承自 XmlNode)
SelectSingleNode(String)

选择匹配 XPath 表达式的第一个 XmlNodeSelects the first XmlNode that matches the XPath expression.

(继承自 XmlNode)
SelectSingleNode(String, XmlNamespaceManager)

选择匹配 XPath 表达式的第一个 XmlNodeSelects the first XmlNode that matches the XPath expression. XPath 表达式中的任何前缀都使用提供的 XmlNamespaceManager 进行解析。Any prefixes found in the XPath expression are resolved using the supplied XmlNamespaceManager.

(继承自 XmlNode)
Supports(String, String)

测试 DOM 实现是否实现特定的功能。Tests if the DOM implementation implements a specific feature.

(继承自 XmlNode)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)
Validate(ValidationEventHandler)

验证 XmlDocument 是不是 Schemas 属性中包含的 XML 架构定义语言 (XSD) 架构。Validates the XmlDocument against the XML Schema Definition Language (XSD) schemas contained in the Schemas property.

(继承自 XmlDocument)
Validate(ValidationEventHandler, XmlNode)

根据 Schemas 属性中的 XML 架构定义语言 (XSD) 架构,验证指定的 XmlNode 对象。Validates the XmlNode object specified against the XML Schema Definition Language (XSD) schemas in the Schemas property.

(继承自 XmlDocument)
WriteContentTo(XmlWriter)

XmlDocument 节点的所有子级保存到指定的 XmlWriter 中。Saves all the children of the XmlDocument node to the specified XmlWriter.

(继承自 XmlDocument)
WriteTo(XmlWriter)

XmlDocument 节点保存到指定的 XmlWriterSaves the XmlDocument node to the specified XmlWriter.

(继承自 XmlDocument)

事件

NodeChanged

当属于该文档的节点的 Value 已被更改时发生。Occurs when the Value of a node belonging to this document has been changed.

(继承自 XmlDocument)
NodeChanging

当属于该文档的节点的 Value 将被更改时发生。Occurs when the Value of a node belonging to this document is about to be changed.

(继承自 XmlDocument)
NodeInserted

将属于该文档的节点插入另一个节点时发生。Occurs when a node belonging to this document has been inserted into another node.

(继承自 XmlDocument)
NodeInserting

当属于该文档的节点将被插入另一个节点时发生。Occurs when a node belonging to this document is about to be inserted into another node.

(继承自 XmlDocument)
NodeRemoved

当属于该文档的节点已从其父级中移除时发生。Occurs when a node belonging to this document has been removed from its parent.

(继承自 XmlDocument)
NodeRemoving

当属于该文档的节点将从文档中移除时发生。Occurs when a node belonging to this document is about to be removed from the document.

(继承自 XmlDocument)

显式接口实现

ICloneable.Clone()

有关此成员的说明,请参见 Clone()For a description of this member, see Clone().

(继承自 XmlNode)
IConfigErrorInfo.Filename

获取配置文件名。Gets the configuration file name.

IConfigErrorInfo.LineNumber

获取配置行号。Gets the configuration line number.

IEnumerable.GetEnumerator()

有关此成员的说明,请参见 GetEnumerator()For a description of this member, see GetEnumerator().

(继承自 XmlNode)

扩展方法

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.

适用于

另请参阅