Skip to content

Instantly share code, notes, and snippets.

@kschlottmann
Last active January 9, 2021 20:54
Show Gist options
  • Select an option

  • Save kschlottmann/ea950d4fbbf54d714d8646dfe026f8d4 to your computer and use it in GitHub Desktop.

Select an option

Save kschlottmann/ea950d4fbbf54d714d8646dfe026f8d4 to your computer and use it in GitHub Desktop.
get c-level restrictions from AS-derived EAD based on date
xquery version "3.0";
<results>
{
for $ead in /ead/archdesc/dsc//accessrestrict[contains(., '2021')]
let $restrict := $ead/p
let $restrictTitle := $ead/../did/unittitle
let $restrictDate := $ead/../did/unitdate[1]
let $restrictId := $ead/@id
let $bib := $ead/ancestor::archdesc/did/unitid[1]
let $local := $ead/ancestor::archdesc/did/unitid[2]
let $title := $ead/ancestor::archdesc/did/unittitle
return
<rec>
{data($bib)} | {data($local)} | {data($title)} | {data($restrict)} | {data($restrictTitle)} | {data($restrictDate)} | {data($restrictId)}
</rec>
}
</results>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment