aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/xpathresult
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/xpathresult
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/ja/web/api/xpathresult')
-rw-r--r--files/ja/web/api/xpathresult/index.html122
-rw-r--r--files/ja/web/api/xpathresult/snapshotitem/index.html85
2 files changed, 207 insertions, 0 deletions
diff --git a/files/ja/web/api/xpathresult/index.html b/files/ja/web/api/xpathresult/index.html
new file mode 100644
index 0000000000..166f1ae6e4
--- /dev/null
+++ b/files/ja/web/api/xpathresult/index.html
@@ -0,0 +1,122 @@
+---
+title: XPathResult
+slug: Web/API/XPathResult
+translation_of: Web/API/XPathResult
+---
+<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>
diff --git a/files/ja/web/api/xpathresult/snapshotitem/index.html b/files/ja/web/api/xpathresult/snapshotitem/index.html
new file mode 100644
index 0000000000..832a306960
--- /dev/null
+++ b/files/ja/web/api/xpathresult/snapshotitem/index.html
@@ -0,0 +1,85 @@
+---
+title: XPathResult.snapshotItem()
+slug: Web/API/XPathResult/snapshotItem
+tags:
+ - API
+ - DOM XPath API
+ - Method
+ - Reference
+ - XPath
+ - XPathResult
+ - メソッド
+translation_of: Web/API/XPathResult/snapshotItem
+---
+<div>{{APIRef("DOM XPath")}}</div>
+
+<p><strong><code>snapshotItem()</code></strong> は {{domxref("XPathResult")}} インターフェイスのメソッドで、アイテムのスナップショットのコレクション、または添字がノードの範囲を外れている場合は <code>null</code> を返します。イテレーターの返値とは異なり、スナップショットは無効になることはありませんが、変更したときに現在の文書に対応しない場合があります。</p>
+
+<h2 id="Syntax" name="Syntax">構文</h2>
+
+<pre class="syntaxbox">var <var>node</var> = <var>result</var>.snapshotItem(i);
+</pre>
+
+<h3 id="Return_Value" name="Return_Value">返値</h3>
+
+<p><code>XPathResult</code> のノードセット内の指定された添字の {{domxref("Node")}} です。</p>
+
+<h3 id="Exceptions" name="Exceptions">例外</h3>
+
+<h4 id="TYPE_ERR">TYPE_ERR</h4>
+
+<p>{{domxref("XPathResult.resultType")}} が <code>UNORDERED_NODE_SNAPSHOT_TYPE</code> または <code>ORDERED_NODE_SNAPSHOT_TYPE</code> でない場合、 {{domxref("XPathException")}} による例外が <code>TYPE_ERR</code> 型で発生します。</p>
+
+<h2 id="Example" name="Example">例</h2>
+
+<p>以下の例は <code>snapshotItem()</code> メソッドの使用例を表しています。</p>
+
+<h3 id="HTML">HTML</h3>
+
+<pre class="brush: html">&lt;div&gt;XPath example&lt;/div&gt;
+&lt;div&gt;Tag names of the matched nodes: &lt;output&gt;&lt;/output&gt;&lt;/div&gt;
+</pre>
+
+<h3 id="JavaScript">JavaScript</h3>
+
+<pre class="brush: js">var xpath = "//div";
+var result = document.evaluate(xpath, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+var node = null;
+var tagNames = [];
+for(var i = 0; i &lt; result.snapshotLength; i++) {
+ var node = result.snapshotItem(i);
+  tagNames.push(node.localName);
+}
+document.querySelector("output").textContent = tagNames.join(", ");
+</pre>
+
+<h3 id="Result" name="Result">結果</h3>
+
+<p>{{EmbedLiveSample('Example', 400, 70)}}</p>
+
+<h2 id="Specification" name="Specification">仕様書</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">仕様書</th>
+ <th scope="col">状態</th>
+ <th scope="col">備考</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName("DOM3 XPath", "xpath.html#XPathResult-snapshotItem", "XPathResult.snapshotItem()")}}</td>
+ <td>{{Spec2("DOM3 XPath")}}</td>
+ <td>初回定義</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
+
+<div>
+<div class="hidden">このページの互換性表は構造化データから作成されています。データに協力したい場合は、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送ってください。</div>
+
+<p>{{Compat("api.WindowOrWorkerGlobalScope.clearTimeout")}}</p>
+</div>