Skip to content

Instantly share code, notes, and snippets.

@kschlottmann
Created May 4, 2020 21:55
Show Gist options
  • Select an option

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

Select an option

Save kschlottmann/05e1a19c7fe3de34a66df670d24b1e18 to your computer and use it in GitHub Desktop.
xquery to retrieve series level titles with the string '19' (proxy for selecting finding aids with dates in unittitles)
<data>
{
for $Record in /ead
where $Record/archdesc/dsc//c[@level='series']/did/unittitle[contains(., '19')]
let $id := $Record/archdesc/did/unitid[1]/text()
let $title := $Record/archdesc/did/unittitle
let $repo := $Record/eadheader/eadid/@mainagencycode
return
<record>
<id>{data($id)}</id>
<repo>{data($repo)}</repo>
<title>{data($title)}</title>
</record>
}
</data>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment