Skip to content

Commit

Permalink
Update person browse and display to handle both updated data and lega…
Browse files Browse the repository at this point in the history
…cy data in regards to syriaca-tags, vers srophe:tags attributes. See: #1229
  • Loading branch information
wsalesky committed Jun 25, 2020
1 parent d0f5109 commit 340f74f
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 57 deletions.
6 changes: 6 additions & 0 deletions modules/content-negotiation/tei2html.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,18 @@ declare function tei2html:summary-view($nodes as node()*, $lang as xs:string?, $
declare function tei2html:summary-view-persons($nodes as node()*, $id as xs:string?) as item()* {
let $title := if($nodes/descendant-or-self::*[@srophe:tags='#syriaca-headword'][@xml:lang='en']) then
$nodes/descendant-or-self::*[@srophe:tags='#syriaca-headword'][@xml:lang='en'][1]
else if($nodes/descendant-or-self::*[@syriaca-tags='#syriaca-headword'][@xml:lang='en']) then
$nodes/descendant-or-self::*[@syriaca-tags='#syriaca-headword'][@xml:lang='en'][1]
else $nodes/descendant-or-self::tei:title[1]/text()
let $syr-title :=
if($nodes/descendant::*[contains(@srophe:tags,'#syriaca-headword')][matches(@xml:lang,'^syr')][1]) then
<span xml:lang="syr" lang="syr" dir="rtl">{string-join($nodes/descendant::*[contains(@srophe:tags,'#syriaca-headword')][matches(@xml:lang,'^syr')][1]//text(),' ')}</span>
else if($nodes/descendant-or-self::*[@syriaca-tags='#syriaca-headword'][matches(@xml:lang,'^syr')]) then
$nodes/descendant-or-self::*[@syriaca-tags='#syriaca-headword'][matches(@xml:lang,'^syr')]
else if($nodes/descendant::*[contains(@srophe:tags,'#syriaca-headword')]) then
'[Syriac Not Available]'
else if($nodes/descendant::*[contains(@syriaca-tags,'#syriaca-headword')]) then
'[Syriac Not Available]'
else ()
let $ana := for $a in distinct-values($nodes/descendant::tei:seriesStmt/tei:biblScope/tei:title)
return tei2html:translate-series($a)
Expand Down
2 changes: 1 addition & 1 deletion modules/person.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ declare %templates:wrap function person:h1($node as node(), $model as map(*)){
let $title-nodes :=
<srophe-title xmlns="http://www.tei-c.org/ns/1.0">
{(
$model("hits")//tei:persName[@srophe:tags],
$model("hits")//tei:persName,
$model("hits")//tei:seriesStmt,
$model("hits")//tei:person/descendant::tei:birth,
$model("hits")//tei:person/descendant::tei:death,
Expand Down
2 changes: 1 addition & 1 deletion modules/place.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ declare %templates:wrap function place:h1($node as node(), $model as map(*)){
let $title := $model("hits")//tei:place
let $title-nodes :=
<srophe-title xmlns="http://www.tei-c.org/ns/1.0">
{($title//tei:placeName[@srophe:tags='#syriaca-headword'],$title/descendant::tei:idno, $title/descendant::tei:location)}
{($title//tei:placeName,$title/descendant::tei:idno, $title/descendant::tei:location)}
</srophe-title>
return global:tei2html($title-nodes)
};
Expand Down
Loading

0 comments on commit 340f74f

Please sign in to comment.