The lang() function tests whether the language of a given node, as defined by the xml:lang attribute, corresponds to the language supplied as an argument.
For example, if the node is the element <para lang="fr-CA"> (indicating Canadian French), then the expression «lang('fr') » returns true .
Argument | Data Type | Meaning |
---|---|---|
language | xs:string | The language being tested |
node (optional) | node() | The node whose language is being tested. If the argument is omitted, the function applies to the context node |
Result | x s:boolean | true if the language of the context node is the same as, or a sublanguage of, the language being tested |