Skip to content

Instantly share code, notes, and snippets.

@CJHArch
Created February 9, 2015 22:01
Show Gist options
  • Save CJHArch/564e1ab7fc51e8fce1bb to your computer and use it in GitHub Desktop.
Save CJHArch/564e1ab7fc51e8fce1bb to your computer and use it in GitHub Desktop.
This xquery looks at a list of PIDs and grabs the associated records out of the OAI feed. There is probably a more efficient way to do this, but it works.
xquery version "3.0";
<results>
{
for $PIDlist in doc('OH_PIDS_XML.xml')/data/pid/text()
let $OAIRecord := repository/record[header/identifier/substring-after(., "oai:digital.cjh.org:") = $PIDlist]
return
$OAIRecord
}
</results>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment