SelectSingleNode()

XPathNavigator::SelectSingleNode(String) method

Selects a single node in the XPathNavigator using the specified XPath query.

virtual SharedPtr<XPathNavigator> System::Xml::XPath::XPathNavigator::SelectSingleNode(String xpath)

Arguments

ParameterTypeDescription
xpathStringA String representing an XPath expression.

Return Value

An XPathNavigator object that contains the first matching node for the XPath query specified; otherwise, nullptr if there are no query results.

XPathNavigator::SelectSingleNode(String, SharedPtr<IXmlNamespaceResolver>) method

Selects a single node in the XPathNavigator object using the specified XPath query with the IXmlNamespaceResolver object specified to resolve namespace prefixes.

virtual SharedPtr<XPathNavigator> System::Xml::XPath::XPathNavigator::SelectSingleNode(String xpath, SharedPtr<IXmlNamespaceResolver> resolver)

Arguments

ParameterTypeDescription
xpathStringA String representing an XPath expression.
resolverSharedPtr<IXmlNamespaceResolver>The IXmlNamespaceResolver object used to resolve namespace prefixes in the XPath query.

Return Value

An XPathNavigator object that contains the first matching node for the XPath query specified; otherwise nullptr if there are no query results.

XPathNavigator::SelectSingleNode(SharedPtr<XPathExpression>) method

Selects a single node in the XPathNavigator using the specified XPathExpression object.

virtual SharedPtr<XPathNavigator> System::Xml::XPath::XPathNavigator::SelectSingleNode(SharedPtr<XPathExpression> expression)

Arguments

ParameterTypeDescription
expressionSharedPtr<XPathExpression>An XPathExpression object containing the compiled XPath query.

Return Value

An XPathNavigator object that contains the first matching node for the XPath query specified; otherwise nullptr if there are no query results.

See Also