Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 932585 of XPathExpression

  • Revision slug: Web/API/XPathExpression
  • Revision title: XPathExpression
  • Revision id: 932585
  • Created:
  • Creator: fscholz
  • Is current revision? Yes
  • Comment

Revision Content

{{APIRef}}

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

Methods

  • evaluate (contextNode, type, result) - provide a context node/document, {{domxref("XPathResult")}} constant, and XPathResult to store the query or null to return a new XPathResult.
  • evaluateWithContext (contextNode, contextPosition, contextSize, type, result) - provide a context node/document, context position, context size, XPathResult constant, and XPathResult to store the query or null to return a new XPathResult.

Revision Source

<p>{{APIRef}}</p>

<p>An <code>XPathExpression</code> is a compiled XPath query returned from {{domxref("document.createExpression()")}}. It has a method <code>evaluate()</code> which can be used to execute the compiled XPath.</p>

<h2 id="Methods" name="Methods">Methods</h2>

<ul>
 <li>evaluate (<code>contextNode</code>, <code>type</code>, <code>result</code>) - provide a context node/document, {{domxref("XPathResult")}} constant, and <code>XPathResult</code> to store the query or null to return a new XPathResult.</li>
 <li>evaluateWithContext (<code>contextNode</code>, <code>contextPosition</code>, <code>contextSize</code>, <code>type</code>, <code>result</code>) - provide a context node/document, context position, context size, <code>XPathResult</code> constant, and <code>XPathResult</code> to store the query or null to return a new XPathResult.</li>
</ul>
Revert to this revision