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 932591 of XPathResult

  • Revision slug: Web/API/XPathResult
  • Revision title: XPathResult
  • Revision id: 932591
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment cleaning
Tags: 

Revision Content

{{APIRef}}

Properties

{{domxref("XPathResult.booleanValue
readonly boolean
{{domxref("XPathResult.invalidIteratorState")}}
readonly boolean
{{domxref("XPathResult.numberValue")}}
readonly float
{{domxref("XPathResult.resultType")}}
readonly integer (short)
{{domxref("XPathResult.singleNodeValue")}}
readonly Node
{{domxref("XPathResult.snapshotLength")}}
readonly Integer
{{domxref("XPathResult.stringValue")}}
readonly String

Methods

{{domxref("XPathResult.iterateNext()")}}
...
{{domxref("XPathResult.snapshotItem()")}}
...

Constants

Result Type Defined Constant Value Description
ANY_TYPE 0 A result set containing whatever type naturally results from evaluation of the expression. Note that if the result is a node-set then UNORDERED_NODE_ITERATOR_TYPE is always the resulting type.
NUMBER_TYPE 1 A result containing a single number. This is useful for example, in an XPath expression using the count() function.
STRING_TYPE 2 A result containing a single string.
BOOLEAN_TYPE 3 A result containing a single boolean value. This is useful for example, in an XPath expression using the not() function.
UNORDERED_NODE_ITERATOR_TYPE 4 A result node-set containing all the nodes matching the expression. The nodes may not necessarily be in the same order that they appear in the document.
ORDERED_NODE_ITERATOR_TYPE 5 A result node-set containing all the nodes matching the expression. The nodes in the result set are in the same order that they appear in the document.
UNORDERED_NODE_SNAPSHOT_TYPE 6 A result node-set containing snapshots of all the nodes matching the expression. The nodes may not necessarily be in the same order that they appear in the document.
ORDERED_NODE_SNAPSHOT_TYPE 7 A result node-set containing snapshots of all the nodes matching the expression. The nodes in the result set are in the same order that they appear in the document.
ANY_UNORDERED_NODE_TYPE 8 A result node-set containing any single node that matches the expression. The node is not necessarily the first node in the document that matches the expression.
FIRST_ORDERED_NODE_TYPE 9 A result node-set containing the first node in the document that matches the expression.

See also

  • {{domxref("Document.evaluate()")}}

Revision Source

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

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

<dl>
 <dt>{{domxref("XPathResult.booleanValue</dt>
 <dd>readonly boolean</dd>
</dl>

<dl>
 <dt>{{domxref("XPathResult.invalidIteratorState")}}</dt>
 <dd>readonly boolean</dd>
</dl>

<dl>
 <dt>{{domxref("XPathResult.numberValue")}}</dt>
 <dd>readonly float</dd>
</dl>

<dl>
 <dt>{{domxref("XPathResult.resultType")}}</dt>
 <dd>readonly integer (short)</dd>
</dl>

<dl>
 <dt>{{domxref("XPathResult.singleNodeValue")}}</dt>
 <dd>readonly Node</dd>
</dl>

<dl>
 <dt>{{domxref("XPathResult.snapshotLength")}}</dt>
 <dd>readonly Integer</dd>
</dl>

<dl>
 <dt>{{domxref("XPathResult.stringValue")}}</dt>
 <dd>readonly String</dd>
</dl>

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

<dl>
 <dt>{{domxref("XPathResult.iterateNext()")}}</dt>
 <dd>...</dd>
 <dt>{{domxref("XPathResult.snapshotItem()")}}</dt>
 <dd>...</dd>
</dl>

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

<table class="standard-table">
 <thead>
  <tr>
   <td class="header">Result Type Defined Constant</td>
   <td class="header">Value</td>
   <td class="header">Description</td>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>ANY_TYPE</td>
   <td>0</td>
   <td>A result set containing whatever type naturally results from evaluation of the expression. Note that if the result is a node-set then UNORDERED_NODE_ITERATOR_TYPE is always the resulting type.</td>
  </tr>
  <tr>
   <td>NUMBER_TYPE</td>
   <td>1</td>
   <td>A result containing a single number. This is useful for example, in an XPath expression using the <code>count()</code> function.</td>
  </tr>
  <tr>
   <td>STRING_TYPE</td>
   <td>2</td>
   <td>A result containing a single string.</td>
  </tr>
  <tr>
   <td>BOOLEAN_TYPE</td>
   <td>3</td>
   <td>A result containing a single boolean value. This is useful for example, in an XPath expression using the <code>not()</code> function.</td>
  </tr>
  <tr>
   <td>UNORDERED_NODE_ITERATOR_TYPE</td>
   <td>4</td>
   <td>A result node-set containing all the nodes matching the expression. The nodes may not necessarily be in the same order that they appear in the document.</td>
  </tr>
  <tr>
   <td>ORDERED_NODE_ITERATOR_TYPE</td>
   <td>5</td>
   <td>A result node-set containing all the nodes matching the expression. The nodes in the result set are in the same order that they appear in the document.</td>
  </tr>
  <tr>
   <td>UNORDERED_NODE_SNAPSHOT_TYPE</td>
   <td>6</td>
   <td>A result node-set containing snapshots of all the nodes matching the expression. The nodes may not necessarily be in the same order that they appear in the document.</td>
  </tr>
  <tr>
   <td>ORDERED_NODE_SNAPSHOT_TYPE</td>
   <td>7</td>
   <td>A result node-set containing snapshots of all the nodes matching the expression. The nodes in the result set are in the same order that they appear in the document.</td>
  </tr>
  <tr>
   <td>ANY_UNORDERED_NODE_TYPE</td>
   <td>8</td>
   <td>A result node-set containing any single node that matches the expression. The node is not necessarily the first node in the document that matches the expression.</td>
  </tr>
  <tr>
   <td>FIRST_ORDERED_NODE_TYPE</td>
   <td>9</td>
   <td>A result node-set containing the first node in the document that matches the expression.</td>
  </tr>
 </tbody>
</table>

<h3 id="See_also" name="See_also">See also</h3>

<ul>
 <li>{{domxref("Document.evaluate()")}}</li>
</ul>
Revert to this revision