Skip to content

Instantly share code, notes, and snippets.

@CliffordAnderson
Created August 26, 2015 23:54
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 CliffordAnderson/1a60e70cee1a3442167c to your computer and use it in GitHub Desktop.
Save CliffordAnderson/1a60e70cee1a3442167c to your computer and use it in GitHub Desktop.
Example XQuery for Sara S.
xquery version "3.1";
declare namespace marc = "http://www.loc.gov/MARC21/slim";
let $individual := <ignore-me><marc:controlfield tag="008">141001s2012 gaua 000 p eng d</marc:controlfield></ignore-me>
let $header := $individual/marc:controlfield[@tag='008']/text()
let $publoc := fn:substring($header,16,3)
where $publoc = ("gau", "other", "codes")
return $publoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment