Commit 94cd344d authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

list every page just once, name occurences on page, translate @tei:n to German

parent e1d3c9ae
......@@ -9,7 +9,8 @@ xquery version "3.1";
: @see https://fontane-nb.dariah.eu/register.html
:)
module namespace f-indexproc="http://fontane-nb.dariah.eu/indexproc";
import module namespace console="http://exist-db.org/xquery/console";
import module namespace f-misc="http://fontane-nb.dariah.eu/ns/SADE/misc" at "misc.xqm";
declare namespace ore="http://www.openarchives.org/ore/terms/";
declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
......@@ -314,8 +315,12 @@ as element(xhtml:li)* {
replace($resolve, "([A-E])0(\d)", "$1$2") || ": ",
element xhtml:ul {
attribute class {"link-list-horizontal"},
for $link in $map($tguri)
let $map := $map($tguri)
let $surface-sequence := $map ! (./@target => substring-after("surface[@n='") => substring-before("']//"))
for $link at $pos in $map
let $page := $link/@target => substring-after("surface[@n='") => substring-before("']//")
let $count := count( index-of($surface-sequence, $page) )
where $pos = $count[1]
return
element xhtml:li {
element xhtml:a {
......@@ -324,7 +329,9 @@ as element(xhtml:li)* {
|| ".xml&page=" || $page
|| "&target=" || string($link/parent::tei:*/parent::tei:*/@xml:id)
},
$page
f-misc:n-translate($page),
if($count eq 1) then ()
else (" ", <xhtml:span title="Anzahl an Vorkommnissen auf dieser Seite">({$count})</xhtml:span>)
}
}
}
......@@ -534,8 +541,6 @@ let $result :=
if($f-indexproc:getNotebook = $f-indexproc:targetStart)
then $orgList/tei:org ! local:prepare-org(.)
else
let $cons := console:log( "here" )
return
$orgList/tei:org
[tei:linkGrp/tei:link
[starts-with(@target, $f-indexproc:getNotebook)]] ! local:prepare-org(.)
......
Supports Markdown
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