Skip to content

Instantly share code, notes, and snippets.

@CliffordAnderson
Created February 13, 2020 20:24
Show Gist options
  • Save CliffordAnderson/29d57d5c22307353e5a3f9d977b1546b to your computer and use it in GitHub Desktop.
Save CliffordAnderson/29d57d5c22307353e5a3f9d977b1546b to your computer and use it in GitHub Desktop.
For Mark S.
xquery version "3.1";
let $docs := fn:collection("bpp-quarterly")
let $csv := element csv {
for $doc in $docs/Record
return
<record>
<title>{$doc/RecordTitle/text()}</title>
<publication>{$doc/Publication/Title/text()}</publication>
<volume>{$doc/Volume/text()}</volume>
<issue>{$doc/Issue/text()}</issue>
<date>{$doc/AlphaPubDate/text()}</date>
<pages>{$doc/Pagination/text()}</pages>
<link>{$doc/URLDocView/text()}</link>
<text>{$doc/FullText/text()}</text>
</record>}
return csv:serialize($csv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment