Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kschlottmann
Last active September 11, 2020 20:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kschlottmann/4c7a3125780c18cd175a29c9ba237928 to your computer and use it in GitHub Desktop.
Save kschlottmann/4c7a3125780c18cd175a29c9ba237928 to your computer and use it in GitHub Desktop.
Get description with 'Mrs' from EAD
<data>
{
for $Record in /ead
where $Record/archdesc/scopecontent/p[contains(., 'Mrs')]
let $id := $Record/archdesc/did/unitid[1]/text()
let $title := $Record/archdesc/did/unittitle
let $repo := $Record/eadheader/eadid/@mainagencycode
let $scopeMrs := $Record/archdesc/scopecontent/p[contains(., 'Mrs')]
return
<record>
{data($id), "|", data($repo), "|", data($title), "|", data($scopeMrs)}
</record>
}
</data>
<data>
{
for $Record in /ead/archdesc//c
where $Record/did/unittitle[contains(., 'Mrs')]
let $id := $Record//ancestor::archdesc/did/unitid[1]/text()
let $title := $Record//ancestor::archdesc/did/unittitle
let $repo := $Record//ancestor::archdesc/did/repository/corpname
let $agentMrs := $Record/did/unittitle[contains(., 'Mrs')]
let $agentMrsRefID := $Record/@id
return
<record>
{data($id), "|", data($repo), "|", data($title), "|", data($agentMrs) , "|", data($agentMrsRefID) }
</record>
}
</data>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment