Skip to content
Snippets Groups Projects
Commit 02c7b988 authored by Daniel Roewenstrunk's avatar Daniel Roewenstrunk Committed by Peter Stadler
Browse files

Errors fixed and fallback for MEI included again

parent 3fd35d45
No related branches found
No related tags found
No related merge requests found
...@@ -185,6 +185,10 @@ declare function local:getWindowTitle($doc as node()+, $type as xs:string) as xs ...@@ -185,6 +185,10 @@ declare function local:getWindowTitle($doc as node()+, $type as xs:string) as xs
($doc//mei:source)[1]//mei:identifier[lower-case(@type) = 'shelfmark'][1]), ' | ') ($doc//mei:source)[1]//mei:identifier[lower-case(@type) = 'shelfmark'][1]), ' | ')
=> normalize-space()) => normalize-space())
(: MEI fallback if no title is found :)
else if (exists($doc//mei:mei) and exists(($doc//mei:titleStmt)[1])) then
(eutil:getLocalizedTitle(($doc//mei:titleStmt)[1], $lang))
(: Text :) (: Text :)
else if ($type = 'text') then else if ($type = 'text') then
(eutil:getLocalizedTitle($doc//tei:fileDesc/tei:titleStmt[1], $lang)) (eutil:getLocalizedTitle($doc//tei:fileDesc/tei:titleStmt[1], $lang))
...@@ -195,10 +199,10 @@ declare function local:getWindowTitle($doc as node()+, $type as xs:string) as xs ...@@ -195,10 +199,10 @@ declare function local:getWindowTitle($doc as node()+, $type as xs:string) as xs
else if($type = 'unknown') then else if($type = 'unknown') then
let $eventualTitleContainers := ($doc//mei:titleStmt, $doc/tei:titleStmt) let $eventualTitleContainers := ($doc//mei:titleStmt, $doc//tei:titleStmt)
let $eventualTitles := ( let $eventualTitles := (
for $et in $eventualTitleContainers return for $et in $eventualTitleContainers return
eutil:getLocalizedTitle($eventualTitleContainers[1], $lang), eutil:getLocalizedTitle($et, $lang),
for $t in $doc//*:title return for $t in $doc//*:title return
$t => normalize-space() $t => normalize-space()
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment