]> granicus.if.org Git - docbook-dsssl/commitdiff
Use sortas attributes (if they exist) when sorting indexterms
authorDavid Cramer <david@thingbag.net>
Mon, 3 Dec 2007 03:22:06 +0000 (03:22 +0000)
committerDavid Cramer <david@thingbag.net>
Mon, 3 Dec 2007 03:22:06 +0000 (03:22 +0000)
xsl/eclipse/eclipse.xsl

index 3f3290717a18d250c83ba15866cd8d62a9ca3507..97d6ea4e7d2ed70f3bb10206ea018ea9ba4f6bf6 100644 (file)
          <xsl:choose>
                <xsl:when test="$rootid != ''">
                  <xsl:apply-templates select="key('id',$rootid)//indexterm" mode="idx">
-                       <xsl:sort select="primary"/>
-                       <xsl:sort select="secondary"/>
-                       <xsl:sort select="tertiary"/>
+                       <xsl:sort select="normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = '']))"/>
+                       <xsl:sort select="normalize-space(concat(secondary/@sortas, secondary[not(@sortas) or @sortas = '']))"/>
+                       <xsl:sort select="normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas) or @sortas = '']))"/>
                  </xsl:apply-templates>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:apply-templates select="//indexterm" mode="idx">
-                       <xsl:sort select="primary"/>
-                       <xsl:sort select="secondary"/>
-                       <xsl:sort select="tertiary"/>
+                       <xsl:sort select="normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = '']))"/>
+                       <xsl:sort select="normalize-space(concat(secondary/@sortas, secondary[not(@sortas) or @sortas = '']))"/>
+                       <xsl:sort select="normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas) or @sortas = '']))"/>
                  </xsl:apply-templates>
                </xsl:otherwise>
          </xsl:choose>