Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/xql/getHeader.xql
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ return
</parameters>
)
) else if ($type = 'text') then (
transform:transform($doc, concat($base, 'teiHeader2HTML.xsl'),
transform:transform($doc, concat($base, 'tei/profiles/edirom-header/teiHeader2HTML.xsl'),
<parameters>
<param name="base" value="{$base}"/>
<param name="lang" value="{$lang}"/>
Expand Down
50 changes: 25 additions & 25 deletions data/xql/getLinkTarget.xql
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ declare function local:getView($type as xs:string, $docUri as xs:string, $doc as
else
$docUri
}

(: optionally set label for some views:)
let $labeled.map :=
if ($type = 'mei_textView') then
Expand All @@ -54,7 +54,7 @@ declare function local:getView($type as xs:string, $docUri as xs:string, $doc as
(map:put($baseMap, 'label', 'XML Quellenbeschreibung'))
else
($baseMap)

(: whether to set the view as default view:)
let $defaultViewed.map :=
if ($type = (
Expand All @@ -69,36 +69,36 @@ declare function local:getView($type as xs:string, $docUri as xs:string, $doc as
(map:put($labeled.map, 'defaultView', true()))
else
($labeled.map)

(: xpath check whether any given view is supported :)
let $hasView :=
if ($type = 'desc_summaryView') then
(true())

else if ($type = 'desc_headerView') then
(exists($doc//mei:meiHead or $doc//tei:teiHeader))

else if ($type = 'mei_textView') then
(exists($doc//mei:annot[@type = 'descLink']))

else if ($type = 'mei_sourceView') then
(exists($doc//mei:facsimile//mei:graphic[@type = 'facsimile']))

else if ($type = 'mei_audioView') then
(exists($doc//mei:recording))

else if ($type = 'mei_verovioView') then
(exists($doc//mei:body//mei:measure) and exists($doc//mei:body//mei:note))

else if ($type = 'tei_textView') then
(exists($doc//tei:body[matches(.//text(), '[^\s]+')]))

else if ($type = 'tei_facsimileView') then
(exists($doc//tei:facsimile//tei:graphic))

else if ($type = 'tei_textFacsimileSplitView') then
(exists($doc//tei:facsimile//tei:graphic) and exists($doc//tei:pb[@facs]))

else if ($type = 'mei_annotationView') then
(exists($doc//mei:annot[@type = 'editorialComment']))

Expand All @@ -110,10 +110,10 @@ declare function local:getView($type as xs:string, $docUri as xs:string, $doc as

else if ($type = 'desc_xmlView') then
(exists($doc//mei:annot[@type = 'descLink']))

else
(false())

return
if ($hasView) then
($defaultViewed.map)
Expand All @@ -128,7 +128,7 @@ declare function local:getViews($type as xs:string, $docUri as xs:string, $doc a

let $views := (
(:'desc_summaryView',:)
(:'desc_headerView',:)
'desc_headerView',
'mei_textView',
'mei_sourceView',
'mei_audioView',
Expand All @@ -141,12 +141,12 @@ declare function local:getViews($type as xs:string, $docUri as xs:string, $doc a
'xml_xmlView',
'desc_xmlView'
)

let $maps :=
for $view in $views
return
local:getView($view, $docUri, $doc)

return
$maps
};
Expand Down Expand Up @@ -184,15 +184,15 @@ declare function local:getWindowTitle($doc as document-node()?, $type as xs:stri
(string-join((eutil:getLocalizedTitle(($doc//mei:source)[1]/mei:titleStmt[1], $lang),
($doc//mei:source)[1]//mei:identifier[lower-case(@type) = 'shelfmark'][1]), ' | ')
=> 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 :)
else if ($type = 'text') then
(eutil:getLocalizedTitle($doc//tei:fileDesc/tei:titleStmt[1], $lang))

(: HTML :)
else if ($type = 'html' and not(functx:all-whitespace($doc//*:head/*:title))) then
$doc//*:head/*:title => normalize-space()
Expand Down Expand Up @@ -301,26 +301,26 @@ let $type :=
(: Work :)
if (exists($doc//mei:mei) and exists($doc//mei:work) and not(exists($doc//mei:perfMedium))) then
(string('work'))

(: Recording :)
else if (exists($doc//mei:mei) and exists($doc//mei:recording)) then
(string('recording'))

(: Source / Score :)
else if (source:isSource($docUri)) then
(string('source'))

(: Text :)
else if (exists($doc/tei:TEI)) then
(string('text'))

(: HTML :)
else if (exists($doc/html) or exists($doc/html:html)) then
(string('html'))

else if (contains($docUri, '.html')) then
(string('html'))

else
(string('unknown'))

Expand Down
Loading