Doc-O-Matic Live Demo / Microsoft Namespace / Microsoft.Xml Namespace / Classes / XPathGenerator / XPathGenerator Methods (Microsoft.Xml) / XPathGenerator.GetXPath
XPathGenerator.GetXPath
Close
domv10-banner-200
XPathGenerator.GetXPath Method

Namespace: Microsoft.Xml

Return an XPath that will locate the given node within it's document and populate an XmlNamespaceManager with the namespace prefixes used in that XPath query. You can then use this XmlNamespaceManager in the call the SelectNodes or SelectSingleNode methods.

C++
C#
Visual Basic
IDL
JavaScript
string GetXPath(XmlNode node, XmlNamespaceManager nsmgr);
Parameters
Description
XmlNode node
The node to locate via XPath
XmlNamespaceManager nsmgr
A namespace manager, it may be empty or it may be pre-populated with the prefixes you want to use. Either way if a namespace prefix is needed that is not defined or if it conflicts with another definition then a new prefix will be generated automatically.

The XPath expression needed to locate the given node or null if the node is not locatable by XPath because of it's NodeType.

Copyright © 2020. All rights reserved.