XPathExpression

An XPathExpression is a compiled XPath query returned from document.createExpression(). It has a method evaluate() which can be used to execute the compiled XPath.

Methods

XPathExpression.evaluate()
provide a context node/document, XPathResult constant, and XPathResult to store the query or null to return a new XPathResult.
XPathExpression.evaluateWithContext()
provide a context node/document, context position, context size, XPathResult constant, and XPathResult to store the query or null to return a new XPathResult.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support Yes ? Yes ? Yes ?
evaluate Yes ? Yes ? Yes ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support ? Yes ? Yes Yes ? Yes
evaluate ? Yes ? Yes Yes ? Yes

See also

Document Tags and Contributors

Contributors to this page: ExE-Boss, fscholz, Jeremie, BlindWanderer, Brettz9
Last updated by: ExE-Boss,