Skip to content

Commit

Permalink
changing from biblScope/@type to @unit
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Jan 13, 2017
1 parent 9914a2a commit 9c5b3d0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
24 changes: 12 additions & 12 deletions modules/bibl.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ declare function bibl:printBookCitation($biblStruct as element(tei:biblStruct),
if(exists($editors) and exists($authors)) then (concat(', ', lang:get-language-string('edBy', $lang), ' '), $editors) else (),
if(exists($series)) then (' (', $series, '), ') else ', ',
$pubPlaceNYear,
if($biblStruct//tei:imprint/tei:biblScope[@type = 'pp']) then concat(', ', lang:get-language-string('pp', $lang), ' ', replace($biblStruct//tei:imprint/tei:biblScope[@type = 'pp'], '-', '–')) else ()
if($biblStruct//tei:imprint/tei:biblScope[@unit = 'pp']) then concat(', ', lang:get-language-string('pp', $lang), ' ', replace($biblStruct//tei:imprint/tei:biblScope[@unit = 'pp'], '-', '–')) else ()
}
};

Expand Down Expand Up @@ -140,7 +140,7 @@ declare function bibl:printIncollectionCitation($biblStruct as element(tei:biblS
if(exists($editor)) then (concat(', ', lang:get-language-string('edBy', $lang), ' '), $editor) else (),
if(exists($series)) then (' ',<xhtml:span>({$series})</xhtml:span>) else (),
if(exists($pubPlaceNYear)) then (', ', $pubPlaceNYear) else(),
if($biblStruct//tei:imprint/tei:biblScope[@type = 'pp']) then concat(', ', lang:get-language-string('pp', $lang), '&#160;', replace($biblStruct//tei:imprint/tei:biblScope[@type = 'pp'], '-', '–')) else ()
if($biblStruct//tei:imprint/tei:biblScope[@unit = 'pp']) then concat(', ', lang:get-language-string('pp', $lang), '&#160;', replace($biblStruct//tei:imprint/tei:biblScope[@unit = 'pp'], '-', '–')) else ()
}
};

Expand Down Expand Up @@ -175,17 +175,17 @@ declare function bibl:printJournalCitation($monogr as element(tei:monogr), $wrap
:)
declare %private function bibl:biblScope($parent as element(), $lang as xs:string) as xs:string {
concat(
if($parent/tei:biblScope/@type = 'vol') then concat(', ', lang:get-language-string('vol', $lang), '&#160;', $parent/tei:biblScope[@type = 'vol']) else (),
if($parent/tei:biblScope/@type = 'jg') then concat(', ', 'Jg.', '&#160;', $parent/tei:biblScope[@type = 'jg']) else (),
if($parent/tei:biblScope/@unit = 'vol') then concat(', ', lang:get-language-string('vol', $lang), '&#160;', $parent/tei:biblScope[@unit = 'vol']) else (),
if($parent/tei:biblScope/@unit = 'jg') then concat(', ', 'Jg.', '&#160;', $parent/tei:biblScope[@unit = 'jg']) else (),
(: Vierstellige Jahresangaben werden direkt nach vol oder bd ausgegeben :)
if(matches(normalize-space($parent/tei:date), '^\d{4}$') and $parent/tei:biblScope/@type = ('vol', 'jg')) then concat(' (', $parent/tei:date, ')') else (),
if($parent/tei:biblScope/@type = 'issue') then concat(', ', lang:get-language-string('issue', $lang), '&#160;', $parent/tei:biblScope[@type = 'issue']) else (),
if($parent/tei:biblScope/@type = 'nr') then concat(', ', 'Nr.', '&#160;', $parent/tei:biblScope[@type = 'nr']) else (),
if(matches(normalize-space($parent/tei:date), '^\d{4}$') and $parent/tei:biblScope/@unit = ('vol', 'jg')) then concat(' (', $parent/tei:date, ')') else (),
if($parent/tei:biblScope/@unit = 'issue') then concat(', ', lang:get-language-string('issue', $lang), '&#160;', $parent/tei:biblScope[@unit = 'issue']) else (),
if($parent/tei:biblScope/@unit = 'nr') then concat(', ', 'Nr.', '&#160;', $parent/tei:biblScope[@unit = 'nr']) else (),
(: Alle anderen Datumsausgaben hier :)
if(string-length(normalize-space($parent/tei:date)) gt 4 or (string-length(normalize-space($parent/tei:date)) gt 0 and not($parent/tei:biblScope/@type = ('vol', 'jg')))) then concat(' (', $parent/tei:date, ')') else (),
if(string-length(normalize-space($parent/tei:date)) gt 4 or (string-length(normalize-space($parent/tei:date)) gt 0 and not($parent/tei:biblScope/@unit = ('vol', 'jg')))) then concat(' (', $parent/tei:date, ')') else (),
if($parent/tei:note/@type = 'additional') then concat(' ', $parent/tei:note[@type = 'additional']) else (),
if($parent/tei:biblScope/@type = 'pp') then concat(', ', lang:get-language-string('pp', $lang), '&#160;', replace($parent/tei:biblScope[@type = 'pp'], '-', '–')) else (),
if($parent/tei:biblScope/@type = 'col') then concat(', ', lang:get-language-string('col', $lang), '&#160;', replace($parent/tei:biblScope[@type = 'col'], '-', '–')) else ()
if($parent/tei:biblScope/@unit = 'pp') then concat(', ', lang:get-language-string('pp', $lang), '&#160;', replace($parent/tei:biblScope[@unit = 'pp'], '-', '–')) else (),
if($parent/tei:biblScope/@unit = 'col') then concat(', ', lang:get-language-string('col', $lang), '&#160;', replace($parent/tei:biblScope[@unit = 'col'], '-', '–')) else ()
)
};

Expand All @@ -201,8 +201,8 @@ declare %private function bibl:biblScope($parent as element(), $lang as xs:strin
:)
declare %private function bibl:printSeriesCitation($series as element(tei:series), $wrapperElement as xs:string, $lang as xs:string) as element() {
let $biblScope := concat(
if($series/tei:biblScope[@type = 'vol']) then concat(', ', lang:get-language-string('vol', $lang), '&#160;', $series/tei:biblScope[@type = 'vol']) else (),
if($series/tei:biblScope[@type = 'issue']) then concat(', ', lang:get-language-string('issue', $lang), '&#160;', $series/tei:biblScope[@type = 'issue']) else ()
if($series/tei:biblScope[@unit = 'vol']) then concat(', ', lang:get-language-string('vol', $lang), '&#160;', $series/tei:biblScope[@unit = 'vol']) else (),
if($series/tei:biblScope[@unit = 'issue']) then concat(', ', lang:get-language-string('issue', $lang), '&#160;', $series/tei:biblScope[@unit = 'issue']) else ()
)
return
element {$wrapperElement} {
Expand Down
6 changes: 3 additions & 3 deletions modules/wdt.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ declare function wdt:writings($item as item()*) as map(*) {
let $normDate := query:get-normalized-date($node)
let $source := query:get-main-source($node)
let $journal := string-join($source/tei:monogr/tei:title[@level = 'j']/str:normalize-space(.), '. ')
let $jg := functx:pad-integer-to-length(number($source//tei:biblScope[@type='jg'][1]), 6)
let $nr := functx:pad-integer-to-length(number($source//tei:biblScope[@type='nr'][1]), 6)
let $pp := functx:pad-integer-to-length(number(functx:substring-before-if-contains($source//tei:biblScope[@type='pp'][1], '-')), 6)
let $jg := functx:pad-integer-to-length(number($source//tei:biblScope[@unit='jg'][1]), 6)
let $nr := functx:pad-integer-to-length(number($source//tei:biblScope[@unit='nr'][1]), 6)
let $pp := functx:pad-integer-to-length(number(functx:substring-before-if-contains($source//tei:biblScope[@unit='pp'][1], '-')), 6)
return
(if(exists($normDate)) then $normDate else 'xxxx-xx-xx') || $journal || $jg || $nr || $pp
}, ())
Expand Down

0 comments on commit 9c5b3d0

Please sign in to comment.