Documentation Language: Swift

Method

xpath(_:context:)

Evaluates an XPath expression in an existing libxml2 XPath context.

func xpath(_ path: String, context: xmlXPathContextPtr) -> XMLPath?

Parameters

path

The XPath expression to compile.

context

The XPath context to evaluate the expression in.

Return Value

A compiled XPath result, or nil if evaluation fails.

Discussion

Use this overload when you need full control over the prepared context, such as custom variable registration performed outside SwiftLibXML.