Skip to content

Instantly share code, notes, and snippets.

@caschwartz
Last active March 10, 2020 13:35
Show Gist options
  • Save caschwartz/5860521 to your computer and use it in GitHub Desktop.
Save caschwartz/5860521 to your computer and use it in GitHub Desktop.
XQuery - Query to locate EAD documents with <controlaccess> element containing subject headings
xquery version "1.0-ml";
(: 8/6/12 Query to locate EAD documents that have a <controlaccess> element with subject headings. :)
declare namespace ead = "urn:isbn:1-931666-22-9";
for $doc in xdmp:directory("/EAD/")
let $controlAccess := $doc/ead:ead/ead:archdesc/ead:controlaccess[2] (: Second controlaccess element contains subjects :)
let $title := $doc/ead:ead/ead:eadheader/ead:filedesc/ead:titlestmt/ead:titleproper
return $controlAccess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment