Skip to content

Instantly share code, notes, and snippets.

@joewiz
Created April 21, 2014 14:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joewiz/11143857 to your computer and use it in GitHub Desktop.
Save joewiz/11143857 to your computer and use it in GitHub Desktop.
Upload a directory of XML files into eXist-db, with XQuery
xquery version "3.0";
(: Set the absolute file path appropriate for your OS :)
let $source-directory :=
(: Mac :)
(: '/Users/Joe/workspace/myapp/data' :)
(: Windows :)
'C:\Users\wicentowskijc\workspace\myapp\data'
let $target-collection :=
'/db/apps/myapps/data'
return
xmldb:store-files-from-pattern($target-collection, $source-directory, '*.xml')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment