Commit 75e96e06 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

sorting the index

parent 3187537f
......@@ -283,7 +283,7 @@ then
(: person item that is the creator :)
element xhtml:li {
attribute class { "creator" },
"Urheber:",
"",
element xhtml:ul {
attribute class {"workList"},
for $creator in $creators
......@@ -323,7 +323,7 @@ else
(: work item with creator :)
element xhtml:li {
attribute class { "creator" },
"Urheber:",
"",
element xhtml:ul {
attribute class {"listPerson"},
for $creator in $creators
......@@ -558,10 +558,23 @@ as element(xhtml:div) {
<ul class="listEvent">
{
if($f-indexproc:getNotebook = $f-indexproc:targetStart)
then $eventList/tei:event ! local:prepare-event(.)
else $eventList/tei:event
[tei:linkGrp/tei:link
[starts-with(@target, $f-indexproc:getNotebook)]] ! local:prepare-event(.)
then
for $event in $eventList/tei:event
let $sort := string($event/*[1])
=> replace("ä", "ae")
=> replace("ö", "oe")
=> replace("ü", "ue")
order by $sort
return local:prepare-event($event)
else
for $event in $eventList/tei:event[tei:linkGrp/tei:link
[starts-with(@target, $f-indexproc:getNotebook)]]
let $sort := string($event/*[1])
=> replace("ä", "ae")
=> replace("ö", "oe")
=> replace("ü", "ue")
order by $sort
return local:prepare-event($event)
}
</ul>
</xhtml:div>
......@@ -641,11 +654,22 @@ let $result :=
<ul class="listOrg">
{
if($f-indexproc:getNotebook = $f-indexproc:targetStart)
then $orgList/tei:org ! local:prepare-org(.)
then
for $org in $orgList/tei:org
let $sort := string($org/*[1])
=> replace("ä", "ae")
=> replace("ö", "oe")
=> replace("ü", "ue")
order by $sort
return local:prepare-org($org)
else
$orgList/tei:org
[tei:linkGrp/tei:link
[starts-with(@target, $f-indexproc:getNotebook)]] ! local:prepare-org(.)
for $org in $orgList/tei:org[tei:linkGrp/tei:link[starts-with(@target, $f-indexproc:getNotebook)]]
let $sort := string($org/*[1])
=> replace("ä", "ae")
=> replace("ö", "oe")
=> replace("ü", "ue")
order by $sort
return local:prepare-org($org)
}
</ul>
</xhtml:div>
......@@ -721,10 +745,22 @@ as element(xhtml:div) {
<ul class="listPerson">
{
if($f-indexproc:getNotebook = $f-indexproc:targetStart)
then $persList/tei:* ! local:prepare-person(.)
else $persList/tei:*
[tei:linkGrp/tei:link
[starts-with(@target, $f-indexproc:getNotebook)]] ! local:prepare-person(.)
then
for $pers in $persList/tei:*
let $sort := string($pers/*[1])
=> replace("ä", "ae")
=> replace("ö", "oe")
=> replace("ü", "ue")
order by $sort
return local:prepare-person($pers)
else
for $pers in $persList/tei:*[tei:linkGrp/tei:link[starts-with(@target, $f-indexproc:getNotebook)]]
let $sort := string($pers/*[1])
=> replace("ä", "ae")
=> replace("ö", "oe")
=> replace("ü", "ue")
order by $sort
return local:prepare-person($pers)
}
</ul>
</xhtml:div>
......@@ -856,10 +892,25 @@ as element(xhtml:div) {
<ul class="listPlace">
{
if($f-indexproc:getNotebook = $f-indexproc:targetStart)
then $listPlace/tei:place ! local:prepare-place(.)
else $listPlace/tei:place
[tei:linkGrp/tei:link
[starts-with(@target, $f-indexproc:getNotebook)]] ! local:prepare-place(.)
then
for $place in $listPlace/tei:place
let $sort := string($place/*[1])
=> replace("ä", "ae")
=> replace("ö", "oe")
=> replace("ü", "ue")
order by $sort
return local:prepare-place($place)
else
for $place in $listPlace/tei:place
[tei:linkGrp/tei:link
[starts-with(@target, $f-indexproc:getNotebook)]]
let $sort := string($place/*[1])
=> replace("ä", "ae")
=> replace("ö", "oe")
=> replace("ü", "ue")
order by $sort
return local:prepare-place($place)
}
</ul>
</xhtml:div>
......@@ -947,7 +998,13 @@ else
local:links($links),
local:li-code($place),
element xhtml:ul {
$place/tei:place ! local:prepare-place(.)
for $plac in $place/tei:place
let $sort := string($plac/*[1])
=> replace("ä", "ae")
=> replace("ö", "oe")
=> replace("ü", "ue")
order by $sort
return local:prepare-place($plac)
}
}
}
......@@ -972,14 +1029,14 @@ as element(xhtml:div) {
if($f-indexproc:getNotebook = $f-indexproc:targetStart)
then
for $i in $wrkList//tei:item[not(tei:list)]
order by lower-case(($i/tei:name[not(@type)]/text())[1])
order by (lower-case(($i/tei:name[not(@type)]/text())[1]) => replace("ä", "ae") => replace("ö", "oe") => replace("ü", "ue") )
return local:prepare-work($i)
else
for $i in $wrkList//tei:item
[not(tei:list)]
[tei:linkGrp/tei:link
[starts-with(@target, $f-indexproc:getNotebook)]]
order by lower-case(($i/tei:name[not(@type)]/text())[1])
order by (lower-case(($i/tei:name[not(@type)]/text())[1]) => replace("ä", "ae") => replace("ö", "oe") => replace("ü", "ue") )
return local:prepare-work($i)
}
</ul>
......@@ -1079,7 +1136,14 @@ else
element xhtml:li {
element xhtml:ul {
attribute class { "work-listPerson" },
$listPerson/tei:person ! local:prepare-person(.)
for $person in $listPerson/tei:person
let $sort := string($person/*[1])
=> replace("ä", "ae")
=> replace("ö", "oe")
=> replace("ü", "ue")
order by $sort
return local:prepare-person($person)
}
},
for $listPlace in $work/tei:listPlace
......@@ -1087,7 +1151,13 @@ else
element xhtml:li {
element xhtml:ul {
attribute class { "work-listPlace" },
$listPlace/tei:place ! local:prepare-place(.)
for $place in $listPlace/tei:place
let $sort := string($place/*[1])
=> replace("ä", "ae")
=> replace("ö", "oe")
=> replace("ü", "ue")
order by $sort
return local:prepare-place($place)
}
}
}
......
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