]> granicus.if.org Git - docbook-dsssl/commitdiff
Don't rely on the order of attribute nodes cause they don't have one
authorNorman Walsh <ndw@nwalsh.com>
Thu, 10 Jan 2002 22:22:28 +0000 (22:22 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 10 Jan 2002 22:22:28 +0000 (22:22 +0000)
xsl/common/l10n.xsl

index 1f6c167072dd2bf6e6777cbd141fd9827df82d8e..9831cc19b2b262bdb56f53a384b8d1314bd3ab73 100644 (file)
       </xsl:when>
 
       <xsl:when test="$xref-context or $l10n.gentext.use.xref.language">
+        <!-- can't do this one step: attributes are unordered! -->
+        <xsl:variable name="lang-scope"
+                      select="($target/ancestor-or-self::*[@lang]
+                               |$target/ancestor-or-self::*[@xml:lang])[last()]"/>
         <xsl:variable name="lang-attr"
-                      select="($target/ancestor-or-self::*/@lang
-                               |$target/ancestor-or-self::*/@xml:lang)[last()]"/>
+                      select="$lang-scope/@lang | $lang-scope/@xml:lang"/>
         <xsl:choose>
           <xsl:when test="string($lang-attr) = ''">
             <xsl:value-of select="$l10n.gentext.default.language"/>
       </xsl:when>
 
       <xsl:otherwise>
-        <xsl:variable name="lang-attr" 
-                      select="(ancestor-or-self::*/@lang
-                               |ancestor-or-self::*/@xml:lang)[last()]"/>
+        <!-- can't do this one step: attributes are unordered! -->
+        <xsl:variable name="lang-scope"
+                      select="(ancestor-or-self::*[@lang]
+                               |ancestor-or-self::*[@xml:lang])[last()]"/>
+        <xsl:variable name="lang-attr"
+                      select="$lang-scope/@lang | $lang-scope/@xml:lang"/>
+
         <xsl:choose>
           <xsl:when test="string($lang-attr) = ''">
             <xsl:value-of select="$l10n.gentext.default.language"/>