Skip to content

Commit

Permalink
process editors as "dies." #470
Browse files Browse the repository at this point in the history
if identical with authors
  • Loading branch information
peterstadler committed Jun 27, 2024
1 parent 7825a33 commit 32a395e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions catalogues/dictionary_de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@
<entry xml:id="leaf">Bl.</entry>
<entry xml:id="issue">Heft</entry>
<entry xml:id="edBy">hg. von</entry>
<entry xml:id="edByIdemM">dems.</entry>
<entry xml:id="edByIdemF">ders.</entry>
<entry xml:id="ed">Hg.</entry>
<entry xml:id="detailsAvailable">Details verfügbar</entry>
<entry xml:id="emptyResultSet">Zu dieser Filtereinstellung wurden keine Einträge gefunden.</entry>
Expand Down
2 changes: 2 additions & 0 deletions catalogues/dictionary_en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@
<entry xml:id="leaf">f</entry>
<entry xml:id="issue">issue</entry>
<entry xml:id="edBy">ed. by</entry>
<entry xml:id="edByIdemM">idem</entry>
<entry xml:id="edByIdemF">idem</entry>
<entry xml:id="ed">Ed.</entry>
<entry xml:id="detailsAvailable">more details</entry>
<entry xml:id="emptyResultSet">No entries found for this filter setting.</entry>
Expand Down
22 changes: 20 additions & 2 deletions modules/bibl.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ declare namespace mei="http://www.music-encoding.org/ns/mei";
declare namespace xhtml="http://www.w3.org/1999/xhtml";
declare namespace exist="http://exist.sourceforge.net/NS/exist";
import module namespace config="http://xquery.weber-gesamtausgabe.de/modules/config" at "config.xqm";
import module namespace crud="http://xquery.weber-gesamtausgabe.de/modules/crud" at "crud.xqm";
import module namespace lang="http://xquery.weber-gesamtausgabe.de/modules/lang" at "lang.xqm";
import module namespace str="http://xquery.weber-gesamtausgabe.de/modules/str" at "xmldb:exist:///db/apps/WeGA-WebApp-lib/xquery/str.xqm";
import module namespace wega-util="http://xquery.weber-gesamtausgabe.de/modules/wega-util" at "wega-util.xqm";
Expand Down Expand Up @@ -375,12 +376,29 @@ declare %private function bibl:idno($idnos as element(tei:idno)*) as element(xht
};

(:~
:
: Process editors
: Helper function for bibl:printBookCitation and bibl:printIncollectionCitation
:)
declare %private function bibl:edited-by($biblStruct as element(tei:biblStruct), $lang as xs:string) as item()* {
let $editors := bibl:printCitationAuthors($biblStruct/tei:monogr/tei:editor, $lang)
let $ders as xs:boolean :=
count($biblStruct/tei:monogr/tei:editor) eq 1 and
count($biblStruct/tei:analytic/tei:author) eq 1 and
exists($biblStruct/tei:monogr/tei:editor/@key) and
exists($biblStruct/tei:analytic/tei:author/@key) and
$biblStruct/tei:monogr/tei:editor/@key = $biblStruct/tei:analytic/tei:author/@key
let $sex :=
if($ders)
then crud:doc($biblStruct/tei:monogr/tei:editor/@key)//tei:sex
else ()
return
if(exists($editors))
then (concat(', ', lang:get-language-string('edBy', $lang), ' '), $editors)
then
if($sex = 'm')
then (concat(', ', lang:get-language-string('edBy', $lang), ' '), <xhtml:span class="editor">{lang:get-language-string('edByIdemM', $lang)}</xhtml:span>)
else
if($sex = 'f')
then (concat(', ', lang:get-language-string('edBy', $lang), ' '), <xhtml:span class="editor">{lang:get-language-string('edByIdemF', $lang)}</xhtml:span>)
else (concat(', ', lang:get-language-string('edBy', $lang), ' '), $editors)
else ()
};

0 comments on commit 32a395e

Please sign in to comment.