XMLNode 接口

定义

表示应用于文档的单个 XML 元素。Represents a single XML element applied to a document.

public interface class XMLNode
[System.Runtime.InteropServices.Guid("09760240-0B89-49F7-A79D-479F24723F56")]
public interface XMLNode
type XMLNode = interface
Public Interface XMLNode
属性

注解

每个已应用于文档的 XML 元素都显示为“XML 结构”任务窗格的树视图控件中的一个节点。Each XML element that has been applied to a document is displayed as a node in a tree view control in the XML Structure task pane. 树视图中的每个节点都是一个 XMLNode 对象实例。Each node in the tree view is an instance of an XMLNode object. 树视图的层次结构表明节点是否包含子节点。The hierarchy in the tree view indicates whether a node contains child nodes.

使用 Item[Int32] 集合的属性 XMLNodes 返回单个 XMLNode 对象。Use the Item[Int32] property of the XMLNodes collection to return an individual XMLNode object. 使用 Validate() 方法来验证 XML 元素是否有效,具体取决于所应用的架构以及任何必需的子元素是否存在并按所需顺序排列。Use the Validate() method to verify that an XML element is valid according to the applied schemas and that any required child elements exist and are in the required order. 运行 Validate() 方法后,请使用 ValidationStatus 属性验证元素是否有效,并使用 ValidationErrorText[Boolean] 属性显示有关用户需要执行哪些操作才能使文档符合 XML 架构规则的信息。Once you run the Validate() method, use the ValidationStatus property to verify whether an element is valid, and use the ValidationErrorText[Boolean] property to display information about what the user needs to do to make the document conform to the XML schema rules.

属性

Application

返回一个 Application 代表 Microsoft Word 应用程序的对象。Returns a Application object that represents the Microsoft Word application.

Attributes

返回一个 XMLNodes 集合,该集合代表指定元素的属性。Returns a XMLNodes collection that represents the attributes for the specified element.

BaseName

返回一个 字符串 ,表示不带前缀的元素名称。Returns a String that represents the name of the element without any prefix.

ChildNodes

返回一个 XMLNodes 集合,该集合代表指定元素的子元素。Returns a XMLNodes collection that represents the child elements of a specified element.

ChildNodeSuggestions

返回一个 XMLChildNodeSuggestions 集合,该集合代表对象的允许元素的列表 XMLNode (该集合返回指定元素的子元素)。Returns a XMLChildNodeSuggestions collection that represents the list of allowed elements for the XMLNode object (which returns the child elements of a specified element).

Creator

返回一个 32 位整数,它指示在其中创建指定的对象的应用程序。Returns a 32-bit integer that indicates the application in which the specified object was created.

FirstChild

返回一个 DiagramNode 对象,表示父节点的第一个子节点。Returns a DiagramNode object that represents the first child node of a parent node.

HasChildNodes

确定指定的 XML 元素是否具有子元素。Determines if the specified XML element has child elements.

LastChild

返回一个 DiagramNode object 类型的对象,该对象代表父节点的最后一个子节点。Returns a DiagramNode object that represents the last child node of a parent node.

Level

返回应用于文档的元素层次结构中指定的 XML 元素的级别。Returns the level of the specified XML element within the hierarchy of elements applied to a document.

NamespaceURI

返回一个代表指定对象的架构命名空间统一资源标识符 (URI) 的 字符串Returns a String that represents the Uniform Resource Identifier (URI) of the schema namespace for the specified object.

NextSibling

返回一个 XMLNode 对象,表示文档中与指定元素处于同一级别的下一个元素。Returns a XMLNode object that represents the next element in the document that is at the same level as the specified element.

NodeType

返回一个 WdXMLNodeType 常量,该常量代表节点的类型。Returns a WdXMLNodeType constant that represents the type of node.

NodeValue

返回或设置一个字符串,表示属性的值。Returns or sets a String that represents the value of an attribute.

OwnerDocument

返回一个 Document 对象,表示指定的 XML 元素的父文档。Returns a Document object that represents the parent document of the specified XML element.

Parent

返回一个对象,代表指定对象的父对象。Returns an object that represents the parent object of the specified object.

ParentNode

返回一个 XMLNode 对象,表示指定元素的父元素。Returns a XMLNode object that represents the parent element of the specified element.

PlaceholderText

返回或设置一个字符串,表示为不包含文本的元素显示的文本。Returns or sets a String that represents the text displayed for an element that contains no text.

PreviousSibling

返回一个 XMLNode 对象,表示文档中与指定元素处于相同级别的上一个元素。Returns a XMLNode object that represents the previous element in the document that is at the same level as the specified element.

Range

返回一个 Range object 类型的对象,该对象代表指定对象中包含的文档部分。Returns a Range object that represents the portion of a document that's contained in the specified object.

SmartTag

返回一个 SmartTag 对象,表示与 XML 元素相关联的智能标记。Returns a SmartTag object that represents the smart tag associated with an XML element.

Text

返回或设置一个字符串,表示为 XML 元素显示的文本。Returns or sets a String that represents the text displayed for an XML element.

ValidationErrorText[Boolean]

返回一个字符串,表示对某个对象的验证错误的说明 XMLNodeReturns a String that represents the description for a validation error on an XMLNode object.

ValidationStatus

返回一个 WdXMLValidationStatus 常量,该常量表示元素或属性是否有效,具体取决于附加的架构。Returns a WdXMLValidationStatus constant that represents whether an element or attribute is valid according to the attached schema.

WordOpenXML

返回一个字符串,表示 Microsoft Office WORD Open xml 格式的节点的 XML。Returns a String that represents the XML for the node in the Microsoft Office Word Open XML format. 只读。Read-only.

XML[Boolean]

返回一个字符串,表示指定对象中的 XML 文本。Returns a String that represents the XML text in the specified object.

方法

Copy()

将指定对象复制到剪贴板。Copies the specified object to the Clipboard.

Cut()

将指定对象从文档中移到剪贴板上。Removes the specified object from the document and places it on the Clipboard.

Delete()

删除指定的对象。Deletes the specified object.

RemoveChild(XMLNode)

从指定的元素中移除指定的子元素。Removes the specified child element from the specified element.

SelectNodes(String, String, Boolean)

返回一个 XMLNodes 集合,该集合代表与指定的 XPath 字符串相匹配的所有节点,并以它们出现的顺序匹配。Returns a XMLNodes collection that represents all the nodes that match a specified XPath string in the order in which they appear.

SelectSingleNode(String, String, Boolean)

返回一个 XMLNode 对象,表示与指定的文档中指定的 XPath 字符串相匹配的第一个节点。Returns an XMLNode object that represents the first node that matches a specified XPath string in the specified document.

SetValidationError(WdXMLValidationStatus, Object, Boolean)

将显示的验证错误文本更改为指定节点的用户,并强制 Microsoft Word 将节点报告为无效。Changes the validation error text displayed to a user for a specified node and forces Microsoft Word to report a node as invalid.

Validate()

对附加的 XML 架构或架构验证单个 XML 元素或整个文档。Verifies an individual XML element or the entire document against the attached XML schema or schemas.

适用于