XmlText 类

定义

表示元素或属性的文本内容。Represents the text content of an element or attribute.

public ref class XmlText : System::Xml::XmlCharacterData
public class XmlText : System.Xml.XmlCharacterData
type XmlText = class
    inherit XmlCharacterData
Public Class XmlText
Inherits XmlCharacterData
继承

构造函数

XmlText(String, XmlDocument)

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

属性

Attributes

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

(继承自 XmlNode)
BaseURI

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

(继承自 XmlNode)
ChildNodes

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

(继承自 XmlNode)
Data

包含节点的数据。Contains the data of the node.

(继承自 XmlCharacterData)
FirstChild

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

(继承自 XmlNode)
HasChildNodes

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

(继承自 XmlNode)
InnerText

获取或设置节点及该节点所有子级的串联值。Gets or sets the concatenated values of the node and all the children of the node.

(继承自 XmlCharacterData)
InnerXml

获取或设置仅表示该节点的子节点的标记。Gets or sets the markup representing only the child nodes of this node.

(继承自 XmlNode)
IsReadOnly

获取指示节点是否只读的值。Gets a value indicating whether the node is read-only.

(继承自 XmlNode)
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)
Length

获取数据的长度(以字符为单位)。Gets the length of the data, in characters.

(继承自 XmlCharacterData)
LocalName

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

Name

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

NamespaceURI

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

(继承自 XmlNode)
NextSibling

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

(继承自 XmlLinkedNode)
NodeType

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

OuterXml

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

(继承自 XmlNode)
OwnerDocument

获取此节点所属的 XmlDocumentGets the XmlDocument to which this node belongs.

(继承自 XmlNode)
ParentNode

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

Prefix

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

(继承自 XmlNode)
PreviousSibling

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

(继承自 XmlLinkedNode)
PreviousText

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

SchemaInfo

获取作为架构验证的结果分配给此节点的后架构验证信息集。Gets the post schema validation infoset that has been assigned to this node as a result of schema validation.

(继承自 XmlNode)
Value

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

方法

AppendChild(XmlNode)

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

(继承自 XmlNode)
AppendData(String)

将指定的字符串追加到节点的字符数据的结尾。Appends the specified string to the end of the character data of the node.

(继承自 XmlCharacterData)
Clone()

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

(继承自 XmlNode)
CloneNode(Boolean)

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

CreateNavigator()

创建 XPathNavigator 以浏览此对象。Creates an XPathNavigator for navigating this object.

(继承自 XmlNode)
DeleteData(Int32, Int32)

从节点移除一组字符。Removes a range of characters from the node.

(继承自 XmlCharacterData)
Equals(Object)

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

(继承自 Object)
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)
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)
InsertData(Int32, String)

从指定的字符偏移量开始插入指定的字符串。Inserts the specified string at the specified character offset.

(继承自 XmlCharacterData)
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)
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)
ReplaceData(Int32, Int32, String)

从指定的偏移量开始用指定的字符串替换指定数目的字符。Replaces the specified number of characters starting at the specified offset with the specified string.

(继承自 XmlCharacterData)
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)
SplitText(Int32)

在指定的偏移点将该节点拆分为两个节点,并使树中的这两个节点成为同级。Splits the node into two nodes at the specified offset, keeping both in the tree as siblings.

Substring(Int32, Int32)

在指定的范围内检索完整字符串的子字符串。Retrieves a substring of the full string from the specified range.

(继承自 XmlCharacterData)
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)
WriteContentTo(XmlWriter)

将该节点的所有子项保存到指定的 XmlWriter 中。Saves all the children of the node to the specified XmlWriter. 由于 XmlText 节点没有子级,因此该方法无效。XmlText nodes do not have children, so this method has no effect.

WriteTo(XmlWriter)

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

显式接口实现

ICloneable.Clone()

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

(继承自 XmlNode)
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.

CreateNavigator(XmlNode)
SelectNodes(XmlNode, String)
SelectNodes(XmlNode, String, XmlNamespaceManager)
SelectSingleNode(XmlNode, String)
SelectSingleNode(XmlNode, String, XmlNamespaceManager)
ToXPathNavigable(XmlNode)

适用于

另请参阅