Skip to content

Commit

Permalink
fix sort issue of unpublished material
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Jan 6, 2025
1 parent 77db545 commit 90d146e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions modules/query.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,17 @@ declare function query:get-normalized-date($doc as document-node()) as xs:date?
let $docID := $doc/*/data(@xml:id)
let $date :=
switch(config:get-doctype-by-id($docID))
(: for Weber writings the creation date should take precedence over the publication date :)
case 'writings' return date:getOneNormalizedDate(($doc[query:get-authorID(.) = 'A002068']//tei:creation/tei:date[@* except @cert],query:get-main-source($doc)/tei:monogr/tei:imprint/tei:date)[1], true())
case 'writings' return
date:getOneNormalizedDate((
(: for Weber writings the creation date should take precedence over the publication date :)
$doc[query:get-authorID(.) = 'A002068']//tei:creation/tei:date[@* except @cert],
(: extract default imprint for published writings :)
query:get-main-source($doc)/tei:monogr/tei:imprint/tei:date,
(: extract creation date of unpublished writings not by Weber :)
$doc//tei:creation/tei:date[@* except @cert]
)[1],
true()
)
case 'letters' return date:getOneNormalizedDate(($doc//tei:correspAction[@type='sent']/tei:date, $doc//tei:correspAction[@type='received']/tei:date)[1], true())
case 'biblio' return date:getOneNormalizedDate($doc//tei:imprint[1]/tei:date, true())
case 'diaries' return $doc/tei:ab/data(@n)
Expand Down

0 comments on commit 90d146e

Please sign in to comment.