xmldb:authenticate($collection-uri as xs:string, $user-id as xs:string?, $password as xs:string?) xs:boolean
Check if the user, $user-id, can authenticate against the database collection $collection-uri. The function simply tries to read the collection $collection-uri, using the credentials $user-id and $password. It returns true if the authentication succeeds, false otherwise.
Returns true() on successful authentication, false() otherwise
xmldb:change-user($user-id as xs:string, $password as xs:string?, $groups as xs:string*, $home-collection as xs:string?) empty()
Change properties of an existing database user. The XQuery owner must have appropriate privileges to do this, e.g. having DBA role. $user-id is the username, $password is the password, $groups is the sequence of group memberships, $home-collection is the home collection. The username, $user-id, is mandatory. Non-empty values for the other parameters are optional, where if empty the existing value is used.
xmldb:chmod-collection($collection as xs:string, $mode as xs:integer) empty()
Sets the mode of collection $collection. $mode is the mode as xs:integer. PLEASE REMEMBER that octal number 0755 is 7*64+5*8+5 i.e. 493 in decimal NOT 755. You can use util:base-to-integer(0755, 8) as argument for convenience.
xmldb:chmod-resource($collection as xs:string, $resource as xs:string, $mode as xs:integer) empty()
Sets the mode of the resource $resource in collection $collection, $mode is the mode as xs:integer. PLEASE REMEMBER that octal number 0755 is 7*64+5*8+5 i.e. 493 in decimal NOT 755. You can use util:base-to-integer(0755, 8) as argument for convenience.
xmldb:collection-available($collection-path as xs:string) xs:boolean
Returns true() if the collection $collection exists and is available, otherwise false().
Returns true() if the collection exists and is available, false() otherwise
xmldb:collection-exists($collection-path as xs:string, ...) xs:boolean
Returns true() if the collection $collection exists and is available, otherwise false().
Returns true() if the collection exists and is available, false() otherwise
Deprecated: Use xmldb:collection-available() instead.
This function could be removed at anytime during the 1.5 development and will be removed in the 1.6 release.
xmldb:copy($source-collection-uri as xs:string, $target-collection-uri as xs:string) empty()
Copy the collection $source-collection-uri to the collection $target-collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
xmldb:copy($source-collection-uri as xs:string, $target-collection-uri as xs:string, $resource as xs:string) empty()
Copy the resource $resource in $source-collection-uri to collection $target-collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
xmldb:create-collection($target-collection-uri as xs:string, $new-collection as xs:string) xs:string?
Create a new collection with name $new-collection as a child of $target-collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.Returns the path to the new collection if successfully created, otherwise the empty sequence.
Returns the path to the new collection if successfully created, otherwise the empty sequence
xmldb:create-user($user-id as xs:string, $password as xs:string, $groups as xs:string+, $home-collection-uri as xs:string?) empty()
Create a new user, $user-id, in the database. The XQuery owner must have appropriate privileges to do this, e.g. having DBA role. $user-id is the username, $password is the password, $groups is the sequence of group memberships. The first group in the sequence is the primary group.$home-collection-uri is the home collection URI.Collection URIs can be specified either as a simple collection path or an XMLDB URI.
xmldb:created($collection-uri as xs:string) xs:dateTime
Returns the creation date of the collection $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
Returns the creation date
xmldb:created($collection-uri as xs:string, $resource as xs:string) xs:dateTime
Returns the creation date of the resource $resource in $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
Returns the creation date
xmldb:decode($string as xs:string) xs:string
Decodes the string $string such that any percent encoded octets will be translated to their decoded UTF-8 representation.
Returns the decoded string
xmldb:decode-uri($uri as xs:anyURI) xs:string
Decodes the URI $uri such that any percent encoded octets will be translated to their decoded UTF-8 representation.
Returns the decoded $uri as xs:string
xmldb:defragment($nodes as node()+) empty()
Start a defragmentation run on each document which has a node in $nodes. Fragmentation may occur if nodes are inserted into a document using XQuery update extensions. Please note that defragmenting a document changes its internal structure, so any references to this document will become invalid, in particular, variables pointing to some nodes in the document.
xmldb:defragment($nodes as node()+, $integer as xs:integer) empty()
Start a defragmentation run on each document which has a node in $nodes. Fragmentation may occur if nodes are inserted into a document using XQuery update extensions. The second argument specifies the minimum number of fragmented pages which should be in a document before it is considered for defragmentation. Please note that defragmenting a document changes its internal structure, so any references to this document will become invalid, in particular, variables pointing to some nodes in the document.
xmldb:delete-user($user-id as xs:string) empty()
Deletes an existing user, $user-id, in the database. This does not delete the user's home collection. The XQuery owner must have appropriate privileges to do this, e.g. having DBA role, and not being the owner of the currently running XQuery. You cannot delete the owner of the currently running XQuery.
xmldb:document($document-uris as xs:string+, ...) node()*
Returns the documents $document-uris in the input sequence. Collection URIs can be specified either as a simple collection path or an XMLDB URI.If the input sequence is empty, the function will load all documents in the database.
Returns the documents
Deprecated: See the standard fn:doc() function
This function could be removed at anytime during the 1.5 development and will be removed in the 1.6 release.
xmldb:document-has-lock($collection-uri as xs:string, $resource as xs:string) xs:string?
Returns the user-id of the user that holds a write lock on the resource $resource in the collection $collection-uri. If no lock is in place, the empty sequence is returned. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
Returns the user id of the lock owner, otherwise if not locked the empty sequence
xmldb:encode($string as xs:string) xs:string
Encodes the string $string such that it will be a valid collection or resource path. Provides similar functionality to java's URLEncoder.encode() function, with some enhancements.
Returns the URL encoded string
xmldb:encode-uri($string as xs:string) xs:anyURI
Encodes the string $string such that it will be a valid collection or resource path. Provides similar functionality to java's URLEncoder.encode() function, with some enhancements. Returns an xs:anyURI object representing a valid XmldbURI
Returns the XmldbURI encoded from $string
xmldb:exists-user($user-id as xs:string) xs:boolean
Returns true if the user $user-id exists.
Returns true() if the user exists, false() otherwise
xmldb:get-child-collections($collection-uri as xs:string) xs:string*
Returns the names of the child collections in the collection $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
Returns the sequence of child collection names
xmldb:get-child-resources($collection-uri as item()) xs:string*
Returns the names of the child resources in collection $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
Returns the sequence of resource names
xmldb:get-current-user() xs:string
Returns the user-id of the current user from the xquery context.
Returns the user-id of the current user
xmldb:get-group($collection-uri as xs:string) xs:string?
Returns the owner group of the collection $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
Returns the owner group
xmldb:get-group($collection-uri as xs:string, $resource as xs:string) xs:string?
Returns the owner group of the resource $resource in the collection $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
Returns the owner group
xmldb:get-mime-type($resource-uri as xs:anyURI) xs:string?
Returns the MIME type if available of the resource $resource-uri, otherwise the empty sequence. Resource URIs can be specified either as a simple collection path, an XMLDB URI or any URI.
Returns the mime-type if available, otherwise the empty sequence
xmldb:get-owner($collection-uri as item()) xs:string?
Returns the owner user-id of the collection $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
Returns the user-id
xmldb:get-owner($collection-uri as item(), $resource as xs:string) xs:string?
Returns the owner user-id of the resource $resource in collection $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
Returns the user-id
xmldb:get-permissions($collection-uri as xs:string) xs:int?
Returns the permissions assigned to the collection $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
Returns the collection permissions
xmldb:get-permissions($collection-uri as xs:string, $resource as xs:string) xs:int?
Returns the permissions assigned to the resource $resource in collection $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
Returns the resource permissions
xmldb:get-user-groups($user-id as xs:string) xs:string+
Returns the sequence of groups the user $user-id is a member of.
Returns the group memberships
xmldb:get-user-home($user-id as xs:string) xs:anyURI?
Returns the user's home collection URI or the empty sequence if no home collection is assigned to the user $user-id.
Returns the home collection URI of user $user-id if one is assigned, otherwise the empty sequence
xmldb:is-admin-user($user-id as xs:string) xs:boolean?
Returns true() if user $user-id has DBA role, false() otherwise.
Returns true() if user has DBA role, false() otherwise
xmldb:last-modified($collection-uri as item(), $resource as xs:string) xs:dateTime?
Returns the last-modification date of resource $resource in collection $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
Returns the last modification date
xmldb:login($collection-uri as xs:string, $user-id as xs:string?, $password as xs:string?) xs:boolean
Login the user, $user-id, and set it as the owner of the currently executing XQuery. It returns true if the authentication succeeds, false otherwise. If called from a HTTP context the login is cached for the lifetime of the HTTP session and may be used for any XQuery run in that session. If an HTTP session does not already exist, none will be created.
Returns true() on successful authentication and owner elevation, false() otherwise
xmldb:login($collection-uri as xs:string, $user-id as xs:string?, $password as xs:string?, $create-session as xs:boolean?) xs:boolean
Login the user, $user-id, and set it as the owner of the currently executing XQuery. It returns true() if the authentication succeeds, false() otherwise. If called from a HTTP context the login is cached for the lifetime of the HTTP session and may be used for any XQueryrun in that session. $create-session specifies whether to create an HTTP session on successful authentication or not. If $create-session is false() or the empty sequence no session will be created if one does not already exist.
Returns true() on successful authentication and owner elevation, false() otherwise
xmldb:move($source-collection-uri as xs:string, $target-collection-uri as xs:string) empty()
Moves the collection $source-collection-uri into the collection $target-collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
xmldb:move($source-collection-uri as xs:string, $target-collection-uri as xs:string, $resource as xs:string) empty()
Moves the resource $resource from the collection $source-collection-uri into collection $target-collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
xmldb:permissions-to-string($permissions as xs:integer) xs:string?
Formats the resource or collection permissions, $permissions, passed as an integer value into a string. The returned string shows the permissions following the Unix conventions, i.e. all permissions set is returned as rwurwurwu, where the first three chars are for user permissions, followed by group and other users. 'r' denotes read, 'w' write and 'u' update permissions.
Returns the permissions as string 'rwu' for, user, group and other
xmldb:register-database($driver as xs:string, $create-db as xs:boolean) xs:boolean
Registers an XMLDB driver class with the XMLDB Database Manager. This is only required if you want to access a database instance different from the one that executes the XQuery.
Returns true() if successfully registered, false() otherwise
xmldb:reindex($collection-path as xs:string) xs:boolean
Reindex collection $collection-path. The XQuery owner must have appropriate privileges to do this, e.g. having DBA role.
Returns true() if successfully reindexed, false() otherwise
xmldb:remove($collection-uri as xs:string) empty()
Removes the collection $collection-uri and its contents from the database. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
xmldb:remove($collection-uri as xs:string, $resource as xs:string) empty()
Removes the resource $resource from the collection $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
xmldb:rename($collection-uri as xs:string, $resource as xs:string, $new-resource-name as xs:string) empty()
Renames the resource $resource in collection $collection-uri with new name $new-resource-name. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
xmldb:rename($source-collection-uri as xs:string, $new-collection-name as xs:string) empty()
Renames the collection $source-collection-uri with new name $new-collection-name. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
xmldb:set-collection-permissions($collection-uri as xs:string, $user-id as xs:string, $group-id as xs:string, $permissions as xs:integer) empty()
Sets the permissions of the collection $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI. $user-id specifies the user which will become the owner of the resource, $group-id the group, and $permissons the permissions as an xs:integer value. PLEASE REMEMBER that octal number 0755 is 7*64+5*8+5 i.e. 493 in decimal NOT 755. You can use util:base-to-integer(0755, 8) as argument for convenience.
xmldb:set-resource-permissions($collection-uri as xs:string, $resource as xs:string, $user-id as xs:string, $group-id as xs:string, $permissions as xs:integer) empty()
Sets the permissions of the resource $resource in collection $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI. $user-id specifies the user which will become the owner of the resource, $group-id the group, and $permissions the permissions as an xs:integer value. PLEASE REMEMBER that octal number 0755 is 7*64+5*8+5 i.e. 493 in decimal NOT 755. You can use util:base-to-integer(0755, 8) as argument for convenience.
xmldb:size($collection-uri as xs:string, $resource as xs:string) xs:long
Returns the estimated size of the resource $resource (in bytes) in the collection $collection-uri. The estimation is based on the number of pages occupied by the resource. If the document is serialized back to a string, its size may be different, since parts of the structural information are stored in compressed form. Collection URIs can be specified either as a simple collection path or an XMLDB URI.
Returns the size of the pages, occupied by the resource, in bytes
xmldb:store($collection-uri as xs:string, $resource-name as xs:string?, $contents as item()) xs:string?
Stores a new resource into the database. The resource is stored in the collection $collection-uri with the name $resource-name. Collection URIs can be specified either as a simple collection path or an XMLDB URI. The contents $contents, is either a node, an xs:string, a Java file object or an xs:anyURI. A node will be serialized to SAX. It becomes the root node of the new document. If $contents is of type xs:anyURI, the resource is loaded from that URI. Returns the path to the new document if successfully stored, otherwise an XPathException is thrown.
Returns the path to new resource if sucessfully stored, otherwise the emtpty sequence
xmldb:store($collection-uri as xs:string, $resource-name as xs:string?, $contents as item(), $mime-type as xs:string) xs:string?
Stores a new resource into the database. The resource is stored in the collection $collection-uri with the name $resource-name. Collection URIs can be specified either as a simple collection path or an XMLDB URI. The contents $contents, is either a node, an xs:string, a Java file object or an xs:anyURI. A node will be serialized to SAX. It becomes the root node of the new document. If $contents is of type xs:anyURI, the resource is loaded from that URI. The final argument $mime-type is used to specify a mime type. If the mime-type is not a xml based type, the resource will be stored as a binary resource.Returns the path to the new document if successfully stored, otherwise an XPathException is thrown.
Returns the path to new resource if sucessfully stored, otherwise the emtpty sequence
xmldb:store-files-from-pattern($collection-uri as xs:string, $directory as xs:string, $pattern as xs:string+) xs:string*
Stores new resources into the database. Resources are read from the server's file system, using file patterns. The function returns a sequence of all document paths added to the db. These can be directly passed to fn:doc() to retrieve the document(s).
Returns the sequence of document paths
xmldb:store-files-from-pattern($collection-uri as xs:string, $directory as xs:string, $pattern as xs:string+, $mime-type as xs:string) xs:string*
Stores new resources into the database. Resources are read from the server's file system, using file patterns. The function returns a sequence of all document paths added to the db. These can be directly passed to fn:doc() to retrieve the document(s).
Returns the sequence of document paths
xmldb:store-files-from-pattern($collection-uri as xs:string, $directory as xs:string, $pattern as xs:string+, $mime-type as xs:string, $preserve-structure as xs:boolean) xs:string*
Stores new resources into the database. Resources are read from the server's file system, using file patterns. The function returns a sequence of all document paths added to the db. These can be directly passed to fn:doc() to retrieve the document(s).
Returns the sequence of document paths
xmldb:update($collection-uri as xs:string, $modifications as node()) xs:integer
Processes an XUpdate request, $modifications, against a collection $collection-uri. Collection URIs can be specified either as a simple collection path or an XMLDB URI.The modifications are passed in a document conforming to the XUpdate specification. http://rx4rdf.liminalzone.org/xupdate-wd.html#N1a32e0The function returns the number of modifications caused by the XUpdate.
Returns the number of modifications, as xs:integer, caused by the XUpdate
xmldb:xcollection($collection-uris as xs:string+) node()*
Returns the document nodes in the collections $collection-uris non-recursively, i.e. does not include document nodes found in sub-collections. C.f. fn:collection(). Collection URIs can be specified either as a simple collection path or an XMLDB URI.
Returns the document nodes from the specified collections excluding sub-collections