From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/xpath/functions/current/index.html | 65 +++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 files/ja/web/xpath/functions/current/index.html (limited to 'files/ja/web/xpath/functions/current') diff --git a/files/ja/web/xpath/functions/current/index.html b/files/ja/web/xpath/functions/current/index.html new file mode 100644 index 0000000000..406f279123 --- /dev/null +++ b/files/ja/web/xpath/functions/current/index.html @@ -0,0 +1,65 @@ +--- +title: current +slug: Web/XPath/Functions/current +tags: + - XSLT + - XSLT_Reference +translation_of: Web/XPath/Functions/current +--- +

{{ XsltRef() }}

+ +

current関数を使用して、XSLT命令でコンテキストノードを取得できます。

+ +

構文

+ +
current()
+
+ +

戻り値

+ +

現在のノードのみを含むノード集合。

+ +

注記

+ +

この関数はXSLT固有のXPathへの追加です。コアXPath関数ライブラリの一部ではありません。

+ +

一番外側の式(別の式内に現れない式)の場合、現在のノードは常にコンテキストノード(.またはself構文によって返されます)と同じです。次の2つは意味的に同等です。

+ +
<xsl:value-of select="current()"/>
+
+ +
<xsl:value-of select="."/>
+
+ +

内側の式(角括弧など)では、現在のノードは一番外側の式の場合と同じです。したがって、次の3つの式のすべてにおいてcurrent関数(式全体ではない)が同じノードを返します。さらに、後者の2つは意味的に同等です。

+ +
<xsl:value-of select="current()"/>
+
+ +
<xsl:value-of select="foo/bar[current() = X]"/>
+
+ +
<xsl:variable name="current" select="current()"/>
+<xsl:value-of select="foo/bar[$current = X]"/>
+
+ +

そして、次のコードは最も外側の式に.があるので、後者のコードと意味的に同じです。

+ +
<xsl:variable name="current" select="."/>
+<xsl:value-of select="foo/bar[$current = X]"/>
+
+ +

しかし、.は常に最も狭い文脈に関係しています。したがって、

+ +
<xsl:value-of select="foo/bar[. = X]"/>
+
+ +

.barノードを返します。これは現在のノードとは異なる場合があります。

+ +

定義

+ +

XSLT 1.0 12.4

+ +

Gecko のサポート状況

+ +

サポート済み

-- cgit v1.2.3-54-g00ecf