html.lang.attrs
Parameters
- $node
The current element in the input document.
- $parent
A parent node to take $lang and $dir from.
- $lang
The language for $node.
- $dir
The text directionality for $node.
This template outputs lang, xml:lang, or dir attributes if necessary. If $lang is not set, it will be taken from the xml:lang or lang attribute of $node. If $dir is not set, it will be taken from the its:dir attribute of $node or computed based on $lang.
The $parent parameter defaults to an empty node set. If it is set to a non-empty node set, this template will attempt to get $lang and $dir from $parent if they are not set on $node. This is occasionally useful when a wrapper element in a source language doesn't directly create any output elements.
This template outputs either an xml:lang or a lang attribute, depending on whether html.xhtml is true. It only outputs an xml:lang or lang attribute if $lang is non-empty. This template also outputs a dir attribute if $dir is non-empty.