Last active
December 10, 2015 22:29
-
-
Save windauer/4502578 to your computer and use it in GitHub Desktop.
Various XQuery Snippets
xmldb:reindex("/path/to/collections")
<collection xmlns="http://exist-db.org/collection-config/1.0">
<index xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mods="http://www.loc.gov/mods/v3">
<fulltext default="none" attributes="false"/>
<lucene>
<text match="@name"/>
<text match="description"/>
<text match="comment"/>
</lucene>
<!-- Indexes for parameter files -->
<create qname="@id" type="xs:string"/>
<create qname="@source" type="xs:string"/>
<create qname="@refid" type="xs:string"/>
<create qname="text" type="xs:string"/>
</index>
</collection>
update replace $nodeToReplace with $nodeToInsert
update insert $entry into $entries
Namespace: port module namespace xmldb="http://exist-db.org/xquery/xmldb";
- Check if group exists:
xmldb:group-exists($group/@name)
- Create Group:
xmldb:create-group($group/@name, $group/@manager)
- Check if user exists:
xmldb:exists-user($user/@name)
- Create Group:
xmldb:create-user($user/@name, $user/@password, tokenize(data($user/@groups), ' ')
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment