Skip to content

Instantly share code, notes, and snippets.

@caschwartz
Created June 8, 2016 14:47
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 caschwartz/e9b4ab6cf24f5af43434e0d88871b9aa to your computer and use it in GitHub Desktop.
Save caschwartz/e9b4ab6cf24f5af43434e0d88871b9aa to your computer and use it in GitHub Desktop.
Function to get copy numbers from Ex Libris Voyager items record
(: Check for copy numbers in the items record :)
declare function mpm:get-copy-info($seq as xs:integer)
as node()*
{
let $records := xdmp:directory(concat("/Monographs/", $seq, "/"), "infinity")
let $items := $records/holdings/institution/holding/item (: May be more than one item record :)
for $item in $items
let $copy-info := $item/itemData[@name = "copy"]
return $copy-info
};
@caschwartz
Copy link
Author

Wrote this function for an XQuery module to submit our print holdings to the HathiTrust, but did not end up using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment