Skip to content

Commit

Permalink
getLinkTarget.xql: add support for MEI3 and older in function getWork…
Browse files Browse the repository at this point in the history
…Title
  • Loading branch information
bwbohl committed Dec 19, 2024
1 parent 2c91ba1 commit 4c2213e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion add/data/xql/getLinkTarget.xql
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,17 @@ declare function local:getWindowTitle($doc as node()+, $type as xs:string) as xs

(: Work :)
if ($type = 'work') then
(: will fail for MEI v3 or older :)

let $workTitleContainer := (
(: MEI 3 and older :)
($doc//mei:work)[1]/mei:titleStmt,
(: MEI 4 and newer :)
($doc//mei:work)[1]
)[1]

return
eutil:getLocalizedTitle($workTitleContainer, $lang)

eutil:getLocalizedTitle(($doc//mei:work)[1], $lang)

(: Recording :)
Expand Down
2 changes: 1 addition & 1 deletion add/data/xqm/work.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ declare function work:isWork($uri as xs:string) as xs:boolean {
(:~
: Returns a works's label
:
: @param $work The URIs of the Work's document to process
: @param $work The URI of the Work's document to process
: @param $edition The ID of the Edition the Work is part of
: @return The label
:)
Expand Down

0 comments on commit 4c2213e

Please sign in to comment.