]> granicus.if.org Git - docbook-dsssl/commitdiff
lang attribute select statement optimized.
authorBob Stayton <bobs@sagehill.net>
Sun, 15 Aug 2004 21:05:44 +0000 (21:05 +0000)
committerBob Stayton <bobs@sagehill.net>
Sun, 15 Aug 2004 21:05:44 +0000 (21:05 +0000)
xsl/common/l10n.xsl

index 739cd9104c9c5bd52f1379c14703ffbf5e7abf93..4102b80aa0c39e7da33d5b796e2876465d278be0 100644 (file)
@@ -31,8 +31,8 @@
       <xsl:when test="$xref-context or $l10n.gentext.use.xref.language != 0">
         <!-- 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()]"/>
+                      select="$target/ancestor-or-self::*
+                              [@lang or @xml:lang][last()]"/>
         <xsl:variable name="lang-attr"
                       select="($lang-scope/@lang | $lang-scope/@xml:lang)[1]"/>
         <xsl:choose>
@@ -48,8 +48,8 @@
       <xsl:otherwise>
         <!-- 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()]"/>
+                      select="$target/ancestor-or-self::*
+                              [@lang or @xml:lang][last()]"/>
         <xsl:variable name="lang-attr"
                       select="($lang-scope/@lang | $lang-scope/@xml:lang)[1]"/>
 
       <xsl:otherwise>
         <!-- can't do this one step: attributes are unordered! -->
         <xsl:variable name="lang-scope"
-                      select="($node/ancestor-or-self::*[@lang]
-                               |$node/ancestor-or-self::*[@xml:lang])[last()]"/>
+                      select="$target/ancestor-or-self::*
+                              [@lang or @xml:lang][last()]"/>
         <xsl:variable name="lang-attr"
                       select="($lang-scope/@lang | $lang-scope/@xml:lang)[1]"/>
 
         <xsl:text>" localization of "</xsl:text>
         <xsl:value-of select="$key"/>
         <xsl:text>" exists</xsl:text>
-       <xsl:choose>
-         <xsl:when test="$lang = 'en'">
-            <xsl:text>.</xsl:text>
-         </xsl:when>
-         <xsl:otherwise>
-            <xsl:text>; using "en".</xsl:text>
-         </xsl:otherwise>
-       </xsl:choose>
+        <xsl:choose>
+          <xsl:when test="$lang = 'en'">
+             <xsl:text>.</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+             <xsl:text>; using "en".</xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
       </xsl:message>
 
       <xsl:value-of select="($l10n.xml/l:i18n/l:l10n[@language='en']/l:gentext[@key=$key])[1]/@text"/>