Skip to content

Commit

Permalink
fixing handling of no-editions
Browse files Browse the repository at this point in the history
  • Loading branch information
riedde committed Oct 9, 2024
1 parent e467018 commit 169d2a9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions add/data/xqm/edition.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ declare function edition:getLanguageFileURI($uri as xs:string, $lang as xs:strin
if(doc-available($uri)) then
doc($uri)
else
doc(edition:findEdition($uri))
if(edition:findEdition($uri)) then
doc(edition:findEdition($uri))
else
()
)
return
if ($doc//edirom:language[@xml:lang eq $lang]/@xlink:href => string() != "") then
Expand Down Expand Up @@ -141,7 +144,7 @@ declare function edition:getPreferencesURI($uri as xs:string?) as xs:string {
: @param $editionID The '@xml:id' of the edirom:edition document to process
: @return The URI of the Edition file
:)
declare function edition:findEdition($editionID as xs:string?) as xs:string {
declare function edition:findEdition($editionID as xs:string?) as xs:string? {

if(not($editionID) or $editionID eq '') then(
let $edition := (collection('/db/apps')//edirom:edition)[1]
Expand Down

0 comments on commit 169d2a9

Please sign in to comment.