<!-- can't do this one step: attributes are unordered! -->
<xsl:variable name="lang-scope"
select="$target/ancestor-or-self::*
- [@lang or @xml:lang][last()]"/>
+ [@lang or @xml:lang][1]"/>
<xsl:variable name="lang-attr"
select="($lang-scope/@lang | $lang-scope/@xml:lang)[1]"/>
<xsl:choose>
<!-- can't do this one step: attributes are unordered! -->
<xsl:variable name="lang-scope"
select="$target/ancestor-or-self::*
- [@lang or @xml:lang][last()]"/>
+ [@lang or @xml:lang][1]"/>
<xsl:variable name="lang-attr"
select="($lang-scope/@lang | $lang-scope/@xml:lang)[1]"/>
<!-- can't do this one step: attributes are unordered! -->
<xsl:variable name="lang-scope"
select="$node/ancestor-or-self::*
- [@lang or @xml:lang][last()]"/>
+ [@lang or @xml:lang][1]"/>
<xsl:variable name="lang-attr"
select="($lang-scope/@lang | $lang-scope/@xml:lang)[1]"/>