From be54f954512ff3652971284b9b8118c143d1d7e7 Mon Sep 17 00:00:00 2001 From: Eugenia Date: Mon, 25 Nov 2024 20:28:37 +0100 Subject: [PATCH] Create clavis-list-file.xql https://github.com/BetaMasaheft/Documentation/issues/2697 --- .../modules/clavis-list-file.xql | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 db/apps/BetMasService/modules/clavis-list-file.xql diff --git a/db/apps/BetMasService/modules/clavis-list-file.xql b/db/apps/BetMasService/modules/clavis-list-file.xql new file mode 100644 index 000000000..1d94f341f --- /dev/null +++ b/db/apps/BetMasService/modules/clavis-list-file.xql @@ -0,0 +1,77 @@ +xquery version "3.1"; +declare namespace t = "http://www.tei-c.org/ns/1.0"; declare namespace xmldb="http://exist-db.org/xquery/xmldb"; + +declare variable $ThisFileContent:= +let $col := '/db/apps/BetMasData/works/1-1000' +let $col1 := '/db/apps/BetMasData/works/1001-2000' +let $col2 := '/db/apps/BetMasData/works/2001-3000' +let $col3 := '/db/apps/BetMasData/works/3001-4000' +let $col4 := '/db/apps/BetMasData/works/4001-5000' +let $col5 := '/db/apps/BetMasData/works/5001-6000' +let $col6 := '/db/apps/BetMasData/works/6001-7000' +let $col7 := '/db/apps/BetMasData/works/7001-8000' +let $colnew := '/db/apps/BetMasData/works/new' +return +
+
+

Clavis Aethiopica listing

+

Visit the dynamic filtrable listing for + fuller results

+

The list below was generated on {format-date(current-date(), "[Y0001]-[M01]-[D01]")} +

+ + +{ +for $book in (collection($col)//t:TEI, collection($col1)//t:TEI, collection($col2)//t:TEI, collection($col3)//t:TEI, collection($col4)//t:TEI, collection($col5)//t:TEI, collection($col6)//t:TEI, collection($colnew)//t:TEI) +let $id := concat('LIT', substring-before(substring-after(base-uri($book), 'LIT'), '.xml')) +let $cae := substring($id, 4, 4) +order by $cae +return + + + + + + + + + +}
CAeMain title
+{$cae} + +{ +let $W := $book//t:titleStmt +let $Maintitle := $W/t:title[@type eq 'main'][@corresp eq '#t1'][text()] +let $amarictitle := $W/t:title[@corresp eq '#t1'][@xml:lang = 'am' or @xml:lang = 'ar'] +let $geztitle := $W/t:title[@corresp eq '#t1'][@xml:lang = 'gez'] +let $entitle := $W/t:title[@corresp eq '#t1'][@xml:lang = 'en'] +return +if ($Maintitle) +then +normalize-space(string-join(($Maintitle[1]))) +else +if ($amarictitle) +then +normalize-space(string-join(($amarictitle[1]))) +else +if ($geztitle) +then +normalize-space(string-join(($geztitle[1]))) +else +if ($entitle) +then +normalize-space(string-join(($entitle[1]))) +else +if ($W/t:title[@xml:id]) +then +let $tit := $W/t:title[@xml:id = 't1'] +return normalize-space(string-join(($tit))) +else +normalize-space(string-join(($W/t:title[1])))} + +
+
+
; +let $filename := "clavis-list.html" +let $doc-db-uri := xmldb:store("/db/apps/BetMasWeb", $filename, $ThisFileContent, "html") +return $doc-db-uri \ No newline at end of file