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/lang/index.html | 81 ++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 files/ja/web/xpath/functions/lang/index.html (limited to 'files/ja/web/xpath/functions/lang/index.html') diff --git a/files/ja/web/xpath/functions/lang/index.html b/files/ja/web/xpath/functions/lang/index.html new file mode 100644 index 0000000000..b52a8114d0 --- /dev/null +++ b/files/ja/web/xpath/functions/lang/index.html @@ -0,0 +1,81 @@ +--- +title: lang +slug: Web/XPath/Functions/lang +tags: + - XSLT + - XSLT_Reference +translation_of: Web/XPath/Functions/lang +--- +

{{ XsltRef() }}

+ +

lang 関数は、コンテキストノードの言語が与えられた言語に一致するかどうかを判定し、真偽値 true または false を返します。

+ +

{{ 英語版章題("Syntax") }}

+ +

構文

+ +
lang(string )
+
+ +

{{ 英語版章題("Arguments") }}

+ +

引数

+ +
+
string
+
マッチさせる言語コードまたはローカライゼーション (言語と国) コード。
+
+ +

{{ 英語版章題("Returns") }}

+ +

戻り値

+ +

コンテキストノードが与えられた言語に一致すれば true。そうでなければ false

+ +

{{ 英語版章題("Notes") }}

+ +

注記

+ + + + + +

このような XML の断片と、

+ +
<p xml:lang="en">I went up a floor.</p>
+<p xml:lang="en-GB">I took the lift.</p>
+<p xsl:lang="en-US">I rode the elevator.</p>
+ +

このような XSL テンプレートの一部があったとすると、

+ +
<xsl:value-of select="count(//p[lang('en')])" />
+<xsl:value-of select="count(//p[lang('en-GB')])" />
+<xsl:value-of select="count(//p[lang('en-US')])" />
+<xsl:value-of select="count(//p[lang('de')])" />
+
+ +

出力は次のようになるでしょう。

+ +
3
+1
+1
+0
+
+ +

{{ 英語版章題("Defined") }}

+ +

定義

+ +

XPath 1.0 4.3

+ +

{{ 英語版章題("Gecko support") }}

+ +

Gecko でのサポート

+ +

サポート済み。

+ +
{{ languages( { "en": "en/XPath/Functions/lang", "fr": "fr/XPath/Fonctions/lang", "pl": "pl/XPath/Funkcje/lang" } ) }}
-- cgit v1.2.3-54-g00ecf