Skip to content
Snippets Groups Projects
Commit be5b4b82 authored by bwbohl's avatar bwbohl Committed by Peter Stadler
Browse files

getLinkTarget.xql: replace MEI fallback with global fallback

parent a3400673
No related branches found
No related tags found
No related merge requests found
...@@ -192,10 +192,18 @@ declare function local:getWindowTitle($doc as node()+, $type as xs:string) as xs ...@@ -192,10 +192,18 @@ declare function local:getWindowTitle($doc as node()+, $type as xs:string) as xs
(: HTML :) (: HTML :)
else if ($type = 'html') then else if ($type = 'html') then
($doc//head/data(title)) ($doc//head/data(title))
else if($type = 'unknown') then
let $eventualTitleContainers := ($doc//mei:titleStmt, $doc/tei:titleStmt)
let $eventualTitles := (
for $et in $eventualTitleContainers return
eutil:getLocalizedTitle($eventualTitleContainers[1], $lang),
for $t in $doc//*:title return
$t => normalize-space()
)
(: MEI fallback if no title is found :) return $eventualTitles[1]
else if (exists($doc//mei:mei) and exists(($doc//mei:titleStmt)[1])) then
(eutil:getLocalizedTitle(($doc//mei:titleStmt)[1], $lang))
else else
(string('unknown')) (string('unknown'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment