Skip to content

Instantly share code, notes, and snippets.

@CJHArch
Created January 12, 2015 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CJHArch/b28e555dc1b365a651a8 to your computer and use it in GitHub Desktop.
Save CJHArch/b28e555dc1b365a651a8 to your computer and use it in GitHub Desktop.
xQuery for finding collective access data from EADs exported from Hartford Jewish Historical Society's instance of Archivists Toolkit (AT). Imported into BaseX with namespaces stripped.
xquery version "3.0";
<results>
{
for $ead in /ead
let $titleproper:= $ead/eadheader/filedesc/titlestmt/titleproper[1]/text()
let $creator := $ead/archdesc/did/unittitle
let $dates:= $ead/archdesc/did/unitdate
let $publisher:= $ead/eadheader/filedesc/publicationstmt/publisher
let $abstract := $ead/archdesc/scopecontent/p
let $unitid := $ead/archdesc/did/unitid
return
<record>
<title>{data($titleproper)}</title>
<creator>{data($creator)}</creator>
<dates>{data($dates)}</dates>
<unitid>{data($unitid)}</unitid>
<publisher>{data($publisher)}</publisher>
<abstract>{data($abstract)}</abstract>
</record>
}
</results>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment