-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use a function similar to group-index to sort secundary and tertiary indexterms #50
base: master
Are you sure you want to change the base?
Conversation
Why autoidx.xsl has been changed to use this new function as well? Not all XSLT engines are supporting declaration of user function and such change will break stylesheets in them. I suppose that change should be only in autoidx-kosek.xsl file? |
a64e3f5
to
f34d1a9
Compare
This reverts commit 70fcf97.
f34d1a9
to
7c41373
Compare
I have copied the templates to the autoidx-kosek.xsl files and restore the autoidx.xsl as they were. Now, there is room for refactoring here, but I need an idea or two to customize sort definitions. This however might not solve the problem of having more or less identical templates. The autoidx as well as the kosek index uses modes and not customizations. |
98b641c
to
08ff145
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for additional changes. However it seems that there are still some issues with proposed changes, see comments inline.
<xsl:param name="normalize.sort.input"/> | ||
<xsl:param name="normalize.sort.output"/> | ||
|
||
<xsl:variable name="firstletterinterm" select="substring($term, 1, 1)"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some languages two characters are treated as one letter for purposes of sorting, for example "ch" in Czech. I don't think your code can handle this situation.
<xsl:when test="$letters/l:l[. = $firstletterinterm]/@i"> | ||
<xsl:variable name="indexnumber" select="$letters/l:l[. = $firstletterinterm]/@i"/> | ||
<xsl:if test="$indexnumber < 10"> | ||
<xsl:text>0</xsl:text> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why zero is returned if number from lookup table is smaller then 10? There are localization files using numbers <10 for normal characters.
mode="index-primary"> | ||
<xsl:sort select="&primary;" lang="{$lang}"/> | ||
mode="index-primary-kosek"> | ||
<xsl:sort select="i:term-index(&primary;)" lang="{$lang}"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have't debugged code myself. But if my understanding is correct i:term-index() function would convert string of letters to string of space separated numbers where each number corresponds to code of letter from l:letter element in localization data. Using such value in xsl:sort will not sort strings in a right order.
In the current kozek index only the primary indexterm is sorted by localized values. With this PR also the secondary and tertiary terms are "localized"