Skip to content

Instantly share code, notes, and snippets.

@wcandillon
Created September 30, 2011 09:27
Show Gist options
  • Save wcandillon/1253233 to your computer and use it in GitHub Desktop.
Save wcandillon/1253233 to your computer and use it in GitHub Desktop.
import module namespace guestbook = "http://www.28msec.com/templates/guestbook/guestbook";
import module namespace xqddf = "http://www.zorba-xquery.com/modules/xqddf";
if (fn:exists(xqddf:collection(xs:QName("guestbook:entries"))))
then
()
else
let $entries := fn:doc("xml_files/old_entries.xml")//entry
return
xqddf:insert-nodes(xs:QName("guestbook:entries"), $entries)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment