_Document.SelectSingleNode(String, String, Boolean) 方法

定义

返回一个 XMLNode 对象,表示指定文档中的节点。Returns an XMLNode object that represents a node in the specified document.

public Microsoft.Office.Interop.Word.XMLNode SelectSingleNode (string XPath, string PrefixMapping = "", bool FastSearchSkippingTextNodes = false);
abstract member SelectSingleNode : string * string * bool -> Microsoft.Office.Interop.Word.XMLNode
Public Function SelectSingleNode (XPath As String, Optional PrefixMapping As String = "", Optional FastSearchSkippingTextNodes As Boolean = false) As XMLNode

参数

XPath
String

必需的 字符串Required String. 有效的 XPath 字符串。A valid XPath string. 有关 XPath 的详细信息,请参阅 Microsoft Developer Network (MSDN) 网站上的 XPath 参考文档。For more information on XPath, see the XPath reference documentation on the Microsoft Developer Network (MSDN) Web site.

PrefixMapping
String

可选对象Optional Object. 提供用于搜索的架构中的前缀。Provides the prefix in the schema against which to perform the search. PrefixMapping如果 XPath 参数使用名称搜索元素,请使用参数。Use the PrefixMapping parameter if your XPath parameter uses names to search for elements.

FastSearchSkippingTextNodes
Boolean

可选属性,类型为 BooleanOptional Boolean. 所有文本节点都搜索时跳过指定的节点。True skips all text nodes while searching for the specified node. 在搜索中包含文本节点。False includes text nodes in the search. 默认值为 TrueDefault value is True.

返回

XMLNode

注解

将此 FastSearchSkippingTextNodes 参数设置为False会降低性能,因为 Microsoft Word 会针对节点中包含的文本搜索文档中的所有节点。Setting the FastSearchSkippingTextNodes parameter to False diminishes performance because Microsoft Word searches all nodes in a document against the text contained in the node.

适用于