<xsl:include href="../common/autoidx-kimber.xsl"/>
<!-- Java sort apparently works only on lang part, not country -->
-<xsl:param name="sort.lang" select="substring(⟨, 1, 2)"/>
+<xsl:param name="sort.lang">
+ <xsl:choose>
+ <xsl:when test="contains(⟨, '-')">
+ <xsl:value-of select="substring-before(⟨, '-')"/>
+ </xsl:when>
+ <xsl:when test="contains(⟨, '_')">
+ <xsl:value-of select="substring-before(⟨, '_')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="⟨"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:param>
<xsl:template name="generate-kimber-index">
<xsl:param name="scope" select="NOTANODE"/>
<xsl:include href="../common/autoidx-kimber.xsl"/>
<!-- Java sort apparently works only on lang part, not country -->
-<xsl:param name="sort.lang" select="substring(⟨, 1, 2)"/>
+<xsl:param name="sort.lang">
+ <xsl:choose>
+ <xsl:when test="contains(⟨, '-')">
+ <xsl:value-of select="substring-before(⟨, '-')"/>
+ </xsl:when>
+ <xsl:when test="contains(⟨, '_')">
+ <xsl:value-of select="substring-before(⟨, '_')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="⟨"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:param>
<xsl:template name="generate-kimber-index">
<xsl:param name="scope" select="NOTANODE"/>