-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint-palimpsest-hierarchy.xq
More file actions
26 lines (20 loc) · 986 Bytes
/
Copy pathprint-palimpsest-hierarchy.xq
File metadata and controls
26 lines (20 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import module namespace functx = "http://www.functx.com";
declare default element namespace "http://www.tei-c.org/ns/1.0";
declare variable $input-directory := "/home/arren/Documents/GitHub/britishLibrary-data/data/tei/";
declare function local:collate-part-info($part as node(), $tabs as xs:integer) {
let $uri := $part/msIdentifier/idno[@type="URI"]/text()
let $shelfmark := $part/msIdentifier/altIdentifier/idno[@type="BL-Shelfmark"]/text()
let $indent := for $i in 1 to $tabs return " "
let $indent := string-join($indent, "")
let $returnString := $indent||$shelfmark||" | ("||$uri||")
"
return concat(
$returnString,
for $subpart in $part/msPart
return local:collate-part-info($subpart, $tabs+1)
)
};
for $doc in collection($input-directory)
where $doc//relation[@name="syriaca:has-palimpsest-upper"] or $doc//relation[@name="syriaca:has-palimpsest-lower"]
let $msDesc := $doc//sourceDesc/msDesc
return local:collate-part-info($msDesc, 0)