Commit a03afc98 authored by mrodzis's avatar mrodzis 🌎
Browse files

Fix bug in index sorting (closes print#67)

parent a63d491e
...@@ -962,15 +962,21 @@ $index-type as xs:string) as element()* { ...@@ -962,15 +962,21 @@ $index-type as xs:string) as element()* {
element {QName("http://www.tei-c.org/ns/1.0", "term")} { element {QName("http://www.tei-c.org/ns/1.0", "term")} {
attribute type {"key"}, attribute type {"key"},
let $main := index-info:get-info-about($index-type, $ref, "regular-name") let $main := index-info:get-info-about($index-type, $ref, "regular-name")
let $affix := substring-after($main, "\.") let $name :=
if(contains($main, ".")) then
substring-before($main, ".")
else
$main
let $affix := substring-after($main, ".")
let $key := let $key :=
replace($main, "Ä", "A") replace($name, "Ä", "A")
=> replace("ä", "a") => replace("ä", "a")
=> replace("Ö", "O") => replace("Ö", "O")
=> replace("ö", "o") => replace("ö", "o")
=> replace("Ü", "U") => replace("Ü", "U")
=> replace("ü", "u") => replace("ü", "u")
=> replace(" ", "") => replace(" ", "")
=> replace("\.", "")
return return
(: sorts terms with a trailer, e.g. 'Friederich II. von Sachsen' after the ones (: sorts terms with a trailer, e.g. 'Friederich II. von Sachsen' after the ones
without, e.g. 'Friederich II.' :) without, e.g. 'Friederich II.' :)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment