Commit 66201ff3 authored by Mathias Goebel's avatar Mathias Goebel 🎠

Release 4.9.0

\## edited text
* improved view
* whitespaces

\## index
* sort work items inside personal entity view
* add name of parent item (places) to list and @title on very long entity paths
* fix issue searching for work entries
* style nested entities
* fake relation to Fontane on work items in list @type='Fontane'

\## commentary
* editorial commentary on sketches

\## transcription
* new feature: present reverted overwritings
* add stamp: Deutsche Bibliothek Theodor-Fontane-Archiv
* special styling for initials
* improved tei:mod with multiple instruction in @style
* bugfix: highlighted areas

\## Bugfixes
* #114 #113 #109 #110 #119 #117 #105
parents 7d5e14e4 39447953
project.name=http://textgrid.de/ns/SADE-fontane-develop
project.version=4.8.0
project.version=4.9.0
project.title=[Fontane] SADE
project.abbrev=SADE-fontane-develop
project.processorversion=4.7.0
......
This diff is collapsed.
......@@ -17,9 +17,10 @@ import module namespace config="http://textgrid.de/ns/SADE/config" at "../../con
declare function simple2xhtml:main($nodes as node()*, $uri as xs:string) {
let $xhtml := element xhtml:div {simple2xhtml:recursion($nodes//tei:text)}
let $store := xmldb:store($config:data-root || "/print/xhtml/", $uri || ".html", $xhtml)
let $tidy := element xhtml:div {simple2xhtml:tidy($xhtml)}
let $store := xmldb:store($config:data-root || "/print/xhtml/", $uri || ".html", $tidy)
return
$xhtml
$tidy
};
(:~
......@@ -56,12 +57,15 @@ declare function simple2xhtml:recursion($nodes as node()*) as node()* {
else
element xhtml:span {
simple2xhtml:set-hs-info($node, ()),
replace($node, "@P", "")
=> replace(" ,", ",")
replace($node, " ,", ",")
=> replace(" \?", "?")
=> replace(" \.", ".")
=> replace(" ;", ";")
=> replace("@", " ")
=> replace("@@", " ")
=> replace("@P", "")
=> replace("  ", " ")
=> replace(":", ": ")
=> replace(" “", "“")
}
case element(tei:body) return
......@@ -658,3 +662,25 @@ declare function simple2xhtml:make-integration($node as element(tei:seg)) {
}
}
};
declare function simple2xhtml:tidy($nodes as node()*) as node()* {
for $node in $nodes return
typeswitch ($node)
case text() return
if(string-length($node) = 1 and normalize-space($node) = ""
and matches(substring($node/following::text()[1], 1, 1), "[,\.\?]")) then
()
else
text{ replace($node, "[\s]+", " ")
=> replace(" ,", ",")
=> replace(" \.", ".")
=> replace(" :", ":") }
default return
element {QName("http://www.w3.org/1999/xhtml", $node/name())} {
$node/@*,
simple2xhtml:tidy($node/node())
}
};
......@@ -170,6 +170,13 @@ declare function fsort:apply-all-nexts($node as node(), $log as xs:string) as no
return
if(count($next-node) = 1) then
(fsort:keep-node($node, "sort", $log),
(: check if the parts are in different lines :)
if($node/ancestor::tei:line = $next-node/ancestor::tei:line) then
()
else
element tei:milestone {
attribute unit {"line"}
},
fsort:apply-all-nexts($next-node, $log))
else if(not($next-node)) then
fsort:add-log-entry($log, "No next node found for " || $node/@next)
......@@ -189,6 +196,13 @@ declare function fsort:apply-all-nexts($node as node(), $log as xs:string) as no
if(count($next-node) = 1) then
($prev-handshift,
fsort:keep-node($node, "sort", $log),
(: check if the parts are in different lines :)
if($node/ancestor::tei:line = $next-node/ancestor::tei:line) then
()
else
element tei:milestone {
attribute unit {"line"}
},
fsort:apply-all-nexts($next-node, $log))
else if(not($next-node)) then
fsort:add-log-entry($log, "No next node found for " || $node/@next)
......
......@@ -56,7 +56,8 @@ xs:string) as node()? {
</text>
</TEI>
</teiCorpus>
let $store := xmldb:store($config:data-root || "/print/xml/", $uri || "-tmp.xml", $tei)
let $store := xmldb:store($config:data-root || "/print/xml/", $uri || "-tmp.xml", $tei)
return $tei
};
......@@ -208,7 +209,10 @@ $log as xs:string) as node()* {
simpleHelpers:trim-first-char($node))
else if($node/@type = "verse") then
if(not($node/@next)) then
if($node/@prev) then
()
else if(not($node/@next)) then
(if(not($node/preceding-sibling::tei:line[@type = "verse"])) then
fontaneSimple:mark-linegroup-beginning()
else
......@@ -220,10 +224,11 @@ $log as xs:string) as node()* {
fontaneSimple:mark-linegroup-end()
else
())
(: 3.8.2.2.1.3 Vers mit anderer Beschriftung in einer Zeile :)
else
let $corresp := $node/following::tei:seg[@type = "verse"
and matches($node/@next, @xml:id)]
let $corresp := $node/following::*[@type = "verse"
and replace($node/@next, "#", "") = @xml:id]
return
(fontaneSimple:mark-linegroup-beginning(),
element tei:l {
......@@ -342,13 +347,7 @@ $log as xs:string) as node()* {
fontaneSimple:transform($node/node(), $uri, $log)
}
else if($node/@type = "integration") then
element tei:seg {
$node/@*,
fontaneSimple:transform($node/node(), $uri, $log)
}
else if($node/@type = "editorial-label") then
else if($node/@type = ("integration", "editorial-label")) then
element tei:seg {
$node/@*,
fontaneSimple:transform($node/node(), $uri, $log)
......@@ -397,16 +396,14 @@ $log as xs:string) as node()* {
}
else if($node/@type = "pocket") then
(fontaneSimple:make-pb($node),
element tei:div{
$node/(@* except (@n, @ulx, @uly, @lry, @lrx)),
fontaneSimple:transform($node/node(), $uri, $log)
})
}
else if(simpleHelpers:is-page($node)
and $node/@type = "clipping") then
(fontaneSimple:make-pb($node),
(if($node/@subtype = "Kalenderblatt"
if($node/@subtype = "Kalenderblatt"
and contains($node//tei:handShift/@new, "Friedrich_Fontane")) then
element tei:div {
$node/@n,
......@@ -422,10 +419,10 @@ $log as xs:string) as node()* {
}
else
()))
()
else if(simpleHelpers:is-page($node)) then
(fontaneSimple:make-pb($node),
(text{" "},
fontaneSimple:transform($node/node(), $uri, $log))
else if($node/@type = "label" and
......@@ -494,6 +491,9 @@ $log as xs:string) as node()* {
fontaneSimple:transform($node/node(), $uri, $log)
else
element tei:hi {
$node/@xml:id,
$node/@prev,
$node/@next,
attribute type {"vertical-mark"},
fontaneSimple:transform($node/node(), $uri, $log)
}
......@@ -669,6 +669,9 @@ $log as xs:string) as node()* {
attribute type {"short-paragraph-line"}
}
else if(matches($node/descendant::tei:ref, "horizontale einfache Abgrenzungslinie")) then
()
else if($node/ancestor::tei:zone[@type = "illustration"]) then
let $display :=
if($node/ancestor::tei:zone[@type = "illustration"]/tei:milestone[@unit = "illustration"][. << $node]) then
......@@ -676,7 +679,7 @@ $log as xs:string) as node()* {
else
"inline"
let $img-url := try {tbleapi:get-url($uri, $node/@xml:id, "png") }
catch * { fontaneSimple:add-log-entry($log, "No TBLE-file found for " || $node/@xml:id) }
catch * { fontaneSimple:add-log-entry($log, "No TBLE-file found for " || serialize($node)) }
let $img-url :=
if($display = "inline") then
replace($img-url, ",1000", ",500")
......@@ -769,7 +772,10 @@ $log as xs:string) as node()* {
(
element {QName("http://www.tei-c.org/ns/1.0", $node/name())} {
$node/@*,
fontaneSimple:make-index-infos($node, $index-type),
if($node/@prev) then
()
else
fontaneSimple:make-index-infos($node, $index-type),
fontaneSimple:transform($node/node(), $uri, $log)
},
if(not($node//tei:abbr/text()[ends-with(., ":")]
......@@ -825,6 +831,9 @@ $log as xs:string) as node()* {
case element(tei:unclear) return
fontaneSimple:copy-element($node, $uri, $log)
case element(tei:div) return
fontaneSimple:copy-element($node, $uri, $log)
default return
fontaneSimple:transform($node/node(), $uri, $log)
};
......@@ -955,13 +964,15 @@ declare function fontaneSimple:enhance-handshift($node as element(tei:handShift)
as element(tei:milestone) {
let $prev-hand := $node/preceding::tei:handShift[@new][1]
let $whitespace-before :=
if($node/preceding::node()[1][normalize-space(.) = ""]) then
if($node/preceding::node()[1][normalize-space(.) = ""]
and string-length($node/preceding::text()[1]) = 1) then
true()
else
false()
let $whitespace-after :=
if($node/following::node()[1][normalize-space(.) = ""]
and string-length($node/following::text()[1]) = 1
and not($node/following::*[1][@type = "heading"])
and not($node/following::text()[1][matches(substring(., 1, 1), "[\.,]")])) then
true()
......@@ -972,8 +983,8 @@ as element(tei:milestone) {
element tei:milestone {
attribute unit {"handshift"},
attribute subtype {if($node/@new) then $node/@new else $prev-hand/@new},
(if($whitespace-before) then attribute ws-before {"true"} else ()),
(if($whitespace-after) then attribute ws-after {"true"} else ()),
(: (if($whitespace-before) then attribute ws-before {"true"} else ()),:)
(: (if($whitespace-after) then attribute ws-after {"true"} else ()),:)
$node/(@* except @new)
}
......
......@@ -72,33 +72,38 @@ as xs:boolean {
: @return text() the formatted text
: :)
declare function simpleHelpers:prepare-text($node as text()) as text()? {
if(not(normalize-space($node) = "")) then
if(normalize-space($node) = "" and string-length($node) gt 1) then
()
else
(: the @P serves as a flag for the removal of hyphens. this is necessary
since we sometimes have cases where a hyphen is the only content of a
string. functx:substring-before-last would therefore produce an empty
string which leads to problems while preparing the text any further. :)
let $cleared-end-hyphen :=
if((ends-with($node, "-") or ends-with($node, "⸗"))
and $node/parent::tei:add) then
$node
else if(ends-with($node, "-") and not(simpleHelpers:keep-hyphen($node))) then
(: if((ends-with($node, "-") or ends-with($node, "⸗")):)
(: and $node/parent::tei:add) then:)
(: $node:)
(: else :)
if(ends-with($node, "-") and not(simpleHelpers:keep-hyphen($node))) then
text {functx:substring-before-last($node, "-") || "@P"}
else if(ends-with($node, "⸗") and not(simpleHelpers:keep-hyphen($node))) then
text {functx:substring-before-last($node, "⸗") || "@P"}
else
replace($node, "⸗", "-")
let $cleared-hyphen := replace($cleared-end-hyphen, "⸗", "-")
let $save-whitespaces := replace($cleared-end-hyphen, " ", "@@")
let $cleared-hyphen := replace($save-whitespaces, "⸗", "-")
let $cleared-round-s := replace($cleared-hyphen, "ſ", "s")
let $cleared-Tironian := replace($cleared-round-s, "&#x204a;c.", "etc.")
(: let $normalized := normalize-space($cleared-round-s):)
(: let $last-char := substring($cleared-round-s, string-length($cleared-round-s), 1):)
(: let $add-whitespace := :)
(: if(matches($last-char, "[\w\d,\.;?!]"):)
(: and $node/parent::tei:line/child::*[last()] = . ) then:)
(: $cleared-round-s || " ":)
(: else:)
(: $cleared-round-s:)
(: return text {$add-whitespace}:)
let $cleared-big-space :=
if($node/following-sibling::*[1][self::tei:handShift]
and ends-with($node, "-&#x2003;")) then
text{replace($cleared-round-s, "-&#x2003;", "@P")}
else if($node/following-sibling::*[1][self::tei:handShift]
and ends-with($node, "&#x2003;")) then
text{replace($cleared-round-s, "&#x2003;", "")}
else
$cleared-round-s
let $escaped-big-space := text{replace($cleared-big-space, "&#x2003;", "?@?")}
let $cleared-Tironian := replace($cleared-big-space, "&#x204a;c.", "etc.")
return
(: in cases where a given $node only consists of a hyphen we don't
return a text node because it's unnecessary and leads to problems
......@@ -109,8 +114,6 @@ declare function simpleHelpers:prepare-text($node as text()) as text()? {
text {$cleared-Tironian}
else
()
else
()
};
......@@ -367,7 +370,7 @@ $node as element(tei:milestone)) as xs:boolean {
:)
declare function simpleHelpers:is-prev-hand-same($node as element(tei:milestone))
as xs:boolean {
let $prev-hand := $node/preceding::tei:milestone[@unit = "handshift"][1]
let $prev-hand := $node/preceding::*[@unit = "handshift"][1]
return
(: since we can't take the order of the attributes for granted we can't
use functx:sequence-deep-equal :)
......
This diff is collapsed.
......@@ -4,7 +4,7 @@ xquery version "3.1";
: given page.
:
: @author Mathias Göbel
: @version 1.0
: @version 1.1
: @since 2.5.6
: :)
......@@ -13,13 +13,12 @@ module namespace index="https://fontane-nb.dariah.eu/indexapi";
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace test="http://exist-db.org/xquery/xqsuite";
declare namespace tgmd="http://textgrid.info/namespaces/metadata/core/2010";
declare namespace xhtml="http://www.w3.org/1999/xhtml";
import module namespace rest="http://exquery.org/ns/restxq";
import module namespace config="http://textgrid.de/ns/SADE/config" at "../config/config.xqm";
import module namespace ixp="http://fontane-nb.dariah.eu/index-processor" at "index-processor.xqm";
declare variable $index:dataPath := "/db/sade-projects/textgrid/data/xml/data";
import module namespace rest="http://exquery.org/ns/restxq";
(:~
: resolves and lists all references on a given page based on their index data
......@@ -57,14 +56,14 @@ declare
function index:entites-per-page($uri as xs:string, $surface as xs:string)
as element(xhtml:ul)* {
let $docpath := $index:dataPath || "/" || $uri || ".xml"
let $docpath := $ixp:dataPath || $uri || ".xml"
let $surface := tokenize($surface, "-")
(: test for document available :)
return
if(not(doc-available($docpath)))
then
let $docsInDb := collection($index:dataPath)//tei:sourceDoc
let $docsInDb := $ixp:dataCollection//tei:sourceDoc
/replace(base-uri(), "\.xml|/|db|sade-projects|textgrid|data|xml", "")
=> string-join(", ")
return
......@@ -100,19 +99,27 @@ return
element xhtml:ul {
for $entity in $entities[substring-before(., ":") = $group]
let $ref := substring-after($entity, ":")
let $index := (collection($index:dataPath)/id($ref))[1]
let $index := ($ixp:dataCollection/id($ref))[1]
let $name := string($index/*[1])
let $list := index:get-list-by-id($ref)
let $href := "register.html?e=" || $ref
let $attributeTitle := if($group = "plc" and count($index/ancestor::tei:place) gt 1) then "in: " || string-join(reverse($index/ancestor::tei:place/tei:placeName), ", ") else ()
order by $name
return
element xhtml:li {
attribute data-ref { $entity },
attribute class { $index/local-name() },
$attributeTitle ! attribute title {$attributeTitle},
element xhtml:a {
attribute href { $href },
attribute target { "_blank" },
$name
$name,
if(($group = "plc") and $index/ancestor::tei:place)
then element xhtml:span {
attribute class { "nestedPlaces" },
string($index/ancestor::tei:place[1]/*[1])
}
else ()
}
}
}
......@@ -158,8 +165,9 @@ declare
function index:get-list-by-id($id as xs:string)
as xs:string {
let $entity := collection($index:dataPath)/id($id)[ not(. instance of element(tei:handNote) ) ]
let $entity := $ixp:dataCollection/id($id)[ not(. instance of element(tei:handNote) ) ]
let $test := if($entity[2]) then error(QName("FONTANE", "INDEX-API3"), "Entity »" || $id || "« has more then one occurence." ) else ()
let $test := if($entity) then () else error(QName("FONTANE", "INDEX-API3"), "Entity »" || $id || "« was not found." )
return
switch ( $entity/local-name() )
case "event" return "listEvent"
......@@ -167,14 +175,14 @@ return
case "place" return "listPlace"
case "person" return
if($entity/ancestor::tei:item)
then index:get-list-by-id( ($entity/ancestor::tei:item)[last()]/string(@xml:id) )
then true()
else "listPerson"
case "personGrp" return
if($entity/ancestor::tei:item)
then index:get-list-by-id( ($entity/ancestor::tei:item)[last()]/string(@xml:id) )
else "listPerson"
default return
let $list := ($entity/ancestor::tei:list[@type])[last()]
let $list := $entity/ancestor::tei:list[@type]
return
$list/local-name() || "-" || string($list/@type)
};
......@@ -187,14 +195,14 @@ as xs:string {
case "place" return "listPlace"
case "person" return
if($node/ancestor::tei:item)
then index:get-list-by-id( ($node/ancestor::tei:item)[last()]/string(@xml:id) )
then index:get-list-by-node($node/ancestor::tei:item[@xml:id][1])
else "listPerson"
case "personGrp" return
if($node/ancestor::tei:item)
then index:get-list-by-id( ($node/ancestor::tei:item)[last()]/string(@xml:id) )
then index:get-list-by-node( ($node/ancestor::tei:item[@xml:id])[1] )
else "listPerson"
default return
let $list := ($node/ancestor::tei:list[@type])[last()]
let $list := $node/ancestor::tei:list[@type]
return
$list/local-name() || "-" || string($list/@type)
};
......@@ -213,7 +221,7 @@ declare
%test:assertTrue
function index:rendered-entity($id as xs:string)
as item()* {
let $node := collection($index:dataPath)/id($id)
let $node := $ixp:dataCollection/id($id)
let $type := $node/root()//tei:body/*[1]/local-name()
(: listEvent, listPlace, listOrg, listPerson or list :)
return
......@@ -251,6 +259,7 @@ declare
%test:name("simple search")
%test:arg("query", "Dom Karlos")
%test:arg("index", "listEvent,listOrg,listPerson,listPlace,list-works,list-Fontane,list-periodicals")
%test:assertXPath("array:size($result) = 2")
function index:search($query as xs:string, $index)
......@@ -260,12 +269,12 @@ return if(string-length($query) lt 2) then () else
let $prepare := tokenize($index, ",")
let $hits :=
(
collection($index:dataPath)//tei:person[contains(tei:persName, $query)],
collection($index:dataPath)//tei:personGrp[contains(tei:persName, $query)],
collection($index:dataPath)//tei:place[contains(tei:placeName, $query)],
collection($index:dataPath)//tei:org[contains(tei:orgName, $query)],
collection($index:dataPath)//tei:event[contains(tei:label, $query)],
collection($index:dataPath)//tei:item[tei:name/contains(., $query) = true()]
$ixp:dataCollection//tei:person[contains(tei:persName, $query)],
$ixp:dataCollection//tei:personGrp[contains(tei:persName, $query)],
$ixp:dataCollection//tei:place[contains(tei:placeName, $query)],
$ixp:dataCollection//tei:org[contains(tei:orgName, $query)],
$ixp:dataCollection//tei:event[contains(tei:label, $query)],
$ixp:dataCollection//tei:name[contains(., $query)]/parent::tei:item
)
return
array{
......@@ -285,3 +294,28 @@ return
}
}
};
(:~
: Returns available image from TextGrid Repository
: @param $type the index to look up, one of: plc, wrk, psn, eve, org
: @param $id the xml:id of an entity in the database
: @return an array of URIs or an empty array
:)
declare
%rest:GET
%rest:path("/api/index/image/{$type}/{$id}")
%output:method("json")
%test:arg("id", "Arnoldi-Denkmal")
%test:arg("type", "plc")
%test:assertXPath("$result?1 => exists()")
function index:rendered-entity($type as xs:string, $id as xs:string)
as array(*) {
let $request :=
<hc:request
method="get"
href="https://textgridlab.org/1.0/tgsearch-public/search/?q=(title:%22{$type}:{$id}%22)" />
let $tgsearch := hc:send-request($request)[2]
return
[ $tgsearch//tgmd:textgridUri/string() ]
};
......@@ -5,7 +5,7 @@ xquery version "3.1";
: the index for a single notebook.
: The corresponding viewer module is `index-viewer.xqm`.
: @author Mathias Göbel
: @version 1.0
: @version 1.0.2
: @see https://fontane-nb.dariah.eu/register.html
:)
module namespace ixp="http://fontane-nb.dariah.eu/index-processor";
......@@ -14,7 +14,6 @@ import module namespace config="http://textgrid.de/ns/SADE/config" at "../config
import module namespace f-misc="http://fontane-nb.dariah.eu/ns/SADE/misc" at "misc.xqm";
import module namespace functx="http://www.functx.com";
declare namespace foaf="http://xmlns.com/foaf/0.1/";
declare namespace gndo="http://d-nb.info/standards/elementset/gnd#";
declare namespace ore="http://www.openarchives.org/ore/terms/";
......@@ -25,13 +24,14 @@ declare namespace xhtml="http://www.w3.org/1999/xhtml";
declare variable $ixp:metaCollection := '/db/sade-projects/textgrid/data/xml/meta/';
declare variable $ixp:targetStart := "http://textgridrep.org/textgrid:";
(: try/catch here, to pass the tests when no request object is available :)
(: try/catch here, to pass the tests where no request object is available :)
declare variable $ixp:getEntity := try {request:get-parameter('e', '')} catch * {""};
declare variable $ixp:getIndex := try {request:get-parameter('i', '')} catch * {""};
declare variable $ixp:notebookParam := try {request:get-parameter('nb', '')} catch * {""};
declare variable $ixp:getNotebook := $ixp:targetStart || $ixp:notebookParam;
declare variable $ixp:dataCollection := collection($config:data-root || "/data");
declare variable $ixp:dataPath := '/db/sade-projects/textgrid/data/xml/data/';
(:~
: Helper function to collect all main nodes from the index files.
......@@ -384,6 +384,7 @@ element xhtml:li {
let $target := $creator/@target => substring-before(" ")
let $targetId := $target => substring-after(":")
let $targetNode := $ixp:dataCollection/id($targetId)
let $title := string($targetNode/*[1])
let $htmlResource :=
(: TODO remove condition_s_ for final production release :)
if($targetNode)
......@@ -392,6 +393,7 @@ element xhtml:li {
then "two entities with same ID: " || $targetId
else ixp:get-list-by-entity( $targetNode )
else "target-not-available"
order by $title
return
element xhtml:li {
attribute class {"item"},
......@@ -399,7 +401,7 @@ element xhtml:li {
attribute href { "register.html?e=" || string-join($targetId) },
if($targetNode[2])
then "two entities with same ID: " || $targetId
else string($targetNode/*[1])
else $title
},
text{ "&#8195;" },
element xhtml:span {
......@@ -488,77 +490,19 @@ return
}
};
(:~
: a list item with a list of links
:)
declare function ixp:links($links as element(tei:link)*)
as element(xhtml:li) {
let $notebookUris :=
$links ! (substring-after(./@target, $ixp:targetStart) => substring(1,5) => distinct-values())
let $linkMap as map() :=
map:new(
for $nb in $notebookUris
return
map:entry($nb, $links[contains(@target, $nb)])
)
return
element xhtml:li {
attribute class { "links" },
if(count(map:keys($linkMap)) lt 2) then 'In Notizbuch' else 'In den Notizbüchern',
element xhtml:ul {
ixp:link($linkMap)
}
}
};
(:~
: create list items containing links
: :)
declare function ixp:link($map as map()*)
as element(xhtml:li)* {
for $tguri in map:keys($map)
let $resolve := ixp:resolve-name($tguri)
order by $resolve
return
element xhtml:li {
replace($resolve, "([A-E])0(\d)", "$1$2") || ": ",
element xhtml:ul {
attribute class {"link-list-horizontal"},
let $this-map := $map($tguri)
let $surface-sequence := $this-map ! (./@target => substring-after("surface[@n='") => substring-before("']/"))
for $link at $pos in $this-map
let $page := $link/@target => substring-after("surface[@n='") => substring-before("']/")
let $index-of := index-of($surface-sequence, $page)
let $count := count( $index-of )
where $pos = $index-of[1]
return
element xhtml:li {
element xhtml:a {
attribute href {
"edition.html?id=%2Fxml%2Fdata%2F" || $tguri
|| ".xml&amp;page=" || $page
|| "&amp;target=" || string($link/parent::tei:*/parent::tei:*/@xml:id)
},
f-misc:n-translate($page),
if($count eq 1) then ()
else (" ", <xhtml:span title="Anzahl an Vorkommnissen auf dieser Seite">({$count})</xhtml:span>)
}
}
}
}
};
(:~ renewed version of the linking function
: generates a XHTML list with all links without using the tei:link[@corresp]
: from the entity. it queries the database for what is really mentioned.
: @version 2.0
:)
declare function ixp:links-new($entity as element()) {
declare function ixp:links($entity as element()) {
let $id := string($entity/@xml:id)
let $prefix := ixp:get-prefix-by-entity($entity)
let $reference := $prefix || ":" || $id
let $hits := $ixp:dataCollection//tei:rs[contains(@ref, $reference)][not(@prev)]
let $hits := $ixp:dataCollection//tei:rs
[contains(@ref, $reference)]
[not(@prev)]
[@ref eq $reference]
let $array :=
array{
......@@ -848,7 +792,7 @@ return
(: bibl :)
ixp:bibl($bibl),
(: links :)
ixp:links-new($event),
ixp:links($event),
ixp:li-code($event)
}
}
......@@ -969,7 +913,7 @@ return
(: bibl :)
ixp:bibl($bibl),
(: links :)
ixp:links-new($org),
ixp:links($org),
ixp:li-code($org)
}
}
......@@ -1165,7 +1109,7 @@ else
(: bibl :)
ixp:bibl($bibl),
(: links :)
ixp:links-new($pers),
ixp:links($pers),
ixp:li-code($pers)
}
}
......@@ -1285,6 +1229,15 @@ else
string($place/parent::tei:place/*[1])
}
},
if(not($place/parent::tei:listPlace/parent::tei:item)) then () else
element xhtml:span {