Skip to content

Instantly share code, notes, and snippets.

@grtjn
Created October 20, 2011 13:33
Show Gist options
  • Save grtjn/1301151 to your computer and use it in GitHub Desktop.
Save grtjn/1301151 to your computer and use it in GitHub Desktop.
A small example of XQuery Data Definition Facility..
(: A small example of XQuery Data Definition Facility.. :)
(: Declare a ‘users’ collection :)
declare collection users as element()*;
(: Declare an index on top of ‘users’ using @id :)
declare automatically maintained index users-by-id
on nodes xqddf:collection( xs:QName("users") )
by @id as xs:string;
(: Filling and using the index :)
xqddf:insert-nodes(
xs:QName("users"), <user id="geert"/>);
xqddf:probe-index-point(
xs:QName("users-by-id"), "geert");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment