From 39f2114f9797eb51994966c6bb8ff1814c9a4da8 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 12:36:08 +0100 Subject: unslug fr: move --- files/fr/web/xpath/functions/lang/index.html | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 files/fr/web/xpath/functions/lang/index.html (limited to 'files/fr/web/xpath/functions/lang') diff --git a/files/fr/web/xpath/functions/lang/index.html b/files/fr/web/xpath/functions/lang/index.html new file mode 100644 index 0000000000..6ce39f2dc1 --- /dev/null +++ b/files/fr/web/xpath/functions/lang/index.html @@ -0,0 +1,56 @@ +--- +title: lang +slug: Web/XPath/Fonctions/lang +tags: + - Référence_XSLT +translation_of: Web/XPath/Functions/lang +--- +

+{{ XsltRef() }} +


+La fonction lang détermine si le nœud de contexte correspond à la langue indiquée et retourne le booléen true ou false. +

+

Syntaxe

+
lang( chaîne )
+
+

Arguments

+
chaîne +
Le code de langue ou de localisation (langue et pays) à vérifier. +
+

Retour

+

true si le noeud de contexte est dans la langue donnée, false autrement. +

+

Notes

+ + +

Regardons le code XML suivant : +

+
<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>
+

et ce modèle 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')])" />
+
+

La sortie sera : +

+
3
+1
+1
+0
+
+

Définition

+

XPath 1.0, section 4.3. +

+

Support Gecko

+

Supporté. +

Interwiki Languages Links +

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