lang()
lang()
The lang
function determines whether the context node matches the given language and returns boolean true or false.
Syntax
lang( string )
Arguments
-
string
- The language code or localization (language and country) code to be matched.
Returns
true
if the context node matches the given languages. Otherwise, false
.
Notes
- A node's language is determined by its
xml:lang
attribute. If the current node does not have anxml:lang
attribute, then the value of thexml:lang
attribute of the nearest ancestor that has anxml:lang
attribute will determine the current node's language. If the language cannot be determined (no ancestor has anxml:lang
attribute), this fun