Skip to content

Instantly share code, notes, and snippets.

@CJHArch
Created January 16, 2015 15:56
Show Gist options
  • Save CJHArch/3f9a5fb0a9d04df10270 to your computer and use it in GitHub Desktop.
Save CJHArch/3f9a5fb0a9d04df10270 to your computer and use it in GitHub Desktop.
This xQuery will grab PIDs and access rights metadata records from Digitool digital entities imported into BaseX. Namespaces were NOT stripped, so the name space declaration in line two is necessary.
xquery version "3.0";
declare namespace xb="http://com/exlibris/digitool/repository/api/xmlbeans";
<data>
{
for $Record in /xb:digital_entity_call
let $PID := $Record/xb:digital_entity/pid
let $arrecord := $Record/xb:digital_entity/mds/md[type[contains (., 'rights_md')]]
return
<record><pid>{data($PID)}</pid> {$arrecord}</record>
}
</data>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment