diff --git a/.jshintrc b/.jshintrc index d7950be..a7f321f 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,7 +1,7 @@ { "node": true, "browser": false, - "esnext": true, + "esversion": 11, "bitwise": false, "camelcase": false, "curly": true, @@ -11,10 +11,9 @@ "latedef": true, "newcap": false, "noarg": true, - "quotmark": "single", "regexp": true, "undef": true, - "unused": true, + "unused": false, "strict": true, "trailing": true, "smarttabs": true, diff --git a/Gruntfile.js b/Gruntfile.js index be2a2ab..051d1c5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -29,12 +29,12 @@ module.exports = function (grunt) { return new Promise(function (resolve, reject) { var p = axios.post('https://www.bottlecaps.de/rex/', form, { headers }); p.then(function (response) { - fs.writeFileSync(parser.destination, response.data) + fs.writeFileSync(parser.destination, response.data); resolve("saved: " + parser.destination); }) .catch(function (error) { reject(error); - }) + }); }); } @@ -45,7 +45,7 @@ module.exports = function (grunt) { Promise.all(promises).then(function (r){ console.log("dONE",r); }); - console.log("SS") + console.log("SS"); }); grunt.registerMultiTask('index', 'Generate index xqdoc', function () { @@ -96,10 +96,12 @@ module.exports = function (grunt) { }, vows: { all: { + // options: { - verbose: false, + verbose: true, colors: true, - coverage: 'json' + coverage: 'json', + reporter: 'dot-matrix', }, // String or array of strings // determining which files to include. @@ -108,7 +110,7 @@ module.exports = function (grunt) { }, one: { options: { - verbose: false, + verbose: true, colors: false, coverage: 'json' }, diff --git a/lib/compiler/handlers.js b/lib/compiler/handlers.js index eef8839..119dcff 100644 --- a/lib/compiler/handlers.js +++ b/lib/compiler/handlers.js @@ -39,7 +39,7 @@ exports.ModuleImport = function(translator, rootSctx, node,ats) { URILiteral: function(node) { let uri = TreeOps.flatten(node); uri = uri.substring(1, uri.length - 1); - if(moduleURI !== undefined) {return }; //location hints + if(moduleURI !== undefined) {return; } //location hints moduleURI = uri; translator.apply(function(){ rootSctx.importModule(uri, prefix, node.pos,ats); diff --git a/lib/compiler/static_context.js b/lib/compiler/static_context.js index 74cb050..f5acd14 100644 --- a/lib/compiler/static_context.js +++ b/lib/compiler/static_context.js @@ -1,9 +1,15 @@ -/*jshint esversion: 9 */ -const processors = require('../processors'); +"use strict"; +const xqc = require('@quodatum/xq-catalogs'); + +// convert array to object +function keyed(arr) { + const obj = {}; + arr.forEach(f => obj[f.key] = f); + return obj; +} exports.StaticContext = function (parent, pos, processor) { - 'use strict'; - if(parent) processor=parent.processor; + if (parent) { processor = parent.processor; } var TreeOps = require('../tree_ops').TreeOps; var Errors = require('./errors'); @@ -12,7 +18,7 @@ exports.StaticContext = function (parent, pos, processor) { var getSchemaBuiltinTypes = require('./schema_built-in_types').getSchemaBuiltinTypes; //const library = require('./module-library.json'); - + var emptyPos = { sl: 0, sc: 0, el: 0, ec: 0 }; var namespaces = { 'http://www.w3.org/2005/xpath-functions': { @@ -83,8 +89,8 @@ exports.StaticContext = function (parent, pos, processor) { return getVarKey(qname) + '#' + arity; }; - if (!parent) namespaces= {...namespaces,...processors.namespaces(processor)}; - + if (!parent) { namespaces = { ...namespaces, ...xqc.library(processor) }; } + /* staticContext parent:any @@ -219,15 +225,15 @@ exports.StaticContext = function (parent, pos, processor) { namespaces: namespaces, availableModuleNamespaces: [], locations: {}, // ns:{url:..,pos:..} - importModule: function (uri, prefix, pos,ats) { + importModule: function (uri, prefix, pos, ats) { if (this !== this.root) { throw new Error('Function not invoked from the root static context.'); } - if(ats.length>0){ + if (ats.length > 0) { //console.log("@",ats[0]); } - this.addNamespace(uri, prefix, pos, 'module',ats); - // if(ats && ats.length>0 ) console.log("$$$"+ats[0]); + this.addNamespace(uri, prefix, pos, 'module', ats); + // if(ats && ats.length>0 ) console.log("$$$"+ats[0]); if (this.moduleResolver) { try { var mod = this.moduleResolver(uri, ats); @@ -249,7 +255,7 @@ exports.StaticContext = function (parent, pos, processor) { }, getProcessors: function () { - return processors.names(); + return xqc.names(); }, getAvailableModuleNamespaces: function () { @@ -260,7 +266,7 @@ exports.StaticContext = function (parent, pos, processor) { return this.root.namespaces[uri].prefixes; }, - addNamespace: function (uri, prefix, pos, type,ats) { + addNamespace: function (uri, prefix, pos, type, ats) { if (prefix === '' && type === 'module') { throw new StaticWarning('W01', 'Avoid this type of import. Use import module namespace instead', pos); } @@ -291,7 +297,7 @@ exports.StaticContext = function (parent, pos, processor) { pos: pos, type: type }; - if(ats && ats.length) this.locations[uri]=ats; + if (ats && ats.length) { this.locations[uri] = ats; } if (namespace && !namespace.override && !(namespace.uri = uri)) { throw new StaticWarning('W02', '"' + uri + '" already bound to the "' + namespace.prefixes.join(', ') + '" prefix', pos); } @@ -364,7 +370,7 @@ exports.StaticContext = function (parent, pos, processor) { if (namespace) { qname.uri = namespace.uri; } else if (value === 'updating') { - qname.uri = 'http://www.w3.org/2012/xquery' // apb hack for annotations + qname.uri = 'http://www.w3.org/2012/xquery'; // apb hack for annotations } qname.name = value.substring(idx + 1); } @@ -476,7 +482,7 @@ exports.StaticContext = function (parent, pos, processor) { } }, - addFunction: function (qname, pos, params,ret) { + addFunction: function (qname, pos, params, ret) { if (this !== this.root) { throw new Error('addFunction() not invoked from the root static context.'); } @@ -487,7 +493,7 @@ exports.StaticContext = function (parent, pos, processor) { ) { throw new StaticError('XQST0048', '"' + qname.prefix + ':' + qname.name + '": Qname not library namespace', pos); } - if(qname.uri==='' ) qname.uri=this.defaultFunctionNamespace; + if (qname.uri === '') { qname.uri = this.defaultFunctionNamespace; } var key = getFnKey(qname, arity); if (this.functions[key]) { throw new StaticError('XQST0034', '"' + qname.name + '": duplicate function declaration', pos); @@ -498,8 +504,8 @@ exports.StaticContext = function (parent, pos, processor) { pos: pos, params: params }; - if(ret) { - this.functions[key].return=ret; + if (ret) { + this.functions[key].return = ret; } //console.log("AA",this.functions[key]) return this; @@ -508,22 +514,16 @@ exports.StaticContext = function (parent, pos, processor) { }; s.root = parent ? parent.root : s; if (!parent) { - const importable = Object.keys(namespaces).filter(ns => namespaces[ns].type == 'module'); + const importable = Object.keys(namespaces).filter(ns => namespaces[ns].type === 'module'); s.availableModuleNamespaces = importable; - importable.forEach(function(ns){ - const xq=namespaces[ns]; - s.functions={...s.functions,...xq.functions}; - s.variables={...s.variables,...xq.variables}; - }) - + importable.forEach(function (ns) { + const xq = namespaces[ns]; + s.functions = { ...s.functions, ...xq.functions }; + s.variables = { ...s.variables, ...xq.variables }; + }); + } return s; }; -// convert array to object -function keyed(arr){ - const obj={}; - arr.forEach(f=>obj[f.key]=f); - return obj; - }; - \ No newline at end of file + diff --git a/lib/compiler/translator.js b/lib/compiler/translator.js index b9765a4..b8e87fd 100644 --- a/lib/compiler/translator.js +++ b/lib/compiler/translator.js @@ -170,7 +170,7 @@ exports.Translator = function (rootStcx, ast) { seenAt = 'at' === token.value; }, URILiteral: function (node) { - if (!seenAt) { return }; + if (!seenAt) { return ;} var uri = TreeOps.flatten(node); uri = uri.substring(1, uri.length - 1); ats.push({ uri: uri, range: node.pos }); diff --git a/lib/processors.js b/lib/processors.js deleted file mode 100644 index 1b9e5a9..0000000 --- a/lib/processors.js +++ /dev/null @@ -1,31 +0,0 @@ - -const path = require('path'); -const processorsPath = require.resolve("../processors.json"); -const processors=require(processorsPath); - -exports.names= function() { - return Object.keys(processors); -}; - -exports.namespaces= function(processor) { - const ns = {}; - if (!processors.hasOwnProperty(processor)) return ns; - //console.time("namespaces: "+processor) - const mods = processors[processor].modules; - - mods.forEach(function (uri) { - const mod = require(path.resolve(processorsPath,"../", uri)); - //console.log("procmod: ",uri) - loadpackage(ns, mod); - }); - //console.timeEnd("namespaces: "+processor) - return ns; -} - -// for every namespace key in package create module entry in namespaces -function loadpackage(namespaces, pkg) { - for (const [ns, value] of Object.entries(pkg)) { - // if (namespaces.hasOwnProperty(ns)) console.log("existing: " + ns); - namespaces[ns] = value; - } -}; \ No newline at end of file diff --git a/lib/tree_ops.js b/lib/tree_ops.js index e97f0cb..9d56cb0 100644 --- a/lib/tree_ops.js +++ b/lib/tree_ops.js @@ -81,7 +81,7 @@ exports.TreeOps = { endLineNumber = b.el; endColumn = Math.max(b.ec, a.ec); } else { - endLineNumber = a.el + endLineNumber = a.el; endColumn = a.ec; } diff --git a/lib/xqdoc/parse_comment.js b/lib/xqdoc/parse_comment.js index 7c54dd0..ef2ae61 100644 --- a/lib/xqdoc/parse_comment.js +++ b/lib/xqdoc/parse_comment.js @@ -18,12 +18,12 @@ exports.parseComment = function (comment) { lines.forEach(function (line, index) { line = line.trim(); - if (line[0] === ':') line = line.substring(1).trim(); + if (line[0] === ':') {line = line.substring(1).trim();} if (line.length > 0) { var reTag = new RegExp("^\\s*@(?\\w+)\\s+(?.+)$", "g"); var hits = reTag.exec(line); var hasTag = hits !== null; - if (hasTag) tag = hits.groups.tag; + if (hasTag) {tag = hits.groups.tag;} switch (tag) { case "description": @@ -32,10 +32,11 @@ exports.parseComment = function (comment) { case "param": if (hasTag) { var reParam = new RegExp("^\\s*(?[$]\\w+)\\s+(?.+)$", "g"); - var phit = reParam.exec(hits.groups.rest) - if (phit !== null) ann.params[phit.groups.param] = phit.groups.rest; + var phit = reParam.exec(hits.groups.rest); + if (phit !== null) { + ann.params[phit.groups.param] = phit.groups.rest;} } else { - console.log("TODO", tag, line) + console.log("TODO", tag, line); } break; case "return": @@ -47,16 +48,15 @@ exports.parseComment = function (comment) { break; case "error": if (hasTag) { - ann.errors.push(hits.groups.rest) + ann.errors.push(hits.groups.rest); } else { - console.log('TODO', tag, line) + console.log('TODO', tag, line); } break; default: if (hasTag) { - ann.others.push({ 'tag': tag, 'value': hits.groups.rest }) - } else { - console.log('TODO', tag, line) + ann.others.push({ 'tag': tag, 'value': hits.groups.rest }); + console.log('TODO', tag, line); } } } diff --git a/lib/xqdoc/xqdoc.js b/lib/xqdoc/xqdoc.js index 09e5faf..4cc55ab 100644 --- a/lib/xqdoc/xqdoc.js +++ b/lib/xqdoc/xqdoc.js @@ -15,7 +15,7 @@ exports.XQDoc = function (ast,sctx) { var prefix=null; this.WS = function (node) { if (node.value.trim().substring(0, 3) === '(:~') { - lastComment=parseComment(node.value) + lastComment=parseComment(node.value); lastComment.pos=node.pos; } }; @@ -43,13 +43,13 @@ exports.XQDoc = function (ast,sctx) { var fnname = this.getFirstChild(node, 'EQName'); var value = TreeOps.flatten(fnname); var qname = sctx.resolveQName(value, fnname.pos); - var arity="0" + var arity="0"; var params = this.getFirstChild(node, 'ParamList'); if(params){ for (var i = 0; i < params.children.length; i++) { - if(params.children[i].name==="Param")arity++ + if(params.children[i].name==="Param") {arity++;} } - }; + } var ret = this.getFirstChild(node, 'SequenceType'); const key=qname.uri+"#" + qname.name +"#" +arity; @@ -68,7 +68,7 @@ exports.XQDoc = function (ast,sctx) { //console.log("MODDECL") prefix=TreeOps.flatten(this.getFirstChild(node,"NCName")); if(lastComment){ - comments["module"]=lastComment; + comments.module=lastComment; lastComment=null; } }; @@ -80,18 +80,18 @@ exports.XQDoc = function (ast,sctx) { variables: [], functions: [] }; - if(comments["module"])doc.description=comments["module"].description; + if(comments.module){doc.description=comments.module.description;} Object.keys(sctx.variables).forEach((key) => { var variable = sctx.variables[key]; var varDecl = {... variable.qname}; //name,prefix,uri - varDecl.key = key + varDecl.key = key; varDecl.annotations = variable.annotations; varDecl.type = variable.type; varDecl.occurrence = variable.occurrence; - if(comments[key]?.description) varDecl.description=comments[key]?.description - if(withPos) this.setPos(varDecl,key,variable.pos); + if(comments[key]?.description) {varDecl.description=comments[key]?.description;} + if(withPos) {this.setPos(varDecl,key,variable.pos);} doc.variables.push(varDecl); }); @@ -105,18 +105,18 @@ exports.XQDoc = function (ast,sctx) { //console.log("fn-key:",key) var tokens = key.split('#'); var fnDecl = { - name: tokens[1] - , uri: tokens[0] - , key: key - , params: fn.params - , type: fn.return + name: tokens[1], + uri: tokens[0], + key: key, + params: fn.params, + type: fn.return }; - if(comments[key]?.description) fnDecl.description=comments[key]?.description + if(comments[key]?.description) { fnDecl.description=comments[key]?.description;} //fnDecl.comments={...comments[key]}; // if(!withPos) delete fnDecl.comments.pos; - if(withPos) this.setPos(fnDecl,key,fn.pos); + if(withPos) {this.setPos(fnDecl,key,fn.pos);} doc.functions.push(fnDecl); }); diff --git a/lib/xqlint.js b/lib/xqlint.js index dba4d57..15b6d1c 100644 --- a/lib/xqlint.js +++ b/lib/xqlint.js @@ -40,7 +40,7 @@ exports.CodeFormatter = require('./formatter/formatter').CodeFormatter; exports.XQLint = function (source, opts) { const defaults = { styleCheck: false }; // no default processor! //ACE editor worker hack - opts = { ...defaults, ...opts } + opts = { ...defaults, ...opts }; var ast; var sctx = opts.staticContext ? opts.staticContext : createStaticContext(opts.processor); diff --git a/package-lock.json b/package-lock.json index c6a182e..04e6438 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,15 @@ { "name": "@quodatum/xqlint", - "version": "0.2.4", + "version": "0.2.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@quodatum/xqlint", - "version": "0.2.4", + "version": "0.2.5", "license": "Apache-2.0", "dependencies": { + "@quodatum/xq-catalogs": "^0.0.5", "colors": "1.4.0", "commander": "~11.0.0", "final-fs": "~1.6.1" @@ -32,6 +33,14 @@ "node": ">16.0.0" } }, + "node_modules/@quodatum/xq-catalogs": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@quodatum/xq-catalogs/-/xq-catalogs-0.0.5.tgz", + "integrity": "sha512-SStM4aMFIohUDla1fU39redJRIhnu+QURt0V7IRyqhi08yWbkjwn+9Hc49G1cF7h6DJdW3AqGPs2u3EuhInBLA==", + "engines": { + "node": ">=18.1.1" + } + }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", diff --git a/package.json b/package.json index 1e3aa99..54a35b6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Andy Bunce (https://github.com/apb2006)", "name": "@quodatum/xqlint", "description": "XQuery Quality Checker", - "version": "0.2.5", + "version": "0.2.6", "keywords": [ "xquery", "dev", @@ -22,6 +22,7 @@ "xqlint": "./bin/xqlint" }, "dependencies": { + "@quodatum/xq-catalogs": "^0.0.5", "colors": "1.4.0", "commander": "~11.0.0", "final-fs": "~1.6.1" @@ -47,7 +48,6 @@ ], "scripts": { "test": "grunt", - "wiki-scrape": "basex scripts/wiki-scrape.xq", "rex": "node scripts/rex.js" }, "directories": { diff --git a/packages.src/basex-10.0/admin.xqm b/packages.src/basex-10.0/admin.xqm deleted file mode 100644 index 73663ad..0000000 --- a/packages.src/basex-10.0/admin.xqm +++ /dev/null @@ -1,64 +0,0 @@ -(:~ - : This XQuery Module contains functions for performing admin-centric operations such as managing database users and log data. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Admin_Module - :) -module namespace admin = "http://basex.org/modules/admin"; - -(:~ - : Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
- : - : @return value of type element(file)* - :) -declare function admin:logs() as element(file)* external; - -(:~ - : Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
- : - : @param $date value of type xs:string - : @return value of type element(entry)* - :) -declare function admin:logs($date as xs:string) as element(entry)* external; - -(:~ - : Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
- : - : @param $date value of type xs:string - : @param $merge value of type xs:boolean - : @return value of type element(entry)* - :) -declare function admin:logs($date as xs:string, $merge as xs:boolean) as element(entry)* external; - -(:~ - : Writes a string to the database logs, along with current user data (timestamp, username). An optional log $type can be specified. If omitted, the log type is INFO.
If the function is called from a database client, the IP will be logged. Otherwise, the string SERVER will be logged. - : - : @param $text value of type xs:string - : @error admin:type Type string contains whitespaces. - :) -declare function admin:write-log($text as xs:string) as empty-sequence() external; - -(:~ - : Writes a string to the database logs, along with current user data (timestamp, username). An optional log $type can be specified. If omitted, the log type is INFO.
If the function is called from a database client, the IP will be logged. Otherwise, the string SERVER will be logged. - : - : @param $text value of type xs:string - : @param $type value of type xs:string - : @error admin:type Type string contains whitespaces. - :) -declare function admin:write-log($text as xs:string, $type as xs:string) as empty-sequence() external; - -(:~ - : Deletes the log entries from the specified $date - : - : @param $date value of type xs:string - : @error admin:today Today's log file cannot be deleted. - : @error admin:delete An error occurred while deleting a log file. - :) -declare function admin:delete-logs($date as xs:string) as empty-sequence() external; - -(:~ - : Returns an element sequence with all currently opened database sessions, including the username, address (IP:port) and an optionally opened database.
The output of this function and the SHOW SESSIONS command is similar. - : - : @return value of type element(session)* - :) -declare function admin:sessions() as element(session)* external; diff --git a/packages.src/basex-10.0/archive.xqm b/packages.src/basex-10.0/archive.xqm deleted file mode 100644 index e31f653..0000000 --- a/packages.src/basex-10.0/archive.xqm +++ /dev/null @@ -1,226 +0,0 @@ -(:~ - : This XQuery Module contains functions to handle archives (including ePub, Open Office, JAR, and many other formats). New ZIP and GZIP archives can be created, existing archives can be updated, and the archive entries can be listed and extracted. The archive:extract-binary function includes an example for writing the contents of an archive to disk. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Archive_Module - :) -module namespace archive = "http://basex.org/modules/archive"; - -(:~ - : Returns the entry descriptors of the specified $archive. A descriptor contains the following attributes, provided that they are available in the archive format:
  • size: original file size
  • last-modified: timestamp, formatted as xs:dateTime
  • compressed-size: compressed file size

An example:

  <archive:entry size= "1840" last-modified= "2009-03-20T03:30:32" compressed-size= "672" > doc/index.html </archive:entry> 
- : - : @param $archive value of type xs:base64Binary - : @return value of type element(archive:entry)* - : @error archive:error archive creation failed. - :) -declare function archive:entries($archive as xs:base64Binary) as element(archive:entry)* external; - -(:~ - : Returns the options of the specified $archive in the format specified by archive:create . - : - : @param $archive value of type xs:base64Binary - : @return value of type map(*) - : @error archive:format The archive format is not supported. - : @error archive:error archive creation failed. - :) -declare function archive:options($archive as xs:base64Binary) as map(*) external; - -(:~ - : Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding. - : - : @param $archive value of type xs:base64Binary - : @return value of type xs:string* - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if CHECKSTRINGS is turned off. - : @error archive:error archive creation failed. - :) -declare function archive:extract-text($archive as xs:base64Binary) as xs:string* external; - -(:~ - : Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding. - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @return value of type xs:string* - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if CHECKSTRINGS is turned off. - : @error archive:error archive creation failed. - :) -declare function archive:extract-text($archive as xs:base64Binary, $entries as item()*) as xs:string* external; - -(:~ - : Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding. - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @param $encoding value of type xs:string - : @return value of type xs:string* - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if CHECKSTRINGS is turned off. - : @error archive:error archive creation failed. - :) -declare function archive:extract-text($archive as xs:base64Binary, $entries as item()*, $encoding as xs:string) as xs:string* external; - -(:~ - : Extracts entries of the specified $archive and returns them as binaries.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored). - : - : @param $archive value of type xs:base64Binary - : @return value of type xs:base64Binary* - : @error archive:error archive creation failed. - :) -declare function archive:extract-binary($archive as xs:base64Binary) as xs:base64Binary* external; - -(:~ - : Extracts entries of the specified $archive and returns them as binaries.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored). - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @return value of type xs:base64Binary* - : @error archive:error archive creation failed. - :) -declare function archive:extract-binary($archive as xs:base64Binary, $entries as item()*) as xs:base64Binary* external; - -(:~ - : Creates a new archive from the specified entries and contents.
The $entries argument contains meta information required to create new entries. All items may either be of type xs:string, representing the entry name, or element(archive:entry), containing the name as text node and additional, optional attributes:
  • last-modified: timestamp, specified as xs:dateTime (default: current time)
  • compression-level: 0-9, 0 = uncompressed (default: 8)
  • encoding: for textual entries (default: UTF-8)

An example:

  <archive:entry last-modified= '2011-11-11T11:11:11' compression-level= '8' encoding= 'US-ASCII' >hello.txt</archive:entry> 

The actual $contents must be xs:string or xs:base64Binary items.
The $options parameter contains archiving options:

  • format: allowed values are zip and gzip. zip is the default.
  • algorithm: allowed values are deflate and stored (for the zip format). deflate is the default.
- : - : @param $entries value of type item() - : @param $contents value of type item()* - : @return value of type xs:base64Binary - : @error archive:number the number of entries and contents differs. - : @error archive:format the specified option or its value is invalid or not supported. - : @error archive:descriptor entry descriptors contain invalid entry names, timestamps or compression levels. - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if CHECKSTRINGS is turned off. - : @error archive:single the chosen archive format only allows single entries. - : @error archive:error archive creation failed. - :) -declare function archive:create($entries as item(), $contents as item()*) as xs:base64Binary external; - -(:~ - : Creates a new archive from the specified entries and contents.
The $entries argument contains meta information required to create new entries. All items may either be of type xs:string, representing the entry name, or element(archive:entry), containing the name as text node and additional, optional attributes:
  • last-modified: timestamp, specified as xs:dateTime (default: current time)
  • compression-level: 0-9, 0 = uncompressed (default: 8)
  • encoding: for textual entries (default: UTF-8)

An example:

  <archive:entry last-modified= '2011-11-11T11:11:11' compression-level= '8' encoding= 'US-ASCII' >hello.txt</archive:entry> 

The actual $contents must be xs:string or xs:base64Binary items.
The $options parameter contains archiving options:

  • format: allowed values are zip and gzip. zip is the default.
  • algorithm: allowed values are deflate and stored (for the zip format). deflate is the default.
- : - : @param $entries value of type item() - : @param $contents value of type item()* - : @param $options value of type map(*)? - : @return value of type xs:base64Binary - : @error archive:number the number of entries and contents differs. - : @error archive:format the specified option or its value is invalid or not supported. - : @error archive:descriptor entry descriptors contain invalid entry names, timestamps or compression levels. - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if CHECKSTRINGS is turned off. - : @error archive:single the chosen archive format only allows single entries. - : @error archive:error archive creation failed. - :) -declare function archive:create($entries as item(), $contents as item()*, $options as map(*)?) as xs:base64Binary external; - -(:~ - : Creates an updated version of the specified $archive with new or replaced entries.
The format of $entries and $contents is the same as for archive:create . - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @param $contents value of type item()* - : @return value of type xs:base64Binary - : @error archive:number the number of entries and contents differs. - : @error archive:descriptor entry descriptors contain invalid entry names, timestamps, compression levels or encodings. - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if CHECKSTRINGS is turned off. - : @error archive:modify the entries of the given archive cannot be modified. - : @error archive:error archive creation failed. - :) -declare function archive:update($archive as xs:base64Binary, $entries as item()*, $contents as item()*) as xs:base64Binary external; - -(:~ - : Deletes entries from an $archive.
The format of $entries is the same as for archive:create . - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @return value of type xs:base64Binary - : @error archive:modify the entries of the given archive cannot be modified. - : @error archive:error archive creation failed. - :) -declare function archive:delete($archive as xs:base64Binary, $entries as item()*) as xs:base64Binary external; - -(:~ - : This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is identical to archive:create , but two additional options are available:
  • recursive: parse all files recursively (default: true; ignored if entries are specified via the last argument).
  • root-dir: use name of supplied directory as archive root directory (default: false).
- : - : @param $path value of type xs:string - : @return value of type xs:base64Binary - : @error file:no-dir the specified path does not point to a directory. - : @error file:is-dir one of the specified entries points to a directory. - : @error file:not-found a specified entry does not exist. - : @error archive:error archive creation failed. - :) -declare function archive:create-from($path as xs:string) as xs:base64Binary external; - -(:~ - : This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is identical to archive:create , but two additional options are available:
  • recursive: parse all files recursively (default: true; ignored if entries are specified via the last argument).
  • root-dir: use name of supplied directory as archive root directory (default: false).
- : - : @param $path value of type xs:string - : @param $options value of type map(*)? - : @return value of type xs:base64Binary - : @error file:no-dir the specified path does not point to a directory. - : @error file:is-dir one of the specified entries points to a directory. - : @error file:not-found a specified entry does not exist. - : @error archive:error archive creation failed. - :) -declare function archive:create-from($path as xs:string, $options as map(*)?) as xs:base64Binary external; - -(:~ - : This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is identical to archive:create , but two additional options are available:
  • recursive: parse all files recursively (default: true; ignored if entries are specified via the last argument).
  • root-dir: use name of supplied directory as archive root directory (default: false).
- : - : @param $path value of type xs:string - : @param $options value of type map(*)? - : @param $entries value of type item()* - : @return value of type xs:base64Binary - : @error file:no-dir the specified path does not point to a directory. - : @error file:is-dir one of the specified entries points to a directory. - : @error file:not-found a specified entry does not exist. - : @error archive:error archive creation failed. - :) -declare function archive:create-from($path as xs:string, $options as map(*)?, $entries as item()*) as xs:base64Binary external; - -(:~ - : This convenience function writes files of an $archive directly to the specified directory $path.
The archive entries to be written can be restricted via $entries. The format of the argument is the same as for archive:create (attributes will be ignored). - : - : @param $path value of type xs:string - : @param $archive value of type xs:base64Binary - : @error archive:error archive creation failed. - :) -declare function archive:extract-to($path as xs:string, $archive as xs:base64Binary) as empty-sequence() external; - -(:~ - : This convenience function writes files of an $archive directly to the specified directory $path.
The archive entries to be written can be restricted via $entries. The format of the argument is the same as for archive:create (attributes will be ignored). - : - : @param $path value of type xs:string - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @error archive:error archive creation failed. - :) -declare function archive:extract-to($path as xs:string, $archive as xs:base64Binary, $entries as item()*) as empty-sequence() external; - -(:~ - : This convenience function creates a new archive from the specified $entries and $contents and writes it disk.
See archive:create for more details. - : - : @param $path value of type xs:string - : @param $entries value of type item() - : @param $contents value of type item()* - : @return value of type xs:base64Binary - : @error archive:number the number of entries and contents differs. - : @error archive:format the specified option or its value is invalid or not supported. - : @error archive:descriptor entry descriptors contain invalid entry names, timestamps or compression levels. - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if CHECKSTRINGS is turned off. - : @error archive:single the chosen archive format only allows single entries. - : @error archive:error archive creation failed. - :) -declare function archive:write($path as xs:string, $entries as item(), $contents as item()*) as xs:base64Binary external; - -(:~ - : This convenience function creates a new archive from the specified $entries and $contents and writes it disk.
See archive:create for more details. - : - : @param $path value of type xs:string - : @param $entries value of type item() - : @param $contents value of type item()* - : @param $options value of type map(*)? - : @return value of type xs:base64Binary - : @error archive:number the number of entries and contents differs. - : @error archive:format the specified option or its value is invalid or not supported. - : @error archive:descriptor entry descriptors contain invalid entry names, timestamps or compression levels. - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if CHECKSTRINGS is turned off. - : @error archive:single the chosen archive format only allows single entries. - : @error archive:error archive creation failed. - :) -declare function archive:write($path as xs:string, $entries as item(), $contents as item()*, $options as map(*)?) as xs:base64Binary external; diff --git a/packages.src/basex-10.0/array.xqm b/packages.src/basex-10.0/array.xqm deleted file mode 100644 index 041c49c..0000000 --- a/packages.src/basex-10.0/array.xqm +++ /dev/null @@ -1,208 +0,0 @@ -(:~ - : This XQuery Module contains functions for manipulating arrays, which has been introduced with XQuery 3.1. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Array_Module - :) -module namespace array = "http://www.w3.org/2005/xpath-functions/array"; - -(:~ - : Returns the number of members in $array. Note that because an array is an item, the fn:count function when applied to an array always returns 1. - : - : @param $input value of type array(*) - : @return value of type xs:integer - :) -declare function array:size($input as array(*)) as xs:integer external; - -(:~ - : Returns the $array member at the specified $position. - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @return value of type item()* - : @error array:FOAY0001 $position is not in the range 1 to array:size($array) inclusive. - :) -declare function array:get($array as array(*), $position as xs:integer) as item()* external; - -(:~ - : Returns a copy of $array with a new $member attached. - : - : @param $array value of type array(*) - : @param $member value of type item()* - : @return value of type array(*) - :) -declare function array:append($array as array(*), $member as item()*) as array(*) external; - -(:~ - : Constructs a new array with with $length members of $array beginning from the specified $position.
The two-argument version of the function returns the same result as the three-argument version when called with $length equal to the value of array:size($array) - $position + 1. - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @return value of type array(*) - : @error array:FOAY0001 $position is less than one, or if $position + $length is greater than array:size($array) + 1. - : @error array:FOAY0002 $length is less than zero. - :) -declare function array:subarray($array as array(*), $position as xs:integer) as array(*) external; - -(:~ - : Constructs a new array with with $length members of $array beginning from the specified $position.
The two-argument version of the function returns the same result as the three-argument version when called with $length equal to the value of array:size($array) - $position + 1. - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @param $length value of type xs:integer - : @return value of type array(*) - : @error array:FOAY0001 $position is less than one, or if $position + $length is greater than array:size($array) + 1. - : @error array:FOAY0002 $length is less than zero. - :) -declare function array:subarray($array as array(*), $position as xs:integer, $length as xs:integer) as array(*) external; - -(:~ - : Returns a copy of $array with $member replaced at the specified $position. Equivalent to $array => array:remove($position) => array:insert-before($position, $member). - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @param $member value of type item()* - : @return value of type array(*) - : @error array:FOAY0001 $position is not in the range 1 to array:size($array) inclusive. - :) -declare function array:put($array as array(*), $position as xs:integer, $member as item()*) as array(*) external; - -(:~ - : Returns a copy of $array without the member at the specified $positions. - : - : @param $array value of type array(*) - : @param $positions value of type xs:integer* - : @return value of type array(*) - : @error array:FOAY0001 A position is not in the range 1 to array:size($array) inclusive. - :) -declare function array:remove($array as array(*), $positions as xs:integer*) as array(*) external; - -(:~ - : Returns a copy of $array with one new $member at the specified $position. Setting $position to the value array:size($array) + 1 yields the same result as array:append($array, $insert). - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @param $member value of type item()* - : @return value of type array(*) - : @error array:FOAY0001 $position is not in the range 1 to array:size($array) + 1 inclusive. - :) -declare function array:insert-before($array as array(*), $position as xs:integer, $member as item()*) as array(*) external; - -(:~ - : Returns the first member of $array. This function is equivalent to the expression $array(1). - : - : @param $array value of type array(*) - : @return value of type item()* - : @error array:FOAY0001 The array is empty. - :) -declare function array:head($array as array(*)) as item()* external; - -(:~ - : Returns a new array with all members except the first from $array. This function is equivalent to the expression array:remove($array, 1). - : - : @param $array value of type array(*) - : @return value of type array(*) - : @error array:FOAY0001 The array is empty. - :) -declare function array:tail($array as array(*)) as array(*) external; - -(:~ - : Returns a new array with all members of $array in reverse order. - : - : @param $array value of type array(*) - : @return value of type array(*) - :) -declare function array:reverse($array as array(*)) as array(*) external; - -(:~ - : Concatenates the contents of several $arrays into a single array. - : - : @param $arrays value of type array(*)* - : @return value of type array(*) - :) -declare function array:join($arrays as array(*)*) as array(*) external; - -(:~ - : Recursively flattens all arrays that occur in the supplied $items. - : - : @param $items value of type item()* - : @return value of type item()* - :) -declare function array:flatten($items as item()*) as item()* external; - -(:~ - : Returns a new array, in which each member is computed by applying $function to the corresponding member of $array. - : - : @param $array value of type array(*) - : @param $function value of type function(item()* - : @return value of type array(*) - :) -declare function array:for-each($array as array(*), $function as function(item()*) as item()*) as array(*) external; - -(:~ - : Returns a new array with those members of $array for which $function returns true. - : - : @param $array value of type array(*) - : @param $function value of type function(item()* - : @return value of type array(*) - :) -declare function array:filter($array as array(*), $function as function(item()*) as xs:boolean) as array(*) external; - -(:~ - : Evaluates the supplied $function cumulatively on successive members of the supplied $array from left to right and using $zero as first argument. - : - : @param $array value of type array(*) - : @param $zero value of type item()* - : @param $function value of type function(item()* - : @param item()* value of type - : @return value of type item()* - :) -declare function array:fold-left($array as array(*), $zero as item()*, $function as function(item()*, item()*) as item()*) as item()* external; - -(:~ - : Evaluates the supplied $function cumulatively on successive members of the supplied $array from right to left and using $zero as first argument. - : - : @param $array value of type array(*) - : @param $zero value of type item()* - : @param $function value of type function(item()* - : @param item()* value of type - : @return value of type item()* - :) -declare function array:fold-right($array as array(*), $zero as item()*, $function as function(item()*, item()*) as item()*) as item()* external; - -(:~ - : Returns a new array obtained by evaluating the supplied $function for each pair of members at the same position in $array1 and $array2. - : - : @param $array1 value of type array(*) - : @param $array2 value of type array(*) - : @param $function value of type function(item()* - : @return value of type array(*) - :) -declare function array:for-each-pair($array1 as array(*), $array2 as array(*), $function as function(item()*) as item()*) as array(*) external; - -(:~ - : Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression. - : - : @param $array value of type array(*) - : @return value of type array(*) - :) -declare function array:sort($array as array(*)) as array(*) external; - -(:~ - : Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression. - : - : @param $array value of type array(*) - : @param $collation value of type xs:string? - : @return value of type array(*) - :) -declare function array:sort($array as array(*), $collation as xs:string?) as array(*) external; - -(:~ - : Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression. - : - : @param $array value of type array(*) - : @param $collation value of type xs:string? - : @param $key value of type function(item()* - : @return value of type array(*) - :) -declare function array:sort($array as array(*), $collation as xs:string?, $key as function(item()*) as xs:anyAtomicType*) as array(*) external; diff --git a/packages.src/basex-10.0/bin.xqm b/packages.src/basex-10.0/bin.xqm deleted file mode 100644 index 95e41ef..0000000 --- a/packages.src/basex-10.0/bin.xqm +++ /dev/null @@ -1,419 +0,0 @@ -(:~ - : This XQuery Module contains functions to process binary data, including extracting subparts, searching, basic binary operations and conversion between binary and structured forms. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Binary_Module - :) -module namespace bin = "http://expath.org/ns/binary"; - -(:~ - : Returns the binary form of the set of octets written as a sequence of (ASCII) hex digits ([0-9A-Fa-f]).
$in will be effectively zero-padded from the left to generate an integral number of octets, i.e. an even number of hexadecimal digits. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:string? - : @return value of type xs:base64Binary? - : @error bin:non-numeric-character the input cannot be parsed as a hexadecimal number. - :) -declare function bin:hex($in as xs:string?) as xs:base64Binary? external; - -(:~ - : Returns the binary form of the set of octets written as a sequence of (8-wise) (ASCII) binary digits ([01]).
$in will be effectively zero-padded from the left to generate an integral number of octets. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:string? - : @return value of type xs:base64Binary? - : @error bin:non-numeric-character the input cannot be parsed as a binary number. - :) -declare function bin:bin($in as xs:string?) as xs:base64Binary? external; - -(:~ - : Returns the binary form of the set of octets written as a sequence of (ASCII) octal digits ([0-7]).
$in will be effectively zero-padded from the left to generate an integral number of octets. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:string? - : @return value of type xs:base64Binary? - : @error bin:non-numeric-character the input cannot be parsed as an octal number. - :) -declare function bin:octal($in as xs:string?) as xs:base64Binary? external; - -(:~ - : Returns binary data as a sequence of octets.
If $in is a zero length binary data then the empty sequence is returned. Octets are returned as integers from 0 to 255. - : - : @param $in value of type xs:base64Binary - : @return value of type xs:integer* - :) -declare function bin:to-octets($in as xs:base64Binary) as xs:integer* external; - -(:~ - : Converts a sequence of octets into binary data.
Octets are integers from 0 to 255. If the value of $in is the empty sequence, the function returns zero-sized binary data. - : - : @param $in value of type xs:integer* - : @return value of type xs:base64Binary - : @error bin:octet-out-of-range one of the octets lies outside the range 0 - 255. - :) -declare function bin:from-octets($in as xs:integer*) as xs:base64Binary external; - -(:~ - : Returns the size of binary data in octets. - : - : @param $in value of type xs:base64Binary - : @return value of type xs:integer - :) -declare function bin:length($in as xs:base64Binary) as xs:integer external; - -(:~ - : Returns a section of binary data starting at the $offset octet.
If $size is specified, the size of the returned binary data is $size octets. If $size is absent, all remaining data from $offset is returned. The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $offset value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - :) -declare function bin:part($in as xs:base64Binary?, $offset as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns a section of binary data starting at the $offset octet.
If $size is specified, the size of the returned binary data is $size octets. If $size is absent, all remaining data from $offset is returned. The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - :) -declare function bin:part($in as xs:base64Binary?, $offset as xs:integer, $size as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by concatenating the items in the sequence $in, in order. If the value of $in is the empty sequence, the function returns a binary item containing no data bytes. - : - : @param $in value of type xs:base64Binary* - : @return value of type xs:base64Binary - :) -declare function bin:join($in as xs:base64Binary*) as xs:base64Binary external; - -(:~ - : Returns binary data consisting sequentially of the data from $in up to and including the $offset - 1 octet, followed by all the data from $extra, and then the remaining data from $in.
The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $offset value of type xs:integer - : @param $extra value of type xs:base64Binary? - : @return value of type xs:base64Binary? - : @error bin:index-out-of-range the specified offset is out of range. - :) -declare function bin:insert-before($in as xs:base64Binary?, $offset as xs:integer, $extra as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by padding the input with $size octets in front of the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $size value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:octet-out-of-range the specified octet lies outside the range 0-255. - :) -declare function bin:pad-left($in as xs:base64Binary?, $size as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by padding the input with $size octets in front of the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $size value of type xs:integer - : @param $octet value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:octet-out-of-range the specified octet lies outside the range 0-255. - :) -declare function bin:pad-left($in as xs:base64Binary?, $size as xs:integer, $octet as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by padding the input with $size octets after the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $size value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:octet-out-of-range the specified octet lies outside the range 0-255. - :) -declare function bin:pad-right($in as xs:base64Binary?, $size as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by padding the input with $size octets after the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $size value of type xs:integer - : @param $octet value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:octet-out-of-range the specified octet lies outside the range 0-255. - :) -declare function bin:pad-right($in as xs:base64Binary?, $size as xs:integer, $octet as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns the first location of the binary search sequence in the input, or if not found, the empty sequence.
The $offset and the returned location are zero based. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $offset value of type xs:integer - : @param $search value of type xs:base64Binary - : @return value of type xs:integer? - : @error bin:index-out-of-range the specified offset + size is out of range. - :) -declare function bin:find($in as xs:base64Binary?, $offset as xs:integer, $search as xs:base64Binary) as xs:integer? external; - -(:~ - : Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $encoding value of type xs:string - : @return value of type xs:string? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-encoding the specified encoding is unknown. - : @error bin:conversion-error an error or malformed input occurred during decoding the string. - :) -declare function bin:decode-string($in as xs:base64Binary?, $encoding as xs:string) as xs:string? external; - -(:~ - : Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $encoding value of type xs:string - : @param $offset value of type xs:integer - : @return value of type xs:string? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-encoding the specified encoding is unknown. - : @error bin:conversion-error an error or malformed input occurred during decoding the string. - :) -declare function bin:decode-string($in as xs:base64Binary?, $encoding as xs:string, $offset as xs:integer) as xs:string? external; - -(:~ - : Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $encoding value of type xs:string - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:string? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-encoding the specified encoding is unknown. - : @error bin:conversion-error an error or malformed input occurred during decoding the string. - :) -declare function bin:decode-string($in as xs:base64Binary?, $encoding as xs:string, $offset as xs:integer, $size as xs:integer) as xs:string? external; - -(:~ - : Encodes a string into binary data using a given $encoding.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:string? - : @param $encoding value of type xs:string - : @return value of type xs:base64Binary? - : @error bin:unknown-encoding the specified encoding is unknown. - : @error bin:conversion-error an error or malformed input occurred during encoding the string. - :) -declare function bin:encode-string($in as xs:string?, $encoding as xs:string) as xs:base64Binary? external; - -(:~ - : Returns the 8-octet binary representation of a double value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. - : - : @param $in value of type xs:double - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:pack-double($in as xs:double) as xs:base64Binary external; - -(:~ - : Returns the 8-octet binary representation of a double value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. - : - : @param $in value of type xs:double - : @param $octet-order value of type xs:string - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:pack-double($in as xs:double, $octet-order as xs:string) as xs:base64Binary external; - -(:~ - : Returns the 4-octet binary representation of a float value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. - : - : @param $in value of type xs:float - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:pack-float($in as xs:float) as xs:base64Binary external; - -(:~ - : Returns the 4-octet binary representation of a float value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. - : - : @param $in value of type xs:float - : @param $octet-order value of type xs:string - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:pack-float($in as xs:float, $octet-order as xs:string) as xs:base64Binary external; - -(:~ - : Returns the twos-complement binary representation of an integer value treated as $size octets long. Any 'excess' high-order bits are discarded.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. Specifying a $size of zero yields an empty binary data. - : - : @param $in value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - : @error bin:negative-size the specified size is negative. - :) -declare function bin:pack-integer($in as xs:integer, $size as xs:integer) as xs:base64Binary external; - -(:~ - : Returns the twos-complement binary representation of an integer value treated as $size octets long. Any 'excess' high-order bits are discarded.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. Specifying a $size of zero yields an empty binary data. - : - : @param $in value of type xs:integer - : @param $size value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - : @error bin:negative-size the specified size is negative. - :) -declare function bin:pack-integer($in as xs:integer, $size as xs:integer, $octet-order as xs:string) as xs:base64Binary external; - -(:~ - : Extracts the double value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @return value of type xs:double - : @error bin:index-out-of-range the specified offset is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-double($in as xs:base64Binary, $offset as xs:integer) as xs:double external; - -(:~ - : Extracts the double value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:double - : @error bin:index-out-of-range the specified offset is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-double($in as xs:base64Binary, $offset as xs:integer, $octet-order as xs:string) as xs:double external; - -(:~ - : Extracts the float value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @return value of type xs:float - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-float($in as xs:base64Binary, $offset as xs:integer) as xs:float external; - -(:~ - : Extracts the float value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:float - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-float($in as xs:base64Binary, $offset as xs:integer, $octet-order as xs:string) as xs:float external; - -(:~ - : Returns a signed integer value represented by the $size octets starting from $offset in the input binary representation. Necessary sign extension is performed (i.e. the result is negative if the high order bit is '1').
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:integer - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-integer($in as xs:base64Binary, $offset as xs:integer, $size as xs:integer) as xs:integer external; - -(:~ - : Returns a signed integer value represented by the $size octets starting from $offset in the input binary representation. Necessary sign extension is performed (i.e. the result is negative if the high order bit is '1').
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:integer - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-integer($in as xs:base64Binary, $offset as xs:integer, $size as xs:integer, $octet-order as xs:string) as xs:integer external; - -(:~ - : Returns an unsigned integer value represented by the $size octets starting from $offset in the input binary representation.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:integer - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-unsigned-integer($in as xs:base64Binary, $offset as xs:integer, $size as xs:integer) as xs:integer external; - -(:~ - : Returns an unsigned integer value represented by the $size octets starting from $offset in the input binary representation.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:integer - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-unsigned-integer($in as xs:base64Binary, $offset as xs:integer, $size as xs:integer, $octet-order as xs:string) as xs:integer external; - -(:~ - : Returns the "bitwise or" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned. - : - : @param $a value of type xs:base64Binary? - : @param $b value of type xs:base64Binary? - : @return value of type xs:base64Binary? - : @error bin:differing-length-arguments the input arguments are of differing length. - :) -declare function bin:or($a as xs:base64Binary?, $b as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Returns the "bitwise xor" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned. - : - : @param $a value of type xs:base64Binary? - : @param $b value of type xs:base64Binary? - : @return value of type xs:base64Binary? - : @error bin:differing-length-arguments the input arguments are of differing length. - :) -declare function bin:xor($a as xs:base64Binary?, $b as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Returns the "bitwise and" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned. - : - : @param $a value of type xs:base64Binary? - : @param $b value of type xs:base64Binary? - : @return value of type xs:base64Binary? - : @error bin:differing-length-arguments the input arguments are of differing length. - :) -declare function bin:and($a as xs:base64Binary?, $b as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Returns the "bitwise not" of a binary argument.
If the argument is the empty sequence, an empty sequence is returned. - : - : @param $in value of type xs:base64Binary? - : @return value of type xs:base64Binary? - :) -declare function bin:not($in as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Shifts bits in binary data.
If $by is zero, the result is identical to $in. If $by is positive then bits are shifted to the left. Otherwise, bits are shifted to the right. If the absolute value of $by is greater than the bit-length of $in then an all-zeros result is returned. The result always has the same size as $in. The shifting is logical: zeros are placed into discarded bits. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $by value of type xs:integer - : @return value of type xs:base64Binary? - :) -declare function bin:shift($in as xs:base64Binary?, $by as xs:integer) as xs:base64Binary? external; diff --git a/packages.src/basex-10.0/client.xqm b/packages.src/basex-10.0/client.xqm deleted file mode 100644 index 93b6ef9..0000000 --- a/packages.src/basex-10.0/client.xqm +++ /dev/null @@ -1,71 +0,0 @@ -(:~ - : This XQuery Module contains functions to access BaseX server instances from XQuery. With this module, you can execute database commands and evaluate XQuery expressions. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Client_Module - :) -module namespace client = "http://basex.org/modules/client"; - -(:~ - : This function establishes a connection to a remote BaseX server, creates a new client session, and returns a session id. The parameter $host is the name of the database server, $port specifies the server port, and $username and $password represent the login data. - : - : @param $host value of type xs:string - : @param $port value of type xs:integer - : @param $username value of type xs:string - : @param $password value of type xs:string - : @return value of type xs:anyURI - : @error client:connect an error occurs while creating the session (possible reasons: server not available, access denied). - :) -declare function client:connect($host as xs:string, $port as xs:integer, $username as xs:string, $password as xs:string) as xs:anyURI external; - -(:~ - : This function executes a command and returns the result as a string. The parameter $id contains the session ID returned by client:connect . The $command argument represents a single command, which will be executed by the server. - : - : @param $id value of type xs:anyURI - : @param $command value of type xs:string - : @return value of type xs:string - : @error client:error an I/O error occurs while transferring data from or to the server. - : @error client:command an error occurs while executing a command. - :) -declare function client:execute($id as xs:anyURI, $command as xs:string) as xs:string external; - -(:~ - : This function returns an information string, created by the last call of client:execute . $id specifies the session id. - : - : @param $id value of type xs:anyURI - : @return value of type xs:string - :) -declare function client:info($id as xs:anyURI) as xs:string external; - -(:~ - : Evaluates a query and returns the result as sequence. The parameter $id contains the session id returned by client:connect , and $query represents the query string, which will be evaluated by the server.
Variables and the context item can be declared via $bindings. The specified keys must be QNames or strings:
  • If a key is a QName, it will be directly adopted as variable name.
  • If a key is a string, it may be prefixed with a dollar sign. A namespace can be specified using the Clark Notation. If the specified string is empty, the value will be bound to the context item.
- : - : @param $id value of type xs:anyURI - : @param $query value of type xs:string - : @return value of type item()* - : @error client:error an I/O error occurs while transferring data from or to the server. - : @error client:query an error occurs while evaluating a query, and if the original error cannot be extracted from the returned error string. - : @error client:function function items (including maps and arrays) cannot be returned. - :) -declare function client:query($id as xs:anyURI, $query as xs:string) as item()* external; - -(:~ - : Evaluates a query and returns the result as sequence. The parameter $id contains the session id returned by client:connect , and $query represents the query string, which will be evaluated by the server.
Variables and the context item can be declared via $bindings. The specified keys must be QNames or strings:
  • If a key is a QName, it will be directly adopted as variable name.
  • If a key is a string, it may be prefixed with a dollar sign. A namespace can be specified using the Clark Notation. If the specified string is empty, the value will be bound to the context item.
- : - : @param $id value of type xs:anyURI - : @param $query value of type xs:string - : @param $bindings value of type map(*)? - : @return value of type item()* - : @error client:error an I/O error occurs while transferring data from or to the server. - : @error client:query an error occurs while evaluating a query, and if the original error cannot be extracted from the returned error string. - : @error client:function function items (including maps and arrays) cannot be returned. - :) -declare function client:query($id as xs:anyURI, $query as xs:string, $bindings as map(*)?) as item()* external; - -(:~ - : This function closes a client session. $id specifies the session id.
Opened connections will automatically be closed after the XQuery expression has been evaluated, but it is recommendable to explicitly close them with this function if you open many connections. - : - : @param $id value of type xs:anyURI - : @error client:error an I/O error occurs while transferring data from or to the server. - :) -declare function client:close($id as xs:anyURI) as empty-sequence() external; diff --git a/packages.src/basex-10.0/convert.xqm b/packages.src/basex-10.0/convert.xqm deleted file mode 100644 index c788002..0000000 --- a/packages.src/basex-10.0/convert.xqm +++ /dev/null @@ -1,203 +0,0 @@ -(:~ - : This XQuery Module contains functions to convert data between different formats. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Conversion_Module - :) -module namespace convert = "http://basex.org/modules/convert"; - -(:~ - : Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $bytes value of type xs:anyAtomicType - : @return value of type xs:string - : @error convert:string The input is an invalid XML string, or the wrong encoding has been specified. - : @error convert:BXCO0002 The specified encoding is invalid or not supported. - :) -declare function convert:binary-to-string($bytes as xs:anyAtomicType) as xs:string external; - -(:~ - : Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $bytes value of type xs:anyAtomicType - : @param $encoding value of type xs:string - : @return value of type xs:string - : @error convert:string The input is an invalid XML string, or the wrong encoding has been specified. - : @error convert:BXCO0002 The specified encoding is invalid or not supported. - :) -declare function convert:binary-to-string($bytes as xs:anyAtomicType, $encoding as xs:string) as xs:string external; - -(:~ - : Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $bytes value of type xs:anyAtomicType - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @return value of type xs:string - : @error convert:string The input is an invalid XML string, or the wrong encoding has been specified. - : @error convert:BXCO0002 The specified encoding is invalid or not supported. - :) -declare function convert:binary-to-string($bytes as xs:anyAtomicType, $encoding as xs:string, $fallback as xs:boolean) as xs:string external; - -(:~ - : Converts the specified $string to an xs:base64Binary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument. - : - : @param $string value of type xs:string - : @return value of type xs:base64Binary - : @error convert:binary The input cannot be represented in the specified encoding. - : @error convert:encoding The specified encoding is invalid or not supported. - :) -declare function convert:string-to-base64($string as xs:string) as xs:base64Binary external; - -(:~ - : Converts the specified $string to an xs:base64Binary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument. - : - : @param $string value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:base64Binary - : @error convert:binary The input cannot be represented in the specified encoding. - : @error convert:encoding The specified encoding is invalid or not supported. - :) -declare function convert:string-to-base64($string as xs:string, $encoding as xs:string) as xs:base64Binary external; - -(:~ - : Converts the specified $string to an xs:hexBinary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument. - : - : @param $string value of type xs:string - : @return value of type xs:hexBinary - : @error convert:binary The input cannot be represented in the specified encoding. - : @error convert:encoding The specified encoding is invalid or not supported. - :) -declare function convert:string-to-hex($string as xs:string) as xs:hexBinary external; - -(:~ - : Converts the specified $string to an xs:hexBinary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument. - : - : @param $string value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:hexBinary - : @error convert:binary The input cannot be represented in the specified encoding. - : @error convert:encoding The specified encoding is invalid or not supported. - :) -declare function convert:string-to-hex($string as xs:string, $encoding as xs:string) as xs:hexBinary external; - -(:~ - : Converts the specified $integers to an item of type xs:base64Binary:
  • Only the first 8 bits of the supplied integers will be considered.
  • Conversion of byte sequences is very efficient, as items of binary type are internally represented as byte arrays.
- : - : @param $integers value of type xs:integer* - : @return value of type xs:base64Binary - :) -declare function convert:integers-to-base64($integers as xs:integer*) as xs:base64Binary external; - -(:~ - : Converts the specified $integers to an item of type xs:hexBinary:
  • Only the first 8 bits of the supplied integers will be considered.
  • Conversion of byte sequences is very efficient, as items of binary type are internally represented as byte arrays.
- : - : @param $integers value of type xs:integer* - : @return value of type xs:hexBinary - :) -declare function convert:integers-to-hex($integers as xs:integer*) as xs:hexBinary external; - -(:~ - : Returns the specified $binary (xs:base64Binary, xs:hexBinary) as a sequence of unsigned integers (octets). - : - : @param $binary value of type xs:anyAtomicType - : @return value of type xs:integer* - :) -declare function convert:binary-to-integers($binary as xs:anyAtomicType) as xs:integer* external; - -(:~ - : Returns the specified $binary (xs:base64Binary, xs:hexBinary) as a sequence of bytes. The conversion is very cheap and takes no additional memory, as items of binary type are internally represented as byte arrays. - : - : @param $binary value of type xs:anyAtomicType - : @return value of type xs:byte* - :) -declare function convert:binary-to-bytes($binary as xs:anyAtomicType) as xs:byte* external; - -(:~ - : Converts $number to a string, using the specified $base, interpreting it as a 64-bit unsigned integer.
The first base elements of the sequence '0',..,'9','a',..,'z' are used as digits.
Valid bases are 2, .., 36.
- : - : @param $number value of type xs:integer - : @param $base value of type xs:integer - : @return value of type xs:string - : @error convert:base The specified base is not in the range 2-36. - :) -declare function convert:integer-to-base($number as xs:integer, $base as xs:integer) as xs:string external; - -(:~ - : Decodes an integer from $string, using the specified $base.
The first base elements of the sequence '0',..,'9','a',..,'z' are allowed as digits; case does not matter.
Valid bases are 2 - 36.
If the supplied string contains more than 64 bits of information, the result will be truncated. - : - : @param $string value of type xs:string - : @param $base value of type xs:integer - : @return value of type xs:integer - : @error convert:base The specified base is not in the range 2-36. - : @error convert:integer The specified digit is not valid for the given range. - :) -declare function convert:integer-from-base($string as xs:string, $base as xs:integer) as xs:integer external; - -(:~ - : Converts the specified number of $milliseconds since 1 Jan 1970 to an item of type xs:dateTime.
- : - : @param $milliseconds value of type xs:integer - : @return value of type xs:dateTime - :) -declare function convert:integer-to-dateTime($milliseconds as xs:integer) as xs:dateTime external; - -(:~ - : Converts the specified $dateTime item to the number of milliseconds since 1 Jan 1970.
- : - : @param $dateTime value of type xs:dateTime - : @return value of type xs:integer - :) -declare function convert:dateTime-to-integer($dateTime as xs:dateTime) as xs:integer external; - -(:~ - : Converts the specified number of $milliseconds to an item of type xs:dayTimeDuration.
- : - : @param $milliseconds value of type xs:integer - : @return value of type xs:dayTimeDuration - :) -declare function convert:integer-to-dayTime($milliseconds as xs:integer) as xs:dayTimeDuration external; - -(:~ - : Converts the specified $dayTime duration to milliseconds represented by an integer.
- : - : @param $dayTime value of type xs:dayTimeDuration - : @return value of type xs:integer - :) -declare function convert:dayTime-to-integer($dayTime as xs:dayTimeDuration) as xs:integer external; - -(:~ - : Encodes the specified $key (with the optional $lax conversion method) to a valid NCName representation, which can be used to create an element node:
  • An empty string is converted to a single underscore (_).
  • Existing underscores are rewritten to two underscores (__).
  • Characters that are no valid NCName characters are rewritten to an underscore and the character’s four-digit Unicode. For example, the exclamation mark ? is transformed to _003f.
  • If lax conversion is chosen, invalid characters are replaced with underscores or (when invalid as first character of an element name) prefixed with an underscore. The resulting string may be better readable, but it cannot necessarily be converted back to the original form.

This encoding is employed by the direct conversion format in the JSON Module and the CSV Module.

- : - : @param $key value of type xs:string - : @return value of type xs:string - :) -declare function convert:encode-key($key as xs:string) as xs:string external; - -(:~ - : Encodes the specified $key (with the optional $lax conversion method) to a valid NCName representation, which can be used to create an element node:
  • An empty string is converted to a single underscore (_).
  • Existing underscores are rewritten to two underscores (__).
  • Characters that are no valid NCName characters are rewritten to an underscore and the character’s four-digit Unicode. For example, the exclamation mark ? is transformed to _003f.
  • If lax conversion is chosen, invalid characters are replaced with underscores or (when invalid as first character of an element name) prefixed with an underscore. The resulting string may be better readable, but it cannot necessarily be converted back to the original form.

This encoding is employed by the direct conversion format in the JSON Module and the CSV Module.

- : - : @param $key value of type xs:string - : @param $lax value of type xs:boolean - : @return value of type xs:string - :) -declare function convert:encode-key($key as xs:string, $lax as xs:boolean) as xs:string external; - -(:~ - : Decodes the specified $key (with the optional $lax conversion method) to the original string representation.
Keys supplied to this function are usually element names from documents that have been created with the JSON Module or CSV Module. - : - : @param $key value of type xs:string - : @return value of type xs:string - : @error convert:key The specified key cannot be decoded to its original representation. - :) -declare function convert:decode-key($key as xs:string) as xs:string external; - -(:~ - : Decodes the specified $key (with the optional $lax conversion method) to the original string representation.
Keys supplied to this function are usually element names from documents that have been created with the JSON Module or CSV Module. - : - : @param $key value of type xs:string - : @param $lax value of type xs:boolean - : @return value of type xs:string - : @error convert:key The specified key cannot be decoded to its original representation. - :) -declare function convert:decode-key($key as xs:string, $lax as xs:boolean) as xs:string external; diff --git a/packages.src/basex-10.0/crypto.xqm b/packages.src/basex-10.0/crypto.xqm deleted file mode 100644 index 35f0182..0000000 --- a/packages.src/basex-10.0/crypto.xqm +++ /dev/null @@ -1,161 +0,0 @@ -(:~ - : This XQuery Module contains functions to perform cryptographic operations in XQuery. The cryptographic module is based on an early draft of the EXPath Cryptographic Module and provides the following functionality: creation of message authentication codes (HMAC), encryption and decryption, and creation and validation of XML Digital Signatures. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Cryptographic_Module - :) -module namespace crypto = "http://expath.org/ns/crypto"; -declare namespace experr = "http://expath.org/ns/error"; - -(:~ - : Creates an authentication code for the specified $data via a cryptographic hash function:
  • $key must not be empty.
  • $algorithm describes the hash algorithm which is used for encryption. Currently supported are md5, sha1, sha256, sha384, sha512. Default is md5.
  • $encoding must either be hex or base64; it specifies the encoding of the returned authentication code. Default is base64.
- : - : @param $data value of type xs:anyAtomicType - : @param $key value of type xs:anyAtomicType - : @param $algorithm value of type xs:string - : @return value of type xs:string - : @error experr:CX0013 the specified hashing algorithm is not supported. - : @error experr:CX0014 the specified encoding method is not supported. - : @error experr:CX0019 the specified secret key is invalid. - :) -declare function crypto:hmac($data as xs:anyAtomicType, $key as xs:anyAtomicType, $algorithm as xs:string) as xs:string external; - -(:~ - : Creates an authentication code for the specified $data via a cryptographic hash function:
  • $key must not be empty.
  • $algorithm describes the hash algorithm which is used for encryption. Currently supported are md5, sha1, sha256, sha384, sha512. Default is md5.
  • $encoding must either be hex or base64; it specifies the encoding of the returned authentication code. Default is base64.
- : - : @param $data value of type xs:anyAtomicType - : @param $key value of type xs:anyAtomicType - : @param $algorithm value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:string - : @error experr:CX0013 the specified hashing algorithm is not supported. - : @error experr:CX0014 the specified encoding method is not supported. - : @error experr:CX0019 the specified secret key is invalid. - :) -declare function crypto:hmac($data as xs:anyAtomicType, $key as xs:anyAtomicType, $algorithm as xs:string, $encoding as xs:string) as xs:string external; - -(:~ - : Encrypts data with the specified key:
  • $data must be a string or binary item.
  • $type must be symmetric.
  • $key is the secret key which is used for both encryption and decryption of input data. It must be a string or binary item. Its length is fixed and depends on the chosen algorithm: 8 bytes for DES, 16 bytes for AES.
  • $algorithm must either be DES or AES. Default is DES.
- : - : @param $data value of type xs:anyAtomicType - : @param $type value of type xs:string - : @param $key value of type xs:anyAtomicType - : @param $algorithm value of type xs:string - : @return value of type xs:base64Binary - : @error experr:CX0016 padding problems arise. - : @error experr:CX0017 padding is incorrect. - : @error experr:CX0018 the encryption type is not supported. - : @error experr:CX0019 the secret key is invalid. - : @error experr:CX0020 the block size is incorrect. - : @error experr:CX0021 the specified encryption algorithm is not supported. - :) -declare function crypto:encrypt($data as xs:anyAtomicType, $type as xs:string, $key as xs:anyAtomicType, $algorithm as xs:string) as xs:base64Binary external; - -(:~ - : Encrypts data with the specified key:
  • $data must be a string or binary item.
  • $type must be symmetric.
  • $key is the secret key which is used for both encryption and decryption of input data. It must be a string or binary item. Its length is fixed and depends on the chosen algorithm: 8 bytes for DES, 16 bytes for AES.
  • $algorithm must either be DES or AES. Default is DES.
- : - : @param $data value of type xs:anyAtomicType - : @param $type value of type xs:string - : @param $key value of type xs:anyAtomicType - : @param $algorithm value of type xs:string - : @return value of type xs:string - : @error experr:CX0016 padding problems arise. - : @error experr:CX0017 padding is incorrect. - : @error experr:CX0018 the encryption type is not supported. - : @error experr:CX0019 the secret key is invalid. - : @error experr:CX0020 the block size is incorrect. - : @error experr:CX0021 the specified encryption algorithm is not supported. - :) -declare function crypto:decrypt($data as xs:anyAtomicType, $type as xs:string, $key as xs:anyAtomicType, $algorithm as xs:string) as xs:string external; - -(:~ - : $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

- : - : @param $input value of type node() - : @param $canonicalization value of type xs:string - : @param $digest value of type xs:string - : @param $signature value of type xs:string - : @param $prefix value of type xs:string - : @param $type value of type xs:string - : @return value of type node() - : @error experr:CX0001 the canonicalization algorithm is not supported. - : @error experr:CX0002 the digest algorithm is not supported. - : @error experr:CX0003 the signature algorithm is not supported. - : @error experr:CX0004 the $xpath-expression is invalid. - : @error experr:CX0005 the root name of $digital-certificate is not 'digital-certificate. - : @error experr:CX0007 the key store is null. - : @error experr:CX0012 the key cannot be found in the specified key store. - : @error experr:CX0023 the certificate alias is invalid. - : @error experr:CX0024 an invalid algorithm is specified. - : @error experr:CX0025 an exception occurs while the signing the document. - : @error experr:CX0026 an exception occurs during key store initialization. - : @error experr:CX0027 an IO exception occurs. - : @error experr:CX0028 the signature type is not supported. - :) -declare function crypto:generate-signature($input as node(), $canonicalization as xs:string, $digest as xs:string, $signature as xs:string, $prefix as xs:string, $type as xs:string) as node() external; - -(:~ - : $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

- : - : @param $input value of type node() - : @param $canonicalization value of type xs:string - : @param $digest value of type xs:string - : @param $signature value of type xs:string - : @param $prefix value of type xs:string - : @param $type value of type xs:string - : @param $xpath value of type xs:string - : @param $certificate value of type node() - : @return value of type node() - : @error experr:CX0001 the canonicalization algorithm is not supported. - : @error experr:CX0002 the digest algorithm is not supported. - : @error experr:CX0003 the signature algorithm is not supported. - : @error experr:CX0004 the $xpath-expression is invalid. - : @error experr:CX0005 the root name of $digital-certificate is not 'digital-certificate. - : @error experr:CX0007 the key store is null. - : @error experr:CX0012 the key cannot be found in the specified key store. - : @error experr:CX0023 the certificate alias is invalid. - : @error experr:CX0024 an invalid algorithm is specified. - : @error experr:CX0025 an exception occurs while the signing the document. - : @error experr:CX0026 an exception occurs during key store initialization. - : @error experr:CX0027 an IO exception occurs. - : @error experr:CX0028 the signature type is not supported. - :) -declare function crypto:generate-signature($input as node(), $canonicalization as xs:string, $digest as xs:string, $signature as xs:string, $prefix as xs:string, $type as xs:string, $xpath as xs:string, $certificate as node()) as node() external; - -(:~ - : $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

- : - : @param $input value of type node() - : @param $canonicalization value of type xs:string - : @param $digest value of type xs:string - : @param $signature value of type xs:string - : @param $prefix value of type xs:string - : @param $type value of type xs:string - : @param $ext value of type item() - : @return value of type node() - : @error experr:CX0001 the canonicalization algorithm is not supported. - : @error experr:CX0002 the digest algorithm is not supported. - : @error experr:CX0003 the signature algorithm is not supported. - : @error experr:CX0004 the $xpath-expression is invalid. - : @error experr:CX0005 the root name of $digital-certificate is not 'digital-certificate. - : @error experr:CX0007 the key store is null. - : @error experr:CX0012 the key cannot be found in the specified key store. - : @error experr:CX0023 the certificate alias is invalid. - : @error experr:CX0024 an invalid algorithm is specified. - : @error experr:CX0025 an exception occurs while the signing the document. - : @error experr:CX0026 an exception occurs during key store initialization. - : @error experr:CX0027 an IO exception occurs. - : @error experr:CX0028 the signature type is not supported. - :) -declare function crypto:generate-signature($input as node(), $canonicalization as xs:string, $digest as xs:string, $signature as xs:string, $prefix as xs:string, $type as xs:string, $ext as item()) as node() external; - -(:~ - : Checks if the given node contains a Signature element and whether the signature is valid. In this case true is returned. If the signature is invalid the function returns false. - : - : @param $input-doc value of type node() - : @return value of type xs:boolean - : @error experr:CX0015 the signature element cannot be found. - : @error experr:CX9994 an unspecified problem occurs during validation. - : @error experr:CX9996 an IO exception occurs during validation. - :) -declare function crypto:validate-signature($input-doc as node()) as xs:boolean external; diff --git a/packages.src/basex-10.0/csv.xqm b/packages.src/basex-10.0/csv.xqm deleted file mode 100644 index 94e37c2..0000000 --- a/packages.src/basex-10.0/csv.xqm +++ /dev/null @@ -1,66 +0,0 @@ -(:~ - : This XQuery Module contains a single function to parse CSV input. CSV (comma-separated values) is a popular representation for tabular data, exported e. g. from Excel. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/CSV_Module - :) -module namespace csv = "http://basex.org/modules/csv"; - -(:~ - : Fetches the CSV document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted. - : - : @param $uri value of type xs:string? - : @return value of type item()? - : @error csv:parse the specified input cannot be parsed as CSV document. - : @error csv:options the specified options are conflicting. - :) -declare function csv:doc($uri as xs:string?) as item()? external; - -(:~ - : Fetches the CSV document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted. - : - : @param $uri value of type xs:string? - : @param $options value of type map(*)? - : @return value of type item()? - : @error csv:parse the specified input cannot be parsed as CSV document. - : @error csv:options the specified options are conflicting. - :) -declare function csv:doc($uri as xs:string?, $options as map(*)?) as item()? external; - -(:~ - : Converts the CSV $string to an XQuery value. The $options argument can be used to control the way the input is converted. - : - : @param $string value of type xs:string? - : @return value of type item()? - : @error csv:parse the specified input cannot be parsed as CSV document. - :) -declare function csv:parse($string as xs:string?) as item()? external; - -(:~ - : Converts the CSV $string to an XQuery value. The $options argument can be used to control the way the input is converted. - : - : @param $string value of type xs:string? - : @param $options value of type map(*)? - : @return value of type item()? - : @error csv:parse the specified input cannot be parsed as CSV document. - :) -declare function csv:parse($string as xs:string?, $options as map(*)?) as item()? external; - -(:~ - : Serializes the specified $input as CSV, using the specified $options, and returns the result as string.

Values can also be serialized as CSV with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to csv, and
  • the options presented in this article need to be assigned to the csv parameter.
- : - : @param $input value of type item()? - : @return value of type xs:string - : @error csv:serialize the input cannot be serialized. - :) -declare function csv:serialize($input as item()?) as xs:string external; - -(:~ - : Serializes the specified $input as CSV, using the specified $options, and returns the result as string.

Values can also be serialized as CSV with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to csv, and
  • the options presented in this article need to be assigned to the csv parameter.
- : - : @param $input value of type item()? - : @param $options value of type map(*)? - : @return value of type xs:string - : @error csv:serialize the input cannot be serialized. - :) -declare function csv:serialize($input as item()?, $options as map(*)?) as xs:string external; diff --git a/packages.src/basex-10.0/db.xqm b/packages.src/basex-10.0/db.xqm deleted file mode 100644 index c36034b..0000000 --- a/packages.src/basex-10.0/db.xqm +++ /dev/null @@ -1,639 +0,0 @@ -(:~ - : This XQuery Module contains functions for processing databases from within XQuery. Existing databases can be opened and listed, its contents can be directly accessed, documents can be added to and removed, etc. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Database_Module - :) -module namespace db = "http://basex.org/modules/db"; - -(:~ - : Returns general information on the database system the current values of all global and local Options. The INFO command returns similar output. - : - : @return value of type element(system) - :) -declare function db:system() as element(system) external; - -(:~ - : Returns the current value (string, integer, boolean, map) of a global or local Option with the specified $name. The SHOW OPTIONS command returns similar output. - : - : @param $name value of type xs:string - : @return value of type xs:string - : @error db:option the specified option is unknown. - :) -declare function db:option($name as xs:string) as xs:string external; - -(:~ - : Returns meta information on the database $db. The output is similar to the INFO DB command. - : - : @param $db value of type xs:string - : @return value of type element(database) - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:info($db as xs:string) as element(database) external; - -(:~ - : Returns the value (string, boolean, integer) of a property with the specified $name in the database $db. The available properties are the ones returned by db:info . - : - : @param $db value of type xs:string - : @param $name value of type xs:string - : @return value of type xs:anyAtomicType - : @error db:property the specified property is unknown. - :) -declare function db:property($db as xs:string, $name as xs:string) as xs:anyAtomicType external; - -(:~ - : The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
- : - : @return value of type xs:string* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list() as xs:string* external; - -(:~ - : The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
- : - : @param $db value of type xs:string - : @return value of type xs:string* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list($db as xs:string) as xs:string* external; - -(:~ - : The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:string* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list($db as xs:string, $path as xs:string) as xs:string* external; - -(:~ - : Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
- : - : @return value of type element(database)* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list-details() as element(database)* external; - -(:~ - : Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
- : - : @param $db value of type xs:string - : @return value of type element(resource)* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list-details($db as xs:string) as element(resource)* external; - -(:~ - : Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type element(resource)* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list-details($db as xs:string, $path as xs:string) as element(resource)* external; - -(:~ - : Returns metadata on all directories and resources of the database $db in the specified directory $path. Two types of elements are returned:
  • resource represents a resource. The element value is the directory path; content type, modification date, raw flag (which indicates if the resource is binary or XML), and size of the resource are returned as attributes.
  • dir represents a directory. The element value is the directory path; the modification date is returned as attribute.

Please note that directories are not stored in BaseX. Instead, they result implicitly from the paths of stored resources.

- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type element()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:path the specified path is invalid. - :) -declare function db:dir($db as xs:string, $path as xs:string) as element()* external; - -(:~ - : Returns all documents from the database $db, or only documents matching the specified $path. - : - : @param $db value of type xs:string - : @return value of type document-node()* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:get($db as xs:string) as document-node()* external; - -(:~ - : Returns all documents from the database $db, or only documents matching the specified $path. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type document-node()* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:get($db as xs:string, $path as xs:string) as document-node()* external; - -(:~ - : Returns all nodes from the database $db with the pre values $pres in distinct document order.
The PRE value provides very fast access to an existing database node, but it will change whenever a node with a smaller pre values is added to or deleted from a database. - : - : @param $db value of type xs:string - : @param $pres value of type xs:integer* - : @return value of type node()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:range the specified pre value does not exist in the database. - :) -declare function db:get-pre($db as xs:string, $pres as xs:integer*) as node()* external; - -(:~ - : Returns all nodes from the database $db with the pre values $ids in distinct document order.
Each database node has a persistent ID value. Access to the node ID can be sped up by turning on the UPDINDEX option. - : - : @param $db value of type xs:string - : @param $ids value of type xs:integer* - : @return value of type node()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:range the specified ID value does not exist in the database. - :) -declare function db:get-id($db as xs:string, $ids as xs:integer*) as node()* external; - -(:~ - : Returns a map with all paths and binary resources of the database $db. A single xs:base64Binary item is returned if a $path is specified. All items are lazy, i.e., the actual data will only be retrieved if it is processed. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type item() - : @error db:open the addressed database does not exist or could not be opened. - : @error db:mainmem the database is not persistent (stored on disk). - :) -declare function db:get-binary($db as xs:string, $path as xs:string) as item() external; - -(:~ - : Returns a map with all paths and values of the database $db. A single value is returned if a $path is specified. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type item()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:mainmem the database is not persistent (stored on disk). - :) -declare function db:get-value($db as xs:string, $path as xs:string) as item()* external; - -(:~ - : Returns the pre values of the specified $nodes, which must all be database nodes.
The PRE value provides very fast access to an existing database node, but it will change whenever a node with a smaller pre values is added to or deleted from a database. - : - : @param $nodes value of type node()* - : @return value of type xs:integer* - : @error db:node $nodes contains a node which is not stored in a database. - :) -declare function db:node-pre($nodes as node()*) as xs:integer* external; - -(:~ - : Returns the id values of the specified $nodes, which must all be database nodes.
Each database node has a persistent ID value. Access to the node id can be sped up by turning on the UPDINDEX option. - : - : @param $nodes value of type node()* - : @return value of type xs:integer* - : @error db:node $nodes contains a node which is not stored in a database. - :) -declare function db:node-id($nodes as node()*) as xs:integer* external; - -(:~ - : Exports the specified database $db to the specified file $path. Existing files will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= "div" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { "method" : "xml" , "cdata-section-elements" : "div" , .. . } 
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:export($db as xs:string, $path as xs:string) as empty-sequence() external; - -(:~ - : Exports the specified database $db to the specified file $path. Existing files will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= "div" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { "method" : "xml" , "cdata-section-elements" : "div" , .. . } 
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @param $params value of type item() - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:export($db as xs:string, $path as xs:string, $params as item()) as empty-sequence() external; - -(:~ - : Returns all text nodes of the database $db that have one of the specified $strings as values and that are stored in the text index. - : - : @param $db value of type xs:string - : @param $strings value of type xs:string* - : @return value of type text()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:text($db as xs:string, $strings as xs:string*) as text()* external; - -(:~ - : Returns all text nodes of the database $db whose values are between $min and $max and that are stored in the text index. - : - : @param $db value of type xs:string - : @param $min value of type xs:string - : @param $max value of type xs:string - : @return value of type text()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:text-range($db as xs:string, $min as xs:string, $max as xs:string) as text()* external; - -(:~ - : Returns all attribute nodes of the database $db that have one of the specified $strings as values and that are stored in the attribute index.
If $name is specified, the resulting attribute nodes are filtered by their attribute name. - : - : @param $db value of type xs:string - : @param $strings value of type xs:string* - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:attribute($db as xs:string, $strings as xs:string*) as attribute()* external; - -(:~ - : Returns all attribute nodes of the database $db that have one of the specified $strings as values and that are stored in the attribute index.
If $name is specified, the resulting attribute nodes are filtered by their attribute name. - : - : @param $db value of type xs:string - : @param $strings value of type xs:string* - : @param $name value of type xs:string - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:attribute($db as xs:string, $strings as xs:string*, $name as xs:string) as attribute()* external; - -(:~ - : Returns all attributes of the database $db, the string values of which are larger than or equal to $min and smaller than or equal to $max and that are stored in the attribute index. - : - : @param $db value of type xs:string - : @param $min value of type xs:string - : @param $max value of type xs:string - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:attribute-range($db as xs:string, $min as xs:string, $max as xs:string) as attribute()* external; - -(:~ - : Returns all attributes of the database $db, the string values of which are larger than or equal to $min and smaller than or equal to $max and that are stored in the attribute index. - : - : @param $db value of type xs:string - : @param $min value of type xs:string - : @param $max value of type xs:string - : @param $name value of type xs:string - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:attribute-range($db as xs:string, $min as xs:string, $max as xs:string, $name as xs:string) as attribute()* external; - -(:~ - : Returns all attribute nodes of the database $db the values of which contain one of the specified $tokens.
If $name is specified, the resulting attribute nodes are filtered by their attribute name. - : - : @param $db value of type xs:string - : @param $tokens value of type xs:string* - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:token($db as xs:string, $tokens as xs:string*) as attribute()* external; - -(:~ - : Returns all attribute nodes of the database $db the values of which contain one of the specified $tokens.
If $name is specified, the resulting attribute nodes are filtered by their attribute name. - : - : @param $db value of type xs:string - : @param $tokens value of type xs:string* - : @param $name value of type xs:string - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:token($db as xs:string, $tokens as xs:string*, $name as xs:string) as attribute()* external; - -(:~ - : Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
- : - : @param $db value of type xs:string - : @error db:lock a database is opened by another process. - : @error db:name the specified name is not a valid database name. - : @error db:conflict the same database was addressed more than once. - : @error db:args the number of specified inputs and paths differs. - :) -declare function db:create($db as xs:string) as empty-sequence() external; - -(:~ - : Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
- : - : @param $db value of type xs:string - : @param $inputs value of type item()* - : @error db:lock a database is opened by another process. - : @error db:name the specified name is not a valid database name. - : @error db:conflict the same database was addressed more than once. - : @error db:args the number of specified inputs and paths differs. - :) -declare function db:create($db as xs:string, $inputs as item()*) as empty-sequence() external; - -(:~ - : Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
- : - : @param $db value of type xs:string - : @param $inputs value of type item()* - : @param $paths value of type xs:string* - : @error db:lock a database is opened by another process. - : @error db:name the specified name is not a valid database name. - : @error db:conflict the same database was addressed more than once. - : @error db:args the number of specified inputs and paths differs. - :) -declare function db:create($db as xs:string, $inputs as item()*, $paths as xs:string*) as empty-sequence() external; - -(:~ - : Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
- : - : @param $db value of type xs:string - : @param $inputs value of type item()* - : @param $paths value of type xs:string* - : @param $options value of type map(*)? - : @error db:lock a database is opened by another process. - : @error db:name the specified name is not a valid database name. - : @error db:conflict the same database was addressed more than once. - : @error db:args the number of specified inputs and paths differs. - :) -declare function db:create($db as xs:string, $inputs as item()*, $paths as xs:string*, $options as map(*)?) as empty-sequence() external; - -(:~ - : Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:put instead.
  • See db:create for more details on the input and path arguments.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
- : - : @param $db value of type xs:string - : @param $input value of type item() - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:add($db as xs:string, $input as item()) as empty-sequence() external; - -(:~ - : Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:put instead.
  • See db:create for more details on the input and path arguments.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
- : - : @param $db value of type xs:string - : @param $input value of type item() - : @param $path value of type xs:string? - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:add($db as xs:string, $input as item(), $path as xs:string?) as empty-sequence() external; - -(:~ - : Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:put instead.
  • See db:create for more details on the input and path arguments.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
- : - : @param $db value of type xs:string - : @param $input value of type item() - : @param $path value of type xs:string? - : @param $options value of type map(*)? - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:add($db as xs:string, $input as item(), $path as xs:string?, $options as map(*)?) as empty-sequence() external; - -(:~ - : Replaces a resource, specified by $path, in the database $db with the contents of $input, or adds it as a new resource:
  • The parsing behavior can be controlled via $options:
    • Allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case.
    • Parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed.
  • See db:create for more details on the input argument.
- : - : @param $db value of type xs:string - : @param $input value of type item() - : @param $path value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:target the path points to a directory. - :) -declare function db:put($db as xs:string, $input as item(), $path as xs:string) as empty-sequence() external; - -(:~ - : Replaces a resource, specified by $path, in the database $db with the contents of $input, or adds it as a new resource:
  • The parsing behavior can be controlled via $options:
    • Allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case.
    • Parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed.
  • See db:create for more details on the input argument.
- : - : @param $db value of type xs:string - : @param $input value of type item() - : @param $path value of type xs:string - : @param $options value of type map(*)? - : @error db:open the addressed database does not exist or could not be opened. - : @error db:target the path points to a directory. - :) -declare function db:put($db as xs:string, $input as item(), $path as xs:string, $options as map(*)?) as empty-sequence() external; - -(:~ - : Stores a binary resource specified by $input in the database $db at the specified $path. Existing resources are overwritten. - : - : @param $db value of type xs:string - : @param $input value of type item() - : @param $path value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:mainmem the database is not persistent (stored on disk). - :) -declare function db:put-binary($db as xs:string, $input as item(), $path as xs:string) as empty-sequence() external; - -(:~ - : Stores a value specified by $input in the database $db at the specified $path. Existing resources are overwritten. The value can be an arbitrary sequence of atomic items, nodes, maps, and arrays. - : - : @param $db value of type xs:string - : @param $input value of type item()* - : @param $path value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:mainmem the database is not persistent (stored on disk). - :) -declare function db:put-value($db as xs:string, $input as item()*, $path as xs:string) as empty-sequence() external; - -(:~ - : Deletes resource(s), specified by $path, from the database $db. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:path the specified path is invalid. - :) -declare function db:delete($db as xs:string, $path as xs:string) as empty-sequence() external; - -(:~ - : Creates a copy of the database $db, which will be called $name. - : - : @param $db value of type xs:string - : @param $name value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:lock a database is opened by another process. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:copy($db as xs:string, $name as xs:string) as empty-sequence() external; - -(:~ - : Renames the database $db to $name. - : - : @param $db value of type xs:string - : @param $name value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:lock a database is opened by another process. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:alter($db as xs:string, $name as xs:string) as empty-sequence() external; - -(:~ - : Optimizes the metadata and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true. - : - : @param $db value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:optimize($db as xs:string) as empty-sequence() external; - -(:~ - : Optimizes the metadata and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true. - : - : @param $db value of type xs:string - : @param $all value of type xs:boolean - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:optimize($db as xs:string, $all as xs:boolean) as empty-sequence() external; - -(:~ - : Optimizes the metadata and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true. - : - : @param $db value of type xs:string - : @param $all value of type xs:boolean - : @param $options value of type map(*)? - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:optimize($db as xs:string, $all as xs:boolean, $options as map(*)?) as empty-sequence() external; - -(:~ - : Moves all resources(s) of database $db, which are found in the supplied $source path, to the supplied $target path. The paths may point to single resources or directories. No updates will take place if a non-existing source path is supplied. - : - : @param $db value of type xs:string - : @param $source value of type xs:string - : @param $target value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:path the specified source or target path, or one of its descendants, is invalid. - :) -declare function db:rename($db as xs:string, $source as xs:string, $target as xs:string) as empty-sequence() external; - -(:~ - : Explicitly flushes the buffers of the database $db. This command is only useful if AUTOFLUSH has been set to false. - : - : @param $db value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:flush($db as xs:string) as empty-sequence() external; - -(:~ - : Drops the database $db and all connected resources. - : - : @param $db value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:lock a database is opened by another process. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:drop($db as xs:string) as empty-sequence() external; - -(:~ - : Creates a backup of the database $db. If no name is supplied, general data will be backed up. The following $options are available:
  • With comment, a comment string can be attached to the backup.
  • By setting compress to false, the backup will be created faster, but it will take more space on disk.
- : - : @param $db value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:create-backup($db as xs:string) as empty-sequence() external; - -(:~ - : Creates a backup of the database $db. If no name is supplied, general data will be backed up. The following $options are available:
  • With comment, a comment string can be attached to the backup.
  • By setting compress to false, the backup will be created faster, but it will take more space on disk.
- : - : @param $db value of type xs:string - : @param $options value of type map(*) - : @error db:open the addressed database does not exist or could not be opened. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:create-backup($db as xs:string, $options as map(*)) as empty-sequence() external; - -(:~ - : Drops all backups of the database with the specified $name. If the name ends with a timestamp, only the specified backup file will be deleted. If no name is supplied, backups with general data are addressed. - : - : @param $name value of type xs:string - : @error db:backup No backup file found. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:drop-backup($name as xs:string) as empty-sequence() external; - -(:~ - : Renames all backups of the database with the specified $name to $new-name. If the name ends with a date, only the specified backup file will be renamed. - : - : @param $name value of type xs:string - : @param $new-name value of type xs:string - : @error db:backup No backup file found. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:alter-backup($name as xs:string, $new-name as xs:string) as empty-sequence() external; - -(:~ - : Restores the database with the specified $name. The $name may include the timestamp of the backup file. If no name is supplied, general data will be restored. If general data is restored, it will only be available after BaseX has been restarted. - : - : @param $name value of type xs:string - : @error db:lock a database is opened by another process. - : @error db:name invalid database name. - : @error db:no-backup No backup found. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:restore($name as xs:string) as empty-sequence() external; - -(:~ - : Returns an element sequence containing all available database backups with timestamp, file size and comment.
If a database $db is specified, the sequence will be restricted to the backups matching this database. - : - : @return value of type element(backup)* - :) -declare function db:backups() as element(backup)* external; - -(:~ - : Returns an element sequence containing all available database backups with timestamp, file size and comment.
If a database $db is specified, the sequence will be restricted to the backups matching this database. - : - : @param $db value of type xs:string - : @return value of type element(backup)* - :) -declare function db:backups($db as xs:string) as element(backup)* external; - -(:~ - : Returns the name of the database in which the specified database node $node is stored. - : - : @param $node value of type node() - : @return value of type xs:string - : @error db:node $nodes contains a node which is not stored in a database. - :) -declare function db:name($node as node()) as xs:string external; - -(:~ - : Returns the path of the database document in which the specified database node $node is stored. - : - : @param $node value of type node() - : @return value of type xs:string - : @error db:node $nodes contains a node which is not stored in a database. - :) -declare function db:path($node as node()) as xs:string external; - -(:~ - : Checks if the database $db or the resource specified by $path exists. false is returned if a database directory has been addressed. - : - : @param $db value of type xs:string - : @return value of type xs:boolean - :) -declare function db:exists($db as xs:string) as xs:boolean external; - -(:~ - : Checks if the database $db or the resource specified by $path exists. false is returned if a database directory has been addressed. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function db:exists($db as xs:string, $path as xs:string) as xs:boolean external; - -(:~ - : Returns the type of a resource – xml, binary, or value – in the database $db at the specified $path. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:boolean - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:type($db as xs:string, $path as xs:string) as xs:boolean external; - -(:~ - : Retrieves the content type of a resource in the database $db and the path $path.
The file extension is used to recognize the content-type of a resource stored in the database. Content-type application/xml will be returned for any XML document stored in the database, regardless of its file name extension. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:content-type($db as xs:string, $path as xs:string) as xs:string external; diff --git a/packages.src/basex-10.0/fetch.xqm b/packages.src/basex-10.0/fetch.xqm deleted file mode 100644 index 67f959f..0000000 --- a/packages.src/basex-10.0/fetch.xqm +++ /dev/null @@ -1,96 +0,0 @@ -(:~ - : This XQuery Module provides simple functions to fetch the content of resources identified by URIs. Resources can be stored locally or remotely and e.g. use the file:// or http:// scheme. If more control over HTTP requests is required, the HTTP Client Module can be used. With the HTML Module, retrieved HTML documents can be converted to XML. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Fetch_Module - :) -module namespace fetch = "http://basex.org/modules/fetch"; - -(:~ - : Fetches the resource referred to by the given URI and returns it as lazy xs:base64Binary item. - : - : @param $uri value of type xs:string - : @return value of type xs:base64Binary - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - :) -declare function fetch:binary($uri as xs:string) as xs:base64Binary external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $uri value of type xs:string - : @return value of type xs:string - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - : @error fetch:encoding the specified encoding is not supported, or unknown. - :) -declare function fetch:text($uri as xs:string) as xs:string external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $uri value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:string - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - : @error fetch:encoding the specified encoding is not supported, or unknown. - :) -declare function fetch:text($uri as xs:string, $encoding as xs:string) as xs:string external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $uri value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @return value of type xs:string - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - : @error fetch:encoding the specified encoding is not supported, or unknown. - :) -declare function fetch:text($uri as xs:string, $encoding as xs:string, $fallback as xs:boolean) as xs:string external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as a document node.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case.
The function differs from fn:doc in various aspects:
  • It is non-deterministic, i.e., a new document node will be created by each call of this function.
  • A document created by this function will be garbage-collected as soon as it is not referenced anymore.
  • URIs will not be resolved against existing databases. As a result, it will not trigger any locks (see limitations of database locking for more details).
- : - : @param $uri value of type xs:string - : @return value of type document-node() - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - :) -declare function fetch:doc($uri as xs:string) as document-node() external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as a document node.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case.
The function differs from fn:doc in various aspects:
  • It is non-deterministic, i.e., a new document node will be created by each call of this function.
  • A document created by this function will be garbage-collected as soon as it is not referenced anymore.
  • URIs will not be resolved against existing databases. As a result, it will not trigger any locks (see limitations of database locking for more details).
- : - : @param $uri value of type xs:string - : @param $options value of type map(*)? - : @return value of type document-node() - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - :) -declare function fetch:doc($uri as xs:string, $options as map(*)?) as document-node() external; - -(:~ - : Converts the specified $input (xs:base64Binary, xs:hexBinary) to XML and returns it as a document node.
In contrast to fn:parse-xml, which expects a string, the input can be arbitrarily encoded. The encoding will be derived from the XML declaration or (in case of UTF-16 or UTF-32) from the first bytes of the input.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case. - : - : @param $input value of type xs:anyAtomicType - : @return value of type document-node() - : @error fetch:open the input could not be parsed. - :) -declare function fetch:binary-doc($input as xs:anyAtomicType) as document-node() external; - -(:~ - : Converts the specified $input (xs:base64Binary, xs:hexBinary) to XML and returns it as a document node.
In contrast to fn:parse-xml, which expects a string, the input can be arbitrarily encoded. The encoding will be derived from the XML declaration or (in case of UTF-16 or UTF-32) from the first bytes of the input.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case. - : - : @param $data value of type xs:anyAtomicType - : @param $options value of type map(*)? - : @return value of type document-node() - : @error fetch:open the input could not be parsed. - :) -declare function fetch:binary-doc($data as xs:anyAtomicType, $options as map(*)?) as document-node() external; - -(:~ - : Returns the content-type (also called mime-type) of the resource specified by $uri:
  • If a remote resource is addressed, the request header will be evaluated.
  • If the addressed resource is locally stored, the content-type will be guessed based on the file extension.
- : - : @param $uri value of type xs:string - : @return value of type xs:string - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - :) -declare function fetch:content-type($uri as xs:string) as xs:string external; diff --git a/packages.src/basex-10.0/file.xqm b/packages.src/basex-10.0/file.xqm deleted file mode 100644 index 9b75756..0000000 --- a/packages.src/basex-10.0/file.xqm +++ /dev/null @@ -1,639 +0,0 @@ -(:~ - : This XQuery Module contains functions related to file system operations, such as listing, reading, or writing files. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/File_Module - :) -module namespace file = "http://expath.org/ns/file"; -declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization"; - -(:~ - : Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether subdirectories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
- : - : @param $dir value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:no-dir the specified path does not point to a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:list($dir as xs:string) as xs:string* external; - -(:~ - : Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether subdirectories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
- : - : @param $dir value of type xs:string - : @param $recursive value of type xs:boolean - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:no-dir the specified path does not point to a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:list($dir as xs:string, $recursive as xs:boolean) as xs:string* external; - -(:~ - : Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether subdirectories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
- : - : @param $dir value of type xs:string - : @param $recursive value of type xs:boolean - : @param $pattern value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:no-dir the specified path does not point to a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:list($dir as xs:string, $recursive as xs:boolean, $pattern as xs:string) as xs:string* external; - -(:~ - : Returns the full paths to all files and directories found in the specified $dir.
The inverse function is file:parent . The returned paths start with the specified directory. The related function file:list returns relative file paths. - : - : @param $dir value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:no-dir the specified path does not point to a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:children($dir as xs:string) as xs:string* external; - -(:~ - : Returns the full paths to all files and directories found in the specified $dir and its subdirectories.
. The returned paths start with the specified directory. The related function file:list creates relative file paths. - : - : @param $dir value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:no-dir the specified path does not point to a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:descendants($dir as xs:string) as xs:string* external; - -(:~ - : Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file. - : - : @param $path value of type xs:string - : @return value of type xs:base64Binary - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset or length is negative, or the chosen values would exceed the file bounds. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-binary($path as xs:string) as xs:base64Binary external; - -(:~ - : Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file. - : - : @param $path value of type xs:string - : @param $offset value of type xs:integer - : @return value of type xs:base64Binary - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset or length is negative, or the chosen values would exceed the file bounds. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-binary($path as xs:string, $offset as xs:integer) as xs:base64Binary external; - -(:~ - : Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file. - : - : @param $path value of type xs:string - : @param $offset value of type xs:integer - : @param $length value of type xs:integer - : @return value of type xs:base64Binary - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset or length is negative, or the chosen values would exceed the file bounds. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-binary($path as xs:string, $offset as xs:integer, $length as xs:integer) as xs:base64Binary external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $path value of type xs:string - : @return value of type xs:string - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text($path as xs:string) as xs:string external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:string - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text($path as xs:string, $encoding as xs:string) as xs:string external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @return value of type xs:string - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text($path as xs:string, $encoding as xs:string, $fallback as xs:boolean) as xs:string external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string) as xs:string* external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string, $encoding as xs:string) as xs:string* external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string, $encoding as xs:string, $fallback as xs:boolean) as xs:string* external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @param $offset value of type xs:integer - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string, $encoding as xs:string, $fallback as xs:boolean, $offset as xs:integer) as xs:string* external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @param $offset value of type xs:integer - : @param $length value of type xs:integer - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string, $encoding as xs:string, $fallback as xs:boolean, $offset as xs:integer, $length as xs:integer) as xs:string* external; - -(:~ - : Creates the directory specified by $dir if it does not already exist. Non-existing parent directories will be created as well.
- : - : @param $dir value of type xs:string - : @error file:exists the specified target exists, but is no directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:create-dir($dir as xs:string) as empty-sequence() external; - -(:~ - : Creates a new temporary directory that did not exist before this function was called, and returns its full file path. The directory name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the directory will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories. - : - : @param $prefix value of type xs:string - : @param $suffix value of type xs:string - : @return value of type xs:string - : @error file:no-dir the specified directory points to a file. - : @error file:io-error the directory could not be created. - :) -declare function file:create-temp-dir($prefix as xs:string, $suffix as xs:string) as xs:string external; - -(:~ - : Creates a new temporary directory that did not exist before this function was called, and returns its full file path. The directory name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the directory will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories. - : - : @param $prefix value of type xs:string - : @param $suffix value of type xs:string - : @param $dir value of type xs:string - : @return value of type xs:string - : @error file:no-dir the specified directory points to a file. - : @error file:io-error the directory could not be created. - :) -declare function file:create-temp-dir($prefix as xs:string, $suffix as xs:string, $dir as xs:string) as xs:string external; - -(:~ - : Creates a new temporary file that did not exist before this function was called, and returns its full file path. The file name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the file will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories. - : - : @param $prefix value of type xs:string - : @param $suffix value of type xs:string - : @return value of type xs:string - : @error file:no-dir the specified directory points to a file. - : @error file:io-error the directory could not be created. - :) -declare function file:create-temp-file($prefix as xs:string, $suffix as xs:string) as xs:string external; - -(:~ - : Creates a new temporary file that did not exist before this function was called, and returns its full file path. The file name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the file will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories. - : - : @param $prefix value of type xs:string - : @param $suffix value of type xs:string - : @param $dir value of type xs:string - : @return value of type xs:string - : @error file:no-dir the specified directory points to a file. - : @error file:io-error the directory could not be created. - :) -declare function file:create-temp-file($prefix as xs:string, $suffix as xs:string, $dir as xs:string) as xs:string external; - -(:~ - : Recursively deletes a file or directory specified by $path.
The optional parameter $recursive specifies whether subdirectories will be deleted, too.
- : - : @param $path value of type xs:string - : @error file:not-found the specified path does not exist. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:delete($path as xs:string) as empty-sequence() external; - -(:~ - : Recursively deletes a file or directory specified by $path.
The optional parameter $recursive specifies whether subdirectories will be deleted, too.
- : - : @param $path value of type xs:string - : @param $recursive value of type xs:boolean - : @error file:not-found the specified path does not exist. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:delete($path as xs:string, $recursive as xs:boolean) as empty-sequence() external; - -(:~ - : Writes a serialized sequence of items to the specified file. If the file already exists, it will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= "div" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { "method" : "xml" , "cdata-section-elements" : "div" , .. . } 
- : - : @param $path value of type xs:string - : @param $items value of type item()* - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write($path as xs:string, $items as item()*) as empty-sequence() external; - -(:~ - : Writes a serialized sequence of items to the specified file. If the file already exists, it will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= "div" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { "method" : "xml" , "cdata-section-elements" : "div" , .. . } 
- : - : @param $path value of type xs:string - : @param $items value of type item()* - : @param $params value of type item() - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write($path as xs:string, $items as item()*, $params as item()) as empty-sequence() external; - -(:~ - : Writes a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file already exists, it will be overwritten.
If $offset is specified, data will be written at this file position. An existing file may be resized by that operation. - : - : @param $path value of type xs:string - : @param $value value of type xs:anyAtomicType - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset is negative, or it exceeds the current file size. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-binary($path as xs:string, $value as xs:anyAtomicType) as empty-sequence() external; - -(:~ - : Writes a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file already exists, it will be overwritten.
If $offset is specified, data will be written at this file position. An existing file may be resized by that operation. - : - : @param $path value of type xs:string - : @param $value value of type xs:anyAtomicType - : @param $offset value of type xs:integer - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset is negative, or it exceeds the current file size. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-binary($path as xs:string, $value as xs:anyAtomicType, $offset as xs:integer) as empty-sequence() external; - -(:~ - : Writes a string to the specified file. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $value value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-text($path as xs:string, $value as xs:string) as empty-sequence() external; - -(:~ - : Writes a string to the specified file. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $value value of type xs:string - : @param $encoding value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-text($path as xs:string, $value as xs:string, $encoding as xs:string) as empty-sequence() external; - -(:~ - : Writes a sequence of strings to the specified file, each followed by the system specific newline character. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $values value of type xs:string* - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-text-lines($path as xs:string, $values as xs:string*) as empty-sequence() external; - -(:~ - : Writes a sequence of strings to the specified file, each followed by the system specific newline character. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $values value of type xs:string* - : @param $encoding value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-text-lines($path as xs:string, $values as xs:string*, $encoding as xs:string) as empty-sequence() external; - -(:~ - : Appends a serialized sequence of items to the specified file. If the file does not exists, a new file is created.
- : - : @param $path value of type xs:string - : @param $items value of type item()* - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append($path as xs:string, $items as item()*) as empty-sequence() external; - -(:~ - : Appends a serialized sequence of items to the specified file. If the file does not exists, a new file is created.
- : - : @param $path value of type xs:string - : @param $items value of type item()* - : @param $params value of type item() - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append($path as xs:string, $items as item()*, $params as item()) as empty-sequence() external; - -(:~ - : Appends a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file does not exists, a new one is created.
- : - : @param $path value of type xs:string - : @param $value value of type xs:anyAtomicType - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-binary($path as xs:string, $value as xs:anyAtomicType) as empty-sequence() external; - -(:~ - : Appends a string to a file specified by $path. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $value value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-text($path as xs:string, $value as xs:string) as empty-sequence() external; - -(:~ - : Appends a string to a file specified by $path. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $value value of type xs:string - : @param $encoding value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-text($path as xs:string, $value as xs:string, $encoding as xs:string) as empty-sequence() external; - -(:~ - : Appends a sequence of strings to the specified file, each followed by the system specific newline character. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $values value of type xs:string* - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-text-lines($path as xs:string, $values as xs:string*) as empty-sequence() external; - -(:~ - : Appends a sequence of strings to the specified file, each followed by the system specific newline character. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $values value of type xs:string* - : @param $encoding value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-text-lines($path as xs:string, $values as xs:string*, $encoding as xs:string) as empty-sequence() external; - -(:~ - : Copies a file or directory specified by $source to the file or directory specified by $target. If the target file already exists, it will be overwritten. No operation will be performed if the source and target path are equal.
- : - : @param $source value of type xs:string - : @param $target value of type xs:string - : @error file:not-found the specified source does not exist. - : @error file:exists the specified source is a directory and the target is a file. - : @error file:no-dir the parent of the specified target is no directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:copy($source as xs:string, $target as xs:string) as empty-sequence() external; - -(:~ - : Moves or renames the file or directory specified by $source to the path specified by $target. If the target file already exists, it will be overwritten. No operation will be performed if the source and target path are equal.
- : - : @param $source value of type xs:string - : @param $target value of type xs:string - : @error file:not-found the specified source does not exist. - : @error file:exists the specified source is a directory and the target is a file. - : @error file:no-dir the parent of the specified target is no directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:move($source as xs:string, $target as xs:string) as empty-sequence() external; - -(:~ - : Returns an xs:boolean indicating whether a file or directory specified by $path exists in the file system.
- : - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function file:exists($path as xs:string) as xs:boolean external; - -(:~ - : Returns an xs:boolean indicating whether the argument $path points to an existing directory.
- : - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function file:is-dir($path as xs:string) as xs:boolean external; - -(:~ - : Returns an xs:boolean indicating whether the argument $path is absolute.
The behavior of this function depends on the operating system: On Windows, an absolute path starts with the drive letter and a colon, whereas on Linux it starts with a slash. - : - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function file:is-absolute($path as xs:string) as xs:boolean external; - -(:~ - : Returns an xs:boolean indicating whether the argument $path points to an existing file.
- : - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function file:is-file($path as xs:string) as xs:boolean external; - -(:~ - : Retrieves the timestamp of the last modification of the file or directory specified by $path.
- : - : @param $path value of type xs:string - : @return value of type xs:dateTime - : @error file:not-found the specified path does not exist. - :) -declare function file:last-modified($path as xs:string) as xs:dateTime external; - -(:~ - : Returns the size, in bytes, of the file specified by $path, or 0 for directories.
- : - : @param $path value of type xs:string - : @return value of type xs:integer - : @error file:not-found the specified file does not exist. - :) -declare function file:size($path as xs:string) as xs:integer external; - -(:~ - : Returns the name of a file or directory specified by $path. An empty string is returned if the path points to the root directory. - : - : @param $path value of type xs:string - : @return value of type xs:string - :) -declare function file:name($path as xs:string) as xs:string external; - -(:~ - : Returns the absolute path to the parent directory of a file or directory specified by $path. An empty sequence is returned if the path points to a root directory.
The inverse function is file:children .
- : - : @param $path value of type xs:string - : @return value of type xs:string? - :) -declare function file:parent($path as xs:string) as xs:string? external; - -(:~ - : Transforms the $path argument to its native representation on the operating system.
- : - : @param $path value of type xs:string - : @return value of type xs:string - : @error file:not-found the specified file does not exist. - : @error file:io-error the specified path cannot be transformed to its native representation. - :) -declare function file:path-to-native($path as xs:string) as xs:string external; - -(:~ - : Transforms the $path argument to an absolute operating system path.
If the path is relative, and if an absolute $base path is specified, it will be resolved against this path. - : - : @param $path value of type xs:string - : @return value of type xs:string - : @error file:is-relative the specified base path is relative. - :) -declare function file:resolve-path($path as xs:string) as xs:string external; - -(:~ - : Transforms the $path argument to an absolute operating system path.
If the path is relative, and if an absolute $base path is specified, it will be resolved against this path. - : - : @param $path value of type xs:string - : @param $base value of type xs:string - : @return value of type xs:string - : @error file:is-relative the specified base path is relative. - :) -declare function file:resolve-path($path as xs:string, $base as xs:string) as xs:string external; - -(:~ - : Transforms the path specified by $path into a URI with the file:// scheme.
- : - : @param $path value of type xs:string - : @return value of type xs:string - :) -declare function file:path-to-uri($path as xs:string) as xs:string external; - -(:~ - : Returns the directory separator used by the operating system, such as / or \.
- : - : @return value of type xs:string - :) -declare function file:dir-separator() as xs:string external; - -(:~ - : Returns the path separator used by the operating system, such as ; or :.
- : - : @return value of type xs:string - :) -declare function file:path-separator() as xs:string external; - -(:~ - : Returns the line separator used by the operating system, such as &#10;, &#13;&#10; or &#13;.
- : - : @return value of type xs:string - :) -declare function file:line-separator() as xs:string external; - -(:~ - : Returns the system’s default temporary-file directory.
- : - : @return value of type xs:string - :) -declare function file:temp-dir() as xs:string external; - -(:~ - : Returns the current working directory, i.e., the directory from which the query processor was started. This function returns the same result as the function call file:resolve-path(""). - : - : @return value of type xs:string - :) -declare function file:current-dir() as xs:string external; - -(:~ - : Returns the parent directory of the static base URI.
If the static base URI is undefined or does not point to a local resource, it returns the empty sequence. Otherwise, it returns the same result as file:parent(static-base-uri()). - : - : @return value of type xs:string? - :) -declare function file:base-dir() as xs:string? external; diff --git a/packages.src/basex-10.0/ft.xqm b/packages.src/basex-10.0/ft.xqm deleted file mode 100644 index 79fd340..0000000 --- a/packages.src/basex-10.0/ft.xqm +++ /dev/null @@ -1,187 +0,0 @@ -(:~ - : This XQuery Module extends the Full-Text features of BaseX: The index can be directly accessed, full-text results can be marked with additional elements, or the relevant parts can be extracted. Moreover, the score value, which is generated by the contains text expression, can be explicitly requested from items. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Full-Text_Module - :) -module namespace ft = "http://basex.org/modules/ft"; - -(:~ - : Returns all text nodes from the full-text index of the database $db that contain the specified $terms.
The options used for tokenizing the input and building the full-text will also be applied to the search terms. As an example, if the index terms have been stemmed, the search string will be stemmed as well.

The $options argument can be used to control full-text processing. The following options are supported (the introduction on Full-Text processing gives you equivalent expressions in the XQuery Full-Text notation):

  • mode: determine the mode how tokens are searched. Allowed values are any, any word, all, all words, and phrase. any is the default search mode.
  • wildcards: turn wildcard querying on or off. Allowed values are true and false. By default, wildcard querying is turned off.
  • fuzzy: turn fuzzy querying on or off. Allowed values are true and false. By default, fuzzy querying is turned off.
  • errors: control the maximum number of tolerated errors for fuzzy querying. By default, 0 is assigned (see Fuzzy Querying for more details).
  • ordered: indicate if all tokens must occur in the order in which they are specified. Allowed values are true and false. The default is false.
  • content: specify that the matched tokens need to occur at the beginning or end of a searched string, or need to cover the entire string. Allowed values are start, end, and entire. By default, the option is turned off.
  • scope: define the scope in which tokens must be located. The option has following sub options:
    • same: can be set to true or false. It specifies if tokens need to occur in the same or different units.
    • unit: can be sentence or paragraph. It specifies the unit for finding tokens.
  • window: set up a window in which all tokens must be located. By default, the option is turned off. It has following sub options:
    • size: specify the size of the window in terms of units.
    • unit: can be sentences, sentences or paragraphs. The default is words.
  • distance: specify the distance in which tokens must occur. By default, the option is turned off. It has following sub options:
    • min: specify the minimum distance in terms of units. The default is 0.
    • max: specify the maximum distance in terms of units. The default is ∞.
    • unit: can be words, sentences or paragraphs. The default is words.
- : - : @param $db value of type xs:string - : @param $terms value of type item()* - : @return value of type text()* - : @error db:get The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - : @error ft:options the fuzzy and wildcard option cannot be both specified. - :) -declare function ft:search($db as xs:string, $terms as item()*) as text()* external; - -(:~ - : Returns all text nodes from the full-text index of the database $db that contain the specified $terms.
The options used for tokenizing the input and building the full-text will also be applied to the search terms. As an example, if the index terms have been stemmed, the search string will be stemmed as well.

The $options argument can be used to control full-text processing. The following options are supported (the introduction on Full-Text processing gives you equivalent expressions in the XQuery Full-Text notation):

  • mode: determine the mode how tokens are searched. Allowed values are any, any word, all, all words, and phrase. any is the default search mode.
  • wildcards: turn wildcard querying on or off. Allowed values are true and false. By default, wildcard querying is turned off.
  • fuzzy: turn fuzzy querying on or off. Allowed values are true and false. By default, fuzzy querying is turned off.
  • errors: control the maximum number of tolerated errors for fuzzy querying. By default, 0 is assigned (see Fuzzy Querying for more details).
  • ordered: indicate if all tokens must occur in the order in which they are specified. Allowed values are true and false. The default is false.
  • content: specify that the matched tokens need to occur at the beginning or end of a searched string, or need to cover the entire string. Allowed values are start, end, and entire. By default, the option is turned off.
  • scope: define the scope in which tokens must be located. The option has following sub options:
    • same: can be set to true or false. It specifies if tokens need to occur in the same or different units.
    • unit: can be sentence or paragraph. It specifies the unit for finding tokens.
  • window: set up a window in which all tokens must be located. By default, the option is turned off. It has following sub options:
    • size: specify the size of the window in terms of units.
    • unit: can be sentences, sentences or paragraphs. The default is words.
  • distance: specify the distance in which tokens must occur. By default, the option is turned off. It has following sub options:
    • min: specify the minimum distance in terms of units. The default is 0.
    • max: specify the maximum distance in terms of units. The default is ∞.
    • unit: can be words, sentences or paragraphs. The default is words.
- : - : @param $db value of type xs:string - : @param $terms value of type item()* - : @param $options value of type map(*)? - : @return value of type text()* - : @error db:get The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - : @error ft:options the fuzzy and wildcard option cannot be both specified. - :) -declare function ft:search($db as xs:string, $terms as item()*, $options as map(*)?) as text()* external; - -(:~ - : Returns all full-text tokens stored in the index of the database $db, along with their numbers of occurrences.
If $prefix is specified, the returned nodes will be refined to the strings starting with that prefix. The prefix will be tokenized according to the full-text used for creating the index. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:get The addressed database does not exist or could not be opened. - : @error db:no-index the full-text index is not available. - :) -declare function ft:tokens($db as xs:string) as element(value)* external; - -(:~ - : Returns all full-text tokens stored in the index of the database $db, along with their numbers of occurrences.
If $prefix is specified, the returned nodes will be refined to the strings starting with that prefix. The prefix will be tokenized according to the full-text used for creating the index. - : - : @param $db value of type xs:string - : @param $prefix value of type xs:string - : @return value of type element(value)* - : @error db:get The addressed database does not exist or could not be opened. - : @error db:no-index the full-text index is not available. - :) -declare function ft:tokens($db as xs:string, $prefix as xs:string) as element(value)* external; - -(:~ - : Checks if the specified $input items contain the specified $terms.
The function does the same as the Full-Text expression contains text, but options can be specified more dynamically. The $options are the same as for ft:search , and the following ones exist:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case-insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.
- : - : @param $input value of type item()* - : @param $terms value of type item()* - : @return value of type xs:boolean - : @error ft:options specified options are conflicting. - :) -declare function ft:contains($input as item()*, $terms as item()*) as xs:boolean external; - -(:~ - : Checks if the specified $input items contain the specified $terms.
The function does the same as the Full-Text expression contains text, but options can be specified more dynamically. The $options are the same as for ft:search , and the following ones exist:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case-insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.
- : - : @param $input value of type item()* - : @param $terms value of type item()* - : @param $options value of type map(*)? - : @return value of type xs:boolean - : @error ft:options specified options are conflicting. - :) -declare function ft:contains($input as item()*, $terms as item()*, $options as map(*)?) as xs:boolean external; - -(:~ - : Returns the number of occurrences of the search terms specified in a full-text expression. - : - : @param $nodes value of type node()* - : @return value of type xs:integer - :) -declare function ft:count($nodes as node()*) as xs:integer external; - -(:~ - : Returns the score values (0.0 - 1.0) that have been attached to the specified items. 0 is returned a value if no score was attached. - : - : @param $item value of type item()* - : @return value of type xs:double* - :) -declare function ft:score($item as item()*) as xs:double* external; - -(:~ - : Tokenizes the given $string, using the current default full-text options or the $options specified as second argument, and returns a sequence with the tokenized string. The following options are available:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.

The $options argument can be used to control full-text processing.

- : - : @param $string value of type xs:string? - : @return value of type xs:string* - :) -declare function ft:tokenize($string as xs:string?) as xs:string* external; - -(:~ - : Tokenizes the given $string, using the current default full-text options or the $options specified as second argument, and returns a sequence with the tokenized string. The following options are available:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.

The $options argument can be used to control full-text processing.

- : - : @param $string value of type xs:string? - : @param $options value of type map(*)? - : @return value of type xs:string* - :) -declare function ft:tokenize($string as xs:string?, $options as map(*)?) as xs:string* external; - -(:~ - : Normalizes the given $string, using the current default full-text options or the $options specified as second argument. The function accepts the same arguments as ft:tokenize ; special characters and separators will be preserved. - : - : @param $string value of type xs:string? - : @return value of type xs:string - :) -declare function ft:normalize($string as xs:string?) as xs:string external; - -(:~ - : Normalizes the given $string, using the current default full-text options or the $options specified as second argument. The function accepts the same arguments as ft:tokenize ; special characters and separators will be preserved. - : - : @param $string value of type xs:string? - : @param $options value of type map(*)? - : @return value of type xs:string - :) -declare function ft:normalize($string as xs:string?, $options as map(*)?) as xs:string external; - -(:~ - : Looks up a $term in a Thesaurus Structure supplied by $node. The following $options exist:
  • relationship: determines the relationship between terms
  • levels: determines the maximum number of levels to traverse
- : - : @param $node value of type node() - : @param $term value of type xs:string - : @return value of type xs:string* - :) -declare function ft:thesaurus($node as node(), $term as xs:string) as xs:string* external; - -(:~ - : Looks up a $term in a Thesaurus Structure supplied by $node. The following $options exist:
  • relationship: determines the relationship between terms
  • levels: determines the maximum number of levels to traverse
- : - : @param $node value of type node() - : @param $term value of type xs:string - : @param $options value of type map(*)? - : @return value of type xs:string* - :) -declare function ft:thesaurus($node as node(), $term as xs:string, $options as map(*)?) as xs:string* external; - -(:~ - : Puts a marker element around the resulting $nodes of a full-text request.
The default name of the marker element is mark. An alternative name can be chosen via the optional $name argument.
Please note that:
  • The full-text expression that computes the token positions must be specified as argument of the ft:mark() function, as all position information is lost in subsequent processing steps. You may need to specify more than one full-text expression if you want to use the function in a FLWOR expression, as shown in Example 2.
  • The supplied node must be a Database Node. As shown in Example 3, update or transform can be utilized to convert a fragment to the required internal representation.
- : - : @param $nodes value of type node()* - : @return value of type node()* - :) -declare function ft:mark($nodes as node()*) as node()* external; - -(:~ - : Puts a marker element around the resulting $nodes of a full-text request.
The default name of the marker element is mark. An alternative name can be chosen via the optional $name argument.
Please note that:
  • The full-text expression that computes the token positions must be specified as argument of the ft:mark() function, as all position information is lost in subsequent processing steps. You may need to specify more than one full-text expression if you want to use the function in a FLWOR expression, as shown in Example 2.
  • The supplied node must be a Database Node. As shown in Example 3, update or transform can be utilized to convert a fragment to the required internal representation.
- : - : @param $nodes value of type node()* - : @param $name value of type xs:string - : @return value of type node()* - :) -declare function ft:mark($nodes as node()*, $name as xs:string) as node()* external; - -(:~ - : Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark . - : - : @param $nodes value of type node()* - : @return value of type node()* - :) -declare function ft:extract($nodes as node()*) as node()* external; - -(:~ - : Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark . - : - : @param $nodes value of type node()* - : @param $name value of type xs:string - : @return value of type node()* - :) -declare function ft:extract($nodes as node()*, $name as xs:string) as node()* external; - -(:~ - : Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark . - : - : @param $nodes value of type node()* - : @param $name value of type xs:string - : @param $length value of type xs:integer - : @return value of type node()* - :) -declare function ft:extract($nodes as node()*, $name as xs:string, $length as xs:integer) as node()* external; diff --git a/packages.src/basex-10.0/hash.xqm b/packages.src/basex-10.0/hash.xqm deleted file mode 100644 index a51c600..0000000 --- a/packages.src/basex-10.0/hash.xqm +++ /dev/null @@ -1,41 +0,0 @@ -(:~ - : This XQuery Module provides functions that perform different hash operations. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Hashing_Module - :) -module namespace hash = "http://basex.org/modules/hash"; - -(:~ - : Computes the MD5 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary. - : - : @param $value value of type xs:anyAtomicType - : @return value of type xs:base64Binary - :) -declare function hash:md5($value as xs:anyAtomicType) as xs:base64Binary external; - -(:~ - : Computes the SHA-1 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary. - : - : @param $value value of type xs:anyAtomicType - : @return value of type xs:base64Binary - :) -declare function hash:sha1($value as xs:anyAtomicType) as xs:base64Binary external; - -(:~ - : Computes the SHA-256 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary. - : - : @param $value value of type xs:anyAtomicType - : @return value of type xs:base64Binary - :) -declare function hash:sha256($value as xs:anyAtomicType) as xs:base64Binary external; - -(:~ - : Computes the hash of the given $value, using the specified $algorithm. The specified values may be of type xs:string, xs:base64Binary, or xs:hexBinary.
The following three algorithms are supported: MD5, SHA-1, and SHA-256. - : - : @param $value value of type xs:anyAtomicType - : @param $algorithm value of type xs:string - : @return value of type xs:base64Binary - : @error hash:algorithm the specified hashing algorithm is unknown. - :) -declare function hash:hash($value as xs:anyAtomicType, $algorithm as xs:string) as xs:base64Binary external; diff --git a/packages.src/basex-10.0/hof.xqm b/packages.src/basex-10.0/hof.xqm deleted file mode 100644 index 5078d1f..0000000 --- a/packages.src/basex-10.0/hof.xqm +++ /dev/null @@ -1,90 +0,0 @@ -(:~ - : This XQuery Module adds some useful higher-order functions, additional to the Higher-Order Functions provided by the official specification. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Higher-Order_Functions_Module - :) -module namespace hof = "http://basex.org/modules/hof"; - -(:~ - : Works the same as fn:fold-left, but does not need a seed, because the sequence must be non-empty. - : - : @param $seq value of type item()+ - : @param $f value of type function(item()* - : @param item() value of type - : @return value of type item()* - :) -declare function hof:fold-left1($seq as item()+, $f as function(item()*, item()) as item()*) as item()* external; - -(:~ - : Applies the predicate function $pred to $start. If the result is false, $f is invoked with the start value – or, subsequently, with the result of this function – until the predicate function returns true(). - : - : @param $pred value of type function(item()* - : @return value of type item()* - :) -declare function hof:until($pred as function(item()*) as xs:boolean, $f as function(item()*) as item()*, $start as item()*) as item()* external; - -(:~ - : This function is similar to fn:fold-left, but it returns a list of successive reduced values from the left. It is equivalent to:
  declare function hof:scan-left ( $ seq , $ acc , $ f ) { if ( empty ( $ seq )) then $ acc else ( $ acc , hof:scan-left ( tail ( $ seq ), $ f ( $ acc , head ( $ seq )), $ f ) ) }; 
- : - : @param $seq value of type item()* - : @param $start value of type item()* - : @param $f value of type function(item()* - : @param item() value of type - : @return value of type item()* - :) -declare function hof:scan-left($seq as item()*, $start as item()*, $f as function(item()*, item()) as item()*) as item()* external; - -(:~ - : The function returns items of $seq as long as the predicate $pred is satisfied. It is equivalent to:
  declare function hof:take-while ( $ seq , $ pred ) { if ( empty ( $ seq ) or not ( $ pred ( head( $ seq )))) then () else ( head ( $ seq ), hof:take-while ( tail ( $ seq ), $ pred ) ) }; 
- : - : @param $seq value of type item()* - : @param $pred value of type function(item() - : @return value of type item()* - :) -declare function hof:take-while($seq as item()*, $pred as function(item()) as xs:boolean) as item()* external; - -(:~ - : The function skips all items of $seq until the predicate $pred is not satisfied anymore. It is equivalent to:
  declare function hof:drop-while ( $ seq , $ pred ) { if ( $ pred ( head( $ seq ))) then ( hof:drop-while ( tail ( $ seq ), $ pred ) ) else ( $ seq ) }; 
- : - : @param $seq value of type item()* - : @param $pred value of type function(item() - : @return value of type item()* - :) -declare function hof:drop-while($seq as item()*, $pred as function(item()) as xs:boolean) as item()* external; - -(:~ - : Returns the $k items in $seq that are greatest when sorted by the result of $f applied to the item. The function is a much more efficient implementation of the following scheme:
  ( for $ x in $ seq order by $ sort-key ( $ x ) descending return $ x )[ position () <= $ k ] 
- : - : @param $seq value of type item()* - : @param $sort-key value of type function(item() - : @return value of type item()* - :) -declare function hof:top-k-by($seq as item()*, $sort-key as function(item()) as item(), $k as xs:integer) as item()* external; - -(:~ - : Returns the $k items in $seq that are greatest when sorted in the order of the less-than predicate $lt. The function is a general version of hof:top-k-by($seq, $sort-key, $k). - : - : @param $seq value of type item()* - : @param $lt value of type function(item() - : @param item() value of type - : @return value of type item()* - :) -declare function hof:top-k-with($seq as item()*, $lt as function(item(), item()) as xs:boolean, $k as xs:integer) as item()* external; - -(:~ - : Returns its argument unchanged. This function isn’t useful on its own, but can be used as argument to other higher-order functions. - : - : @param $expr value of type item()* - : @return value of type item()* - :) -declare function hof:id($expr as item()*) as item()* external; - -(:~ - : Returns its first argument unchanged and ignores the second. This function isn’t useful on its own, but can be used as argument to other higher-order functions, e.g. when a function combining two values is expected and one only wants to retain the left one. - : - : @param $expr value of type item()* - : @param $ignored value of type item()* - : @return value of type item()* - :) -declare function hof:const($expr as item()*, $ignored as item()*) as item()* external; diff --git a/packages.src/basex-10.0/html.xqm b/packages.src/basex-10.0/html.xqm deleted file mode 100644 index aaef964..0000000 --- a/packages.src/basex-10.0/html.xqm +++ /dev/null @@ -1,52 +0,0 @@ -(:~ - : This XQuery Module provides functions for converting HTML to XML. Conversion will only take place if TagSoup is included in the classpath (see HTML Parsing for more details). - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/HTML_Module - :) -module namespace html = "http://basex.org/modules/html"; - -(:~ - : Fetches the HTML document referred to by the given $uri, converts it to XML and returns a document node. The $options argument can be used to set TagSoup Options. - : - : @param $uri value of type xs:string? - : @return value of type document-node()? - : @error html:parse the input cannot be converted to XML. - :) -declare function html:doc($uri as xs:string?) as document-node()? external; - -(:~ - : Fetches the HTML document referred to by the given $uri, converts it to XML and returns a document node. The $options argument can be used to set TagSoup Options. - : - : @param $uri value of type xs:string? - : @param $options value of type map(*)? - : @return value of type document-node()? - : @error html:parse the input cannot be converted to XML. - :) -declare function html:doc($uri as xs:string?, $options as map(*)?) as document-node()? external; - -(:~ - : Converts the HTML document specified by $input to XML and returns a document node:
  • The input may be of type xs:string, xs:base64Binary, or xs:hexBinary.
  • If the input is passed on in its binary representation, the HTML parser will try to choose the correct encoding automatically.

The $options argument can be used to set TagSoup Options.

- : - : @param $input value of type xs:anyAtomicType - : @return value of type document-node() - : @error html:parse the input cannot be converted to XML. - :) -declare function html:parse($input as xs:anyAtomicType) as document-node() external; - -(:~ - : Converts the HTML document specified by $input to XML and returns a document node:
  • The input may be of type xs:string, xs:base64Binary, or xs:hexBinary.
  • If the input is passed on in its binary representation, the HTML parser will try to choose the correct encoding automatically.

The $options argument can be used to set TagSoup Options.

- : - : @param $input value of type xs:anyAtomicType - : @param $options value of type map(*)? - : @return value of type document-node() - : @error html:parse the input cannot be converted to XML. - :) -declare function html:parse($input as xs:anyAtomicType, $options as map(*)?) as document-node() external; - -(:~ - : Returns the name of the applied HTML parser (currently: TagSoup). If an empty string is returned, TagSoup was not found in the classpath, and the input will be treated as well-formed XML.
- : - : @return value of type xs:string - :) -declare function html:parser() as xs:string external; diff --git a/packages.src/basex-10.0/http.xqm b/packages.src/basex-10.0/http.xqm deleted file mode 100644 index e36cbd1..0000000 --- a/packages.src/basex-10.0/http.xqm +++ /dev/null @@ -1,53 +0,0 @@ -(:~ - : This XQuery Module contains a single function to send HTTP requests and handle HTTP responses. The function send-request is based on the EXPath HTTP Client Module. It gives full control over the available request and response parameters. For simple GET requests, the Fetch Module may be sufficient. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/HTTP_Client_Module - :) -module namespace http = "http://expath.org/ns/http-client"; -declare namespace experr = "http://expath.org/ns/error"; - -(:~ - : Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.
  • Certificate verification can be globally disabled via the IGNORECERT option.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
- : - : @param $request value of type element(http:request) - : @return value of type item()+ - : @error experr:HC0001 an HTTP error occurred. - : @error experr:HC0002 error parsing the entity content as XML or HTML. - : @error experr:HC0003 with a multipart response, the override-media-type must be either a multipart media type or application/octet-stream. - : @error experr:HC0004 the src attribute on the body element is mutually exclusive with all other attribute (except the media-type). - : @error experr:HC0005 the request element is not valid. - : @error experr:HC0006 a timeout occurred waiting for the response. - :) -declare function http:send-request($request as element(http:request)) as item()+ external; - -(:~ - : Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.
  • Certificate verification can be globally disabled via the IGNORECERT option.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
- : - : @param $request value of type element(http:request)? - : @param $href value of type xs:string? - : @return value of type item()+ - : @error experr:HC0001 an HTTP error occurred. - : @error experr:HC0002 error parsing the entity content as XML or HTML. - : @error experr:HC0003 with a multipart response, the override-media-type must be either a multipart media type or application/octet-stream. - : @error experr:HC0004 the src attribute on the body element is mutually exclusive with all other attribute (except the media-type). - : @error experr:HC0005 the request element is not valid. - : @error experr:HC0006 a timeout occurred waiting for the response. - :) -declare function http:send-request($request as element(http:request)?, $href as xs:string?) as item()+ external; - -(:~ - : Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.
  • Certificate verification can be globally disabled via the IGNORECERT option.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
- : - : @param $request value of type element(http:request)? - : @param $href value of type xs:string? - : @param $bodies value of type item()* - : @return value of type item()+ - : @error experr:HC0001 an HTTP error occurred. - : @error experr:HC0002 error parsing the entity content as XML or HTML. - : @error experr:HC0003 with a multipart response, the override-media-type must be either a multipart media type or application/octet-stream. - : @error experr:HC0004 the src attribute on the body element is mutually exclusive with all other attribute (except the media-type). - : @error experr:HC0005 the request element is not valid. - : @error experr:HC0006 a timeout occurred waiting for the response. - :) -declare function http:send-request($request as element(http:request)?, $href as xs:string?, $bodies as item()*) as item()+ external; diff --git a/packages.src/basex-10.0/index.xqm b/packages.src/basex-10.0/index.xqm deleted file mode 100644 index d030d39..0000000 --- a/packages.src/basex-10.0/index.xqm +++ /dev/null @@ -1,120 +0,0 @@ -(:~ - : This XQuery Module provides functions for displaying information stored in the database index structures. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Index_Module - :) -module namespace index = "http://basex.org/modules/index"; - -(:~ - : Returns information about all facets and facet values of the database $db in document structure format.
If $type is specified as flat, the function returns this information in a flat summarized version. The returned data is derived from the Path Index. - : - : @param $db value of type xs:string - : @return value of type xs:string - : @error db:get The addressed database does not exist or could not be opened. - :) -declare function index:facets($db as xs:string) as xs:string external; - -(:~ - : Returns information about all facets and facet values of the database $db in document structure format.
If $type is specified as flat, the function returns this information in a flat summarized version. The returned data is derived from the Path Index. - : - : @param $db value of type xs:string - : @param $type value of type xs:string - : @return value of type xs:string - : @error db:get The addressed database does not exist or could not be opened. - :) -declare function index:facets($db as xs:string, $type as xs:string) as xs:string external; - -(:~ - : Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:get The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:texts($db as xs:string) as element(value)* external; - -(:~ - : Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @param $prefix value of type xs:string - : @return value of type element(value)* - : @error db:get The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:texts($db as xs:string, $prefix as xs:string) as element(value)* external; - -(:~ - : Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @param $start value of type xs:string - : @param $ascending value of type xs:boolean - : @return value of type element(value)* - : @error db:get The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:texts($db as xs:string, $start as xs:string, $ascending as xs:boolean) as element(value)* external; - -(:~ - : Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:get The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:attributes($db as xs:string) as element(value)* external; - -(:~ - : Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @param $prefix value of type xs:string - : @return value of type element(value)* - : @error db:get The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:attributes($db as xs:string, $prefix as xs:string) as element(value)* external; - -(:~ - : Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @param $start value of type xs:string - : @param $ascending value of type xs:boolean - : @return value of type element(value)* - : @error db:get The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:attributes($db as xs:string, $start as xs:string, $ascending as xs:boolean) as element(value)* external; - -(:~ - : Returns all strings stored in the Token Index of the database $db, along with their number of occurrences. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:get The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:tokens($db as xs:string) as element(value)* external; - -(:~ - : Returns all element names stored in the Name Index of the database $db, along with their number of occurrences. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:get The addressed database does not exist or could not be opened. - :) -declare function index:element-names($db as xs:string) as element(value)* external; - -(:~ - : Returns all attribute names stored in the Name Index of the database $db, along with their number of occurrences. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:get The addressed database does not exist or could not be opened. - :) -declare function index:attribute-names($db as xs:string) as element(value)* external; diff --git a/packages.src/basex-10.0/inspect.xqm b/packages.src/basex-10.0/inspect.xqm deleted file mode 100644 index 2950f63..0000000 --- a/packages.src/basex-10.0/inspect.xqm +++ /dev/null @@ -1,93 +0,0 @@ -(:~ - : This XQuery Module contains functions for extracting internal information about modules and functions and generating documentation. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Inspection_Module - :) -module namespace inspect = "http://basex.org/modules/inspect"; -declare namespace xqdoc = "http://www.xqdoc.org/1.0"; - -(:~ - : Returns function items for all user-defined functions (both public and private) that are known in the current query context. If a $uri is specified, the specified resource will be retrieved as string and compiled, and its functions will be added to the query context and returned to the user. A relative URI will be resolved against the static base URI of the query. - : - : @return value of type function(*)* - : @error inspect:parse Error while parsing a module. - :) -declare function inspect:functions() as function(*)* external; - -(:~ - : Returns function items for all user-defined functions (both public and private) that are known in the current query context. If a $uri is specified, the specified resource will be retrieved as string and compiled, and its functions will be added to the query context and returned to the user. A relative URI will be resolved against the static base URI of the query. - : - : @param $uri value of type xs:string - : @return value of type function(*)* - : @error inspect:parse Error while parsing a module. - :) -declare function inspect:functions($uri as xs:string) as function(*)* external; - -(:~ - : Returns the annotations of the specified $function in a map. - : - : @param $function value of type function(*)? - : @return value of type map(xs:QName, xs:anyAtomicType*) - :) -declare function inspect:function-annotations($function as function(*)?) as map(xs:QName, xs:anyAtomicType*) external; - -(:~ - : Returns a component of the static context of a $function with the specified $name. If no function is supplied, the current static context is considered.
The following components can be requested:
  • base-uri: Static base URI.
  • namespaces: Prefix/URI map with all statically known namespaces.
  • element-namespace: Default element/type namespace URI, or an empty sequence if it is absent.
  • function-namespace: Default function namespace URI, or an empty sequence if it is absent.
  • collation: URI of the default collation.
  • ordering: Ordering mode (ordered/unordered)
  • construction: Construction mode (preserve/strip)
  • default-order-empty: Default order for empty sequences (greatest/least)
  • boundary-space: Boundary-space policy (preserve/strip)
  • copy-namespaces: Copy-namespaces mode (inherit/no-inherit, preserve/no-preserve)
  • decimal-formats: Nested map with all statically known decimal formats
- : - : @param $function value of type function(*)? - : @param $name value of type xs:string - : @return value of type item()* - : @error inspect:unknown The specified component does not exist. - :) -declare function inspect:static-context($function as function(*)?, $name as xs:string) as item()* external; - -(:~ - : Returns a string representation of the type of a $value:
  • The string includes the occurrence indicator.
  • The type of functions and nodes may be stricter than the returned type.
  • For type checking, the standard expressions typeswitch and instance of should be used instead.

The following $options are available:

  • item: If enabled, only the item type is returned and the occurrence indicator is omitted. The default is false().
  • mode: If value is specified, the assigned type of the result value is returned. With expression the type of the input expression is returned (please note that the original expression may already have been rewritten at compile-time). With computed, the exact value is computed at runtime, based on the expression and the result value. The default is computed.
- : - : @param $value value of type item()* - : @return value of type xs:string - :) -declare function inspect:type($value as item()*) as xs:string external; - -(:~ - : Returns a string representation of the type of a $value:
  • The string includes the occurrence indicator.
  • The type of functions and nodes may be stricter than the returned type.
  • For type checking, the standard expressions typeswitch and instance of should be used instead.

The following $options are available:

  • item: If enabled, only the item type is returned and the occurrence indicator is omitted. The default is false().
  • mode: If value is specified, the assigned type of the result value is returned. With expression the type of the input expression is returned (please note that the original expression may already have been rewritten at compile-time). With computed, the exact value is computed at runtime, based on the expression and the result value. The default is computed.
- : - : @param $value value of type item()* - : @param $options value of type map(*) - : @return value of type xs:string - :) -declare function inspect:type($value as item()*, $options as map(*)) as xs:string external; - -(:~ - : Inspects the specified $function and returns an element that describes its structure. The output of this function is similar to eXist-db’s inspect:inspect-function function. - : - : @param $function value of type function(*) - : @return value of type element(function) - :) -declare function inspect:function($function as function(*)) as element(function) external; - -(:~ - : Generates an element that describes all variables and functions in the current query context. - : - : @return value of type element(context) - :) -declare function inspect:context() as element(context) external; - -(:~ - : Retrieves the resource located at the specified $uri, parses it as XQuery module, and generates an element that describes the module's structure. A relative URI will be resolved against the static base URI of the query. - : - : @param $uri value of type xs:string - : @return value of type element(module) - : @error inspect:parse Error while parsing a module. - :) -declare function inspect:module($uri as xs:string) as element(module) external; - -(:~ - : Retrieves the resource located at the specified $uri, parses it as XQuery module, and generates an xqDoc element. A relative URI will be resolved against the static base URI of the query.
xqDoc provides a simple vendor-neutral solution for generating documentation from XQuery modules. The documentation conventions have been inspired by the JavaDoc standard. Documentation comments begin with (:~ and end with :), and tags start with @. xqDoc comments can be specified for main and library modules and variable and function declarations.

We have slightly extended the xqDoc conventions to do justice to more recent versions of XQuery (Schema: xqdoc-1.1.30052013.xsd):

  • an <xqdoc:annotations/> node is added to each variable or function that uses annotations. The xqdoc:annotation child nodes may have additional xqdoc:literal elements with type attributes (xs:string, xs:integer, xs:decimal, xs:double) and values.
  • a single <xqdoc:namespaces/> node is added to the root element, which summarizes all prefixes and namespace URIs used or declared in the module.
  • name and type elements are added to variables.
- : - : @param $uri value of type xs:string - : @return value of type element(xqdoc:xqdoc) - : @error inspect:parse Error while parsing a module. - :) -declare function inspect:xqdoc($uri as xs:string) as element(xqdoc:xqdoc) external; diff --git a/packages.src/basex-10.0/job.xqm b/packages.src/basex-10.0/job.xqm deleted file mode 100644 index 319d064..0000000 --- a/packages.src/basex-10.0/job.xqm +++ /dev/null @@ -1,139 +0,0 @@ -(:~ - : Updated with Version 10: Renamed from Jobs Module to Job Module. The namespace URI has been updated as well. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Job_Module - :) -module namespace job = "http://basex.org/modules/job"; - -(:~ - : Schedules the evaluation of the supplied $query (xs:string, or of type xs:anyURI, pointing to a resource), and returns a query ID. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and the context value can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via job:result , or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time, dateTime or integer can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples of valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
    • If a time is specified, the query will be executed at this time of the day. Examples of valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • An integer will be interpreted as minutes. If the specified number is greater than the elapsed minutes of the current hour, the query will be executed one hour later.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same ID is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job ID. The ID must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service. Registered services must have no variable bindings.
  • log: writes the specified string to the database logs. Two log entries are stored, one at the beginning and another one after the execution of the job.
- : - : @param $query value of type xs:anyAtomicType - : @return value of type xs:string - : @error job:overflow Query execution is rejected because too many jobs are queued or being executed. CACHETIMEOUT can be decreased if the default setting is too restrictive. - : @error job:range A specified time or duration is out of range. - : @error job:id The specified ID is invalid or has already been assigned. - : @error job:options The specified options are conflicting. - :) -declare function job:eval($query as xs:anyAtomicType) as xs:string external; - -(:~ - : Schedules the evaluation of the supplied $query (xs:string, or of type xs:anyURI, pointing to a resource), and returns a query ID. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and the context value can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via job:result , or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time, dateTime or integer can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples of valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
    • If a time is specified, the query will be executed at this time of the day. Examples of valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • An integer will be interpreted as minutes. If the specified number is greater than the elapsed minutes of the current hour, the query will be executed one hour later.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same ID is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job ID. The ID must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service. Registered services must have no variable bindings.
  • log: writes the specified string to the database logs. Two log entries are stored, one at the beginning and another one after the execution of the job.
- : - : @param $query value of type xs:anyAtomicType - : @param $bindings value of type map(*)? - : @return value of type xs:string - : @error job:overflow Query execution is rejected because too many jobs are queued or being executed. CACHETIMEOUT can be decreased if the default setting is too restrictive. - : @error job:range A specified time or duration is out of range. - : @error job:id The specified ID is invalid or has already been assigned. - : @error job:options The specified options are conflicting. - :) -declare function job:eval($query as xs:anyAtomicType, $bindings as map(*)?) as xs:string external; - -(:~ - : Schedules the evaluation of the supplied $query (xs:string, or of type xs:anyURI, pointing to a resource), and returns a query ID. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and the context value can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via job:result , or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time, dateTime or integer can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples of valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
    • If a time is specified, the query will be executed at this time of the day. Examples of valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • An integer will be interpreted as minutes. If the specified number is greater than the elapsed minutes of the current hour, the query will be executed one hour later.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same ID is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job ID. The ID must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service. Registered services must have no variable bindings.
  • log: writes the specified string to the database logs. Two log entries are stored, one at the beginning and another one after the execution of the job.
- : - : @param $query value of type xs:anyAtomicType - : @param $bindings value of type map(*)? - : @param $options value of type map(*)? - : @return value of type xs:string - : @error job:overflow Query execution is rejected because too many jobs are queued or being executed. CACHETIMEOUT can be decreased if the default setting is too restrictive. - : @error job:range A specified time or duration is out of range. - : @error job:id The specified ID is invalid or has already been assigned. - : @error job:options The specified options are conflicting. - :) -declare function job:eval($query as xs:anyAtomicType, $bindings as map(*)?, $options as map(*)?) as xs:string external; - -(:~ - : Returns the cached result of a job with the specified job $id:
  • If the original job has raised an error, the cached error will be raised instead.
  • The cached result or error will be dropped after it has been retrieved.
  • If the result has not been cached or if it has been dropped, an empty sequence is returned.

The following $options can be supplied:

  • keep: Keep the cached result or error after retrieval.
- : - : @param $id value of type xs:string - : @return value of type item()* - :) -declare function job:result($id as xs:string) as item()* external; - -(:~ - : Returns the cached result of a job with the specified job $id:
  • If the original job has raised an error, the cached error will be raised instead.
  • The cached result or error will be dropped after it has been retrieved.
  • If the result has not been cached or if it has been dropped, an empty sequence is returned.

The following $options can be supplied:

  • keep: Keep the cached result or error after retrieval.
- : - : @param $id value of type xs:string - : @param $options value of type map(*) - : @return value of type item()* - :) -declare function job:result($id as xs:string, $options as map(*)) as item()* external; - -(:~ - : Triggers the cancelation of a job with the specified $id, cancels a scheduled job or removes a cached result. Unknown IDs are ignored. All jobs are gracefully stopped; it is up to the process to decide when it is safe to shut down. The following $options can be supplied:
  • service: additionally removes the job from the job services list.
- : - : @param $id value of type xs:string - :) -declare function job:remove($id as xs:string) as empty-sequence() external; - -(:~ - : Triggers the cancelation of a job with the specified $id, cancels a scheduled job or removes a cached result. Unknown IDs are ignored. All jobs are gracefully stopped; it is up to the process to decide when it is safe to shut down. The following $options can be supplied:
  • service: additionally removes the job from the job services list.
- : - : @param $id value of type xs:string - : @param $options value of type map(*)? - :) -declare function job:remove($id as xs:string, $options as map(*)?) as empty-sequence() external; - -(:~ - : Waits for the completion of a job with the specified $id:
  • The function will terminate immediately if the job ID is unknown. This is the case if a future job has not been queued yet, or if the ID has already been discarded after job evaluation.
  • If the function is called with the ID of a queued job, or repeatedly executed job, it may stall and never terminate.
- : - : @param $id value of type xs:string - : @error job:self The current job is addressed. - :) -declare function job:wait($id as xs:string) as empty-sequence() external; - -(:~ - : Returns the ID of the current job. - : - : @return value of type xs:string - :) -declare function job:current() as xs:string external; - -(:~ - : Returns the IDs of all jobs that are currently registered. The list includes scheduled, queued, running, stopped, and finished jobs with cached results. - : - : @return value of type xs:string* - :) -declare function job:list() as xs:string* external; - -(:~ - : Returns information on all jobs that are currently registered, or on a job with the specified $id (or an empty sequence if this job is not found). The list includes scheduled, queued, running jobs, and cached jobs. A string representation of the job, or its URI, will be returned as a value. The returned elements have additional attributes:
  • id: job ID
  • type: type of the job (command, query, REST, RESTXQ, etc.)
  • state: current state of the job: scheduled, queued, running, cached
  • user: user who started the job
  • duration: evaluation time (included if a job is running or if the result was cached)
  • start: next start of job (included if a job will be executed repeatedly)
  • time: time when job was registered
- : - : @return value of type element(job)* - :) -declare function job:list-details() as element(job)* external; - -(:~ - : Returns information on all jobs that are currently registered, or on a job with the specified $id (or an empty sequence if this job is not found). The list includes scheduled, queued, running jobs, and cached jobs. A string representation of the job, or its URI, will be returned as a value. The returned elements have additional attributes:
  • id: job ID
  • type: type of the job (command, query, REST, RESTXQ, etc.)
  • state: current state of the job: scheduled, queued, running, cached
  • user: user who started the job
  • duration: evaluation time (included if a job is running or if the result was cached)
  • start: next start of job (included if a job will be executed repeatedly)
  • time: time when job was registered
- : - : @param $id value of type xs:string - : @return value of type element(job)* - :) -declare function job:list-details($id as xs:string) as element(job)* external; - -(:~ - : Returns the variable bindings of an existing job with the specified $id. If no variables have been bound to this job, an empty map is returned. - : - : @param $id value of type xs:string - : @return value of type map(*) - :) -declare function job:bindings($id as xs:string) as map(*) external; - -(:~ - : Indicates if the evaluation of an already running job with the specified $id has finished. As the IDs of finished jobs will usually be discarded, unless caching is enabled, the function will also return true for unknown jobs.
  • false indicates that the job ID is scheduled, queued, or currently running.
  • true will be returned if the job has either finished, or if the ID is unknown (because the IDs of all finished jobs will not be cached).
- : - : @param $id value of type xs:string - : @return value of type xs:boolean - :) -declare function job:finished($id as xs:string) as xs:boolean external; - -(:~ - : Returns a list of all jobs that have been persistently registered as Services. - : - : @return value of type element(job)* - : @error job:services Registered services cannot be parsed. - :) -declare function job:services() as element(job)* external; diff --git a/packages.src/basex-10.0/json.xqm b/packages.src/basex-10.0/json.xqm deleted file mode 100644 index 3667fd9..0000000 --- a/packages.src/basex-10.0/json.xqm +++ /dev/null @@ -1,68 +0,0 @@ -(:~ - : This XQuery Module contains functions to parse and serialize JSON data JSON (JavaScript Object Notation) is a popular data exchange format for applications written in JavaScript. As there are notable differences between JSON and XML, or XQuery data types, no mapping exists that guarantees a lossless, bidirectional conversion between JSON and XML. For this reason, we offer various mappings, all of which are suited to different use cases. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/JSON_Module - :) -module namespace json = "http://basex.org/modules/json"; - -(:~ - : Fetches the JSON document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted. - : - : @param $uri value of type xs:string - : @return value of type item()? - : @error json:parse the specified input cannot be parsed as JSON document. - : @error json:options the specified options are conflicting. - :) -declare function json:doc($uri as xs:string) as item()? external; - -(:~ - : Fetches the JSON document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted. - : - : @param $uri value of type xs:string - : @param $options value of type map(*)? - : @return value of type item()? - : @error json:parse the specified input cannot be parsed as JSON document. - : @error json:options the specified options are conflicting. - :) -declare function json:doc($uri as xs:string, $options as map(*)?) as item()? external; - -(:~ - : Converts the JSON $string to an XQuery value. If the input can be successfully parsed, it can be serialized back to the original JSON representation. The $options argument can be used to control the way the input is converted. - : - : @param $string value of type xs:string? - : @return value of type item()? - : @error json:parse the specified input cannot be parsed as JSON document. - : @error json:options the specified options are conflicting. - :) -declare function json:parse($string as xs:string?) as item()? external; - -(:~ - : Converts the JSON $string to an XQuery value. If the input can be successfully parsed, it can be serialized back to the original JSON representation. The $options argument can be used to control the way the input is converted. - : - : @param $string value of type xs:string? - : @param $options value of type map(*)? - : @return value of type item()? - : @error json:parse the specified input cannot be parsed as JSON document. - : @error json:options the specified options are conflicting. - :) -declare function json:parse($string as xs:string?, $options as map(*)?) as item()? external; - -(:~ - : Serializes the specified $input as JSON, using the specified $options, and returns the result as string:
  • The input is expected to conform to the results that are created by json:parse .
  • Non-conforming items will be serialized as specified in the json output method of the official recommendation.

Values can also be serialized as JSON with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to json, and
  • the options presented in this article need to be assigned to the json parameter.
- : - : @param $input value of type item()? - : @return value of type xs:string - : @error json:serialize the specified node cannot be serialized as JSON document. - :) -declare function json:serialize($input as item()?) as xs:string external; - -(:~ - : Serializes the specified $input as JSON, using the specified $options, and returns the result as string:
  • The input is expected to conform to the results that are created by json:parse .
  • Non-conforming items will be serialized as specified in the json output method of the official recommendation.

Values can also be serialized as JSON with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to json, and
  • the options presented in this article need to be assigned to the json parameter.
- : - : @param $input value of type item()? - : @param $options value of type map(*)? - : @return value of type xs:string - : @error json:serialize the specified node cannot be serialized as JSON document. - :) -declare function json:serialize($input as item()?, $options as map(*)?) as xs:string external; diff --git a/packages.src/basex-10.0/lazy.xqm b/packages.src/basex-10.0/lazy.xqm deleted file mode 100644 index cfb5b71..0000000 --- a/packages.src/basex-10.0/lazy.xqm +++ /dev/null @@ -1,40 +0,0 @@ -(:~ - : This XQuery Module contains functions for handling lazy items. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Lazy_Module - :) -module namespace lazy = "http://basex.org/modules/lazy"; - -(:~ - : Caches the data of lazy $items in a sequence:
  • data of lazy items will be retrieved and cached inside the item.
  • non-lazy items, or lazy items with cached data, will simply be passed through.
  • If $lazy is set to true(), caching will be deferred until the data is eventually requested. Streaming will be disabled: Data will always be cached before a stream is returned.

Caching is advisable if an item will be processed more than once, or if the data may not be available anymore at a later stage.

- : - : @param $items value of type item()* - : @return value of type item()* - :) -declare function lazy:cache($items as item()*) as item()* external; - -(:~ - : Caches the data of lazy $items in a sequence:
  • data of lazy items will be retrieved and cached inside the item.
  • non-lazy items, or lazy items with cached data, will simply be passed through.
  • If $lazy is set to true(), caching will be deferred until the data is eventually requested. Streaming will be disabled: Data will always be cached before a stream is returned.

Caching is advisable if an item will be processed more than once, or if the data may not be available anymore at a later stage.

- : - : @param $items value of type item()* - : @param $lazy value of type xs:boolean - : @return value of type item()* - :) -declare function lazy:cache($items as item()*, $lazy as xs:boolean) as item()* external; - -(:~ - : Checks whether the specified $item is lazy. - : - : @param $item value of type item() - : @return value of type xs:boolean - :) -declare function lazy:is-lazy($item as item()) as xs:boolean external; - -(:~ - : Checks whether the contents of the specified $item are cached. The function will always return true for non-lazy items. - : - : @param $item value of type item() - : @return value of type xs:boolean - :) -declare function lazy:is-cached($item as item()) as xs:boolean external; diff --git a/packages.src/basex-10.0/map.xqm b/packages.src/basex-10.0/map.xqm deleted file mode 100644 index aff6f07..0000000 --- a/packages.src/basex-10.0/map.xqm +++ /dev/null @@ -1,105 +0,0 @@ -(:~ - : This XQuery Module contains functions for manipulating maps. Maps have been introduced with XQuery 3.1. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Map_Module - :) -module namespace map = "http://www.w3.org/2005/xpath-functions/map"; - -(:~ - : Returns true if the supplied $map contains an entry with a key equal to the supplied value of $key; otherwise it returns false. No error is raised if the map contains keys that are not comparable with the supplied $key.

If the supplied key is xs:untypedAtomic, it is compared as an instance of xs:string. If the supplied key is the xs:float or xs:double value NaN, the function returns true if there is an entry whose key is NaN, or false otherwise.

- : - : @param $map value of type map(*) - : @param $key value of type xs:anyAtomicType - : @return value of type xs:boolean - :) -declare function map:contains($map as map(*), $key as xs:anyAtomicType) as xs:boolean external; - -(:~ - : Creates a new map containing a single entry. The key of the entry in the new map is $key, and its associated value is $value.

The function map:entry is intended primarily for use in conjunction with the function map:merge . For example, a map containing seven entries may be constructed like this:

  map:merge (( map:entry ( "Sun" , "Sunday" ), map:entry ( "Mon" , "Monday" ), map:entry ( "Tue" , "Tuesday" ), map:entry ( "Wed" , "Wednesday" ), map:entry ( "Thu" , "Thursday" ), map:entry ( "Fri" , "Friday" ), map:entry ( "Sat" , "Saturday" ) )) 

Unlike the map { ... } expression, this technique can be used to construct a map with a variable number of entries, for example:

  map:merge ( for $ b in // book return map:entry ( $ b / isbn , $ b )) 
- : - : @param $key value of type xs:anyAtomicType - : @param $value value of type item()* - : @return value of type map(*) - :) -declare function map:entry($key as xs:anyAtomicType, $value as item()*) as map(*) external; - -(:~ - : Returns all values of maps in the supplied $input with the specified $key. The found values will be returned in an array. Arbitrary input will be processed recursively as follows:
  • In a sequence, each item will be processed in order.
  • In an array, all array members will be processed as sequence.
  • In a map, all entries whose keys match the specified key. Moreover, all values of the map will be processed as sequence.
- : - : @param $input value of type item()* - : @param $key value of type xs:anyAtomicType - : @return value of type array(*) - :) -declare function map:find($input as item()*, $key as xs:anyAtomicType) as array(*) external; - -(:~ - : Applies the specified $function to every key/value pair of the supplied $map and returns the results as a sequence. - : - : @param $map value of type map(*) - : @param $function value of type function(xs:anyAtomicType - : @param item()* value of type - : @return value of type item()* - :) -declare function map:for-each($map as map(*), $function as function(xs:anyAtomicType, item()*) as item()*) as item()* external; - -(:~ - : Returns the value associated with a supplied key in a given map. This function attempts to find an entry within the $map that has a key equal to the supplied value of $key. If there is such an entry, the function returns the associated value; otherwise it returns an empty sequence. No error is raised if the map contains keys that are not comparable with the supplied $key. If the supplied key is xs:untypedAtomic, it is converted to xs:string.

A return value of () from map:get could indicate that the key is present in the map with an associated value of (), or it could indicate that the key is not present in the map. The two cases can be distinguished by calling map:contains. Invoking the map as a function item has the same effect as calling get: that is, when $map is a map, the expression $map($K) is equivalent to get($map, $K). Similarly, the expression get(get(get($map, 'employee'), 'name'), 'first') can be written as $map('employee')('name')('first').

- : - : @param $map value of type map(*) - : @param $key value of type xs:anyAtomicType - : @return value of type item()* - :) -declare function map:get($map as map(*), $key as xs:anyAtomicType) as item()* external; - -(:~ - : Returns a sequence containing all the key values present in a map. The function takes the supplied $map and returns the keys that are present in the map as a sequence of atomic values. The order may differ from the order in which entries were inserted in the map. - : - : @param $map value of type map(*) - : @return value of type xs:anyAtomicType* - :) -declare function map:keys($map as map(*)) as xs:anyAtomicType* external; - -(:~ - : Constructs and returns a new map. The map is formed by combining the contents of the supplied $maps. The maps are combined as follows:
  1. There is one entry in the new map for each distinct key present in the union of the input maps.
  2. The $options argument defines how duplicate keys are handled. Currently, a single option duplicates exists, and its allowed values are use-first, use-last, combine and reject (default: use-first).
- : - : @param $maps value of type map(*)* - : @return value of type map(*) - :) -declare function map:merge($maps as map(*)*) as map(*) external; - -(:~ - : Constructs and returns a new map. The map is formed by combining the contents of the supplied $maps. The maps are combined as follows:
  1. There is one entry in the new map for each distinct key present in the union of the input maps.
  2. The $options argument defines how duplicate keys are handled. Currently, a single option duplicates exists, and its allowed values are use-first, use-last, combine and reject (default: use-first).
- : - : @param $maps value of type map(*)* - : @param $options value of type map(*) - : @return value of type map(*) - :) -declare function map:merge($maps as map(*)*, $options as map(*)) as map(*) external; - -(:~ - : Creates a new map, containing the entries of the supplied $map and a new entry composed by $key and $value. The semantics of this function are equivalent to map:merge((map { $key, $value }, $map)) - : - : @param $map value of type map(*) - : @param $key value of type xs:anyAtomicType - : @param $value value of type item()* - : @return value of type map(*) - :) -declare function map:put($map as map(*), $key as xs:anyAtomicType, $value as item()*) as map(*) external; - -(:~ - : Constructs a new map by removing entries from an existing map. The entries in the new map correspond to the entries of $map, excluding entries supplied via $keys.

No failure occurs if the input map contains no entry with the supplied keys; the input map is returned unchanged.

- : - : @param $map value of type map(*) - : @param $keys value of type xs:anyAtomicType* - : @return value of type map(*) - :) -declare function map:remove($map as map(*), $keys as xs:anyAtomicType*) as map(*) external; - -(:~ - : Returns a the number of entries in the supplied map. The function takes the supplied $map and returns the number of entries that are present in the map. - : - : @param $map value of type map(*) - : @return value of type xs:integer - :) -declare function map:size($map as map(*)) as xs:integer external; diff --git a/packages.src/basex-10.0/math.xqm b/packages.src/basex-10.0/math.xqm deleted file mode 100644 index 4b9e2ea..0000000 --- a/packages.src/basex-10.0/math.xqm +++ /dev/null @@ -1,151 +0,0 @@ -(:~ - : The math XQuery Module defines functions to perform mathematical operations, such as pi, asin and acos. Most functions are specified in the Functions and Operators Specification of the upcoming XQuery 3.0 Recommendation, and some additional ones have been added in this module. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Math_Module - :) -module namespace math = "http://www.w3.org/2005/xpath-functions/math"; - -(:~ - : Returns the xs:double value of the mathematical constant π whose lexical representation is 3.141592653589793. - : - : @return value of type xs:double - :) -declare function math:pi() as xs:double external; - -(:~ - : Returns the square root of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the xs:double value of the mathematical square root of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:sqrt($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the sine of the $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the sine of $arg, treated as an angle in radians. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:sin($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the cosine of $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the cosine of $arg, treated as an angle in radians. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:cos($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the tangent of $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the tangent of $arg, treated as an angle in radians. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:tan($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the arc sine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc sine of $arg, returned as an angle in radians in the range -Ï€/2 to +Ï€/2. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:asin($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the arc cosine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc cosine of $arg, returned as an angle in radians in the range 0 to +Ï€. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:acos($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the arc tangent of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc tangent of $arg, returned as an angle in radians in the range -Ï€/2 to +Ï€/2. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:atan($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the arc tangent of $arg1 divided by $arg2, the result being in the range -Ï€/2 to +Ï€/2 radians.
If $arg1 is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc tangent of $arg1 divided by $arg2, returned as an angle in radians in the range -Ï€ to +Ï€. - : - : @param $arg1 value of type xs:double? - : @param $arg2 value of type xs:double - : @return value of type xs:double? - :) -declare function math:atan2($arg1 as xs:double?, $arg2 as xs:double) as xs:double? external; - -(:~ - : Returns $arg1 raised to the power of $arg2.
If $arg1 is the empty sequence, the empty sequence is returned.
Otherwise the result is the $arg1 raised to the power of $arg2. - : - : @param $arg1 value of type xs:double? - : @param $arg2 value of type xs:double - : @return value of type xs:double? - :) -declare function math:pow($arg1 as xs:double?, $arg2 as xs:double) as xs:double? external; - -(:~ - : Returns e raised to the power of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the value of e raised to the power of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:exp($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the natural logarithm of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the natural logarithm (base e) of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:log($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the base 10 logarithm of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the base 10 logarithm of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:log10($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the xs:double value of the mathematical constant e whose lexical representation is 2.718281828459045. - : - : @return value of type xs:double - :) -declare function math:e() as xs:double external; - -(:~ - : Returns the hyperbolic sine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic sine of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:sinh($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the hyperbolic cosine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic cosine of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:cosh($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the hyperbolic tangent of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic tangent of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:tanh($arg as xs:double?) as xs:double? external; - -(:~ - : Calculates the CRC32 check sum of the given $string.
If an empty sequence is supplied, the empty sequence is returned. - : - : @param $string value of type xs:string? - : @return value of type xs:hexBinary? - :) -declare function math:crc32($string as xs:string?) as xs:hexBinary? external; diff --git a/packages.src/basex-10.0/proc.xqm b/packages.src/basex-10.0/proc.xqm deleted file mode 100644 index 53321e8..0000000 --- a/packages.src/basex-10.0/proc.xqm +++ /dev/null @@ -1,127 +0,0 @@ -(:~ - : This XQuery Module provides functions for executing system commands from XQuery. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Process_Module - :) -module namespace proc = "http://basex.org/modules/proc"; - -(:~ - : Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
- : - : @param $cmd value of type xs:string - : @return value of type xs:string - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - : @error proc:error the command could not be executed, or an I/O exception was raised. - : @error proc:code.... If the commands returns an exit code different to 0, an error will be raised. Its code will consist of the letters code and four digits with the exit code. - :) -declare function proc:system($cmd as xs:string) as xs:string external; - -(:~ - : Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
- : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @return value of type xs:string - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - : @error proc:error the command could not be executed, or an I/O exception was raised. - : @error proc:code.... If the commands returns an exit code different to 0, an error will be raised. Its code will consist of the letters code and four digits with the exit code. - :) -declare function proc:system($cmd as xs:string, $args as xs:string*) as xs:string external; - -(:~ - : Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
- : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @param $options value of type map(xs:string - : @param xs:string) value of type - : @return value of type xs:string - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - : @error proc:error the command could not be executed, or an I/O exception was raised. - : @error proc:code.... If the commands returns an exit code different to 0, an error will be raised. Its code will consist of the letters code and four digits with the exit code. - :) -declare function proc:system($cmd as xs:string, $args as xs:string*, $options as map(xs:string, xs:string)) as xs:string external; - -(:~ - : Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system .
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

  <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
- : - : @param $cmd value of type xs:string - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - :) -declare function proc:execute($cmd as xs:string) as element(result) external; - -(:~ - : Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system .
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

  <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
- : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - :) -declare function proc:execute($cmd as xs:string, $args as xs:string*) as element(result) external; - -(:~ - : Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system .
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

  <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
- : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @param $options value of type map(xs:string - : @param xs:string) value of type - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - :) -declare function proc:execute($cmd as xs:string, $args as xs:string*, $options as map(xs:string, xs:string)) as element(result) external; - -(:~ - : Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored). - : - : @param $cmd value of type xs:string - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - :) -declare function proc:fork($cmd as xs:string) as element(result) external; - -(:~ - : Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored). - : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - :) -declare function proc:fork($cmd as xs:string, $args as xs:string*) as element(result) external; - -(:~ - : Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored). - : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @param $options value of type map(xs:string - : @param xs:string) value of type - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - :) -declare function proc:fork($cmd as xs:string, $args as xs:string*, $options as map(xs:string, xs:string)) as element(result) external; - -(:~ - : Returns the system property, specified by $name, or a context parameter of the web.xml file with that name (see Web Applications). An empty sequence is returned if the property does not exist. For environment variables of the operating system, please use fn:environment-variable. - : - : @param $name value of type xs:string - : @return value of type xs:string? - :) -declare function proc:property($name as xs:string) as xs:string? external; - -(:~ - : Returns the names of all Java system properties and context parameters of the web.xml file (see Web Applications). For environment variables of the operating system, please use fn:available-environment-variables. - : - : @return value of type xs:string* - :) -declare function proc:property-names() as xs:string* external; diff --git a/packages.src/basex-10.0/prof.xqm b/packages.src/basex-10.0/prof.xqm deleted file mode 100644 index 4d2066b..0000000 --- a/packages.src/basex-10.0/prof.xqm +++ /dev/null @@ -1,142 +0,0 @@ -(:~ - : This XQuery Module contains various functions to test and profile code, and to dump information to standard output. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Profiling_Module - :) -module namespace prof = "http://basex.org/modules/prof"; - -(:~ - : Measures the execution time and memory consumption required for evaluating the specified $expression and returns a map with the results. The following $options are available:
  • time: Include execution time in result as xs:decimal (unit: milliseconds; default: true).
  • memory: Include memory consumption in result as xs:integer (unit: bytes; default: false).
  • value: Include value in result (default: true).

Helpful notes:

  • If you are not interested in some of the returned results, you should disable them to save time and memory.
  • Profiling might change the execution behavior of your code: An expression that might be executed iteratively will be cached by the profiling function.
  • If a value has a compact internal representation, memory consumption will be very low, even if the serialized result may consume much more memory.
  • Please note that memory profiling is only approximative, so it can be quite misleading. If the memory option is enabled, main-memory will be garbage-collected before and after evaluation to improve the quality of the measurement.
- : - : @param $expression value of type item() - : @return value of type item()* - :) -declare function prof:track($expression as item()) as item()* external; - -(:~ - : Measures the execution time and memory consumption required for evaluating the specified $expression and returns a map with the results. The following $options are available:
  • time: Include execution time in result as xs:decimal (unit: milliseconds; default: true).
  • memory: Include memory consumption in result as xs:integer (unit: bytes; default: false).
  • value: Include value in result (default: true).

Helpful notes:

  • If you are not interested in some of the returned results, you should disable them to save time and memory.
  • Profiling might change the execution behavior of your code: An expression that might be executed iteratively will be cached by the profiling function.
  • If a value has a compact internal representation, memory consumption will be very low, even if the serialized result may consume much more memory.
  • Please note that memory profiling is only approximative, so it can be quite misleading. If the memory option is enabled, main-memory will be garbage-collected before and after evaluation to improve the quality of the measurement.
- : - : @param $expression value of type item() - : @param $options value of type map(*)? - : @return value of type item()* - :) -declare function prof:track($expression as item(), $options as map(*)?) as item()* external; - -(:~ - : Measures the time needed to evaluate $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes. - : - : @param $expr value of type item() - : @return value of type item()* - :) -declare function prof:time($expr as item()) as item()* external; - -(:~ - : Measures the time needed to evaluate $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes. - : - : @param $expr value of type item() - : @param $label value of type xs:string - : @return value of type item()* - :) -declare function prof:time($expr as item(), $label as xs:string) as item()* external; - -(:~ - : Measures the memory allocated by evaluating $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes. - : - : @param $expr value of type item() - : @return value of type item()* - :) -declare function prof:memory($expr as item()) as item()* external; - -(:~ - : Measures the memory allocated by evaluating $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes. - : - : @param $expr value of type item() - : @param $label value of type xs:string - : @return value of type item()* - :) -declare function prof:memory($expr as item(), $label as xs:string) as item()* external; - -(:~ - : Returns the number of milliseconds passed since 1970/01/01 UTC. The granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds. - : - : @return value of type xs:integer - :) -declare function prof:current-ms() as xs:integer external; - -(:~ - : Returns the current value of the most precise available system timer in nanoseconds. - : - : @return value of type xs:integer - :) -declare function prof:current-ns() as xs:integer external; - -(:~ - : Dumps a serialized representation of $expr to STDERR, optionally prefixed with $label, and returns an empty sequence. If the GUI is used, the dumped result is shown in the Info View. - : - : @param $expr value of type item()* - :) -declare function prof:dump($expr as item()*) as empty-sequence() external; - -(:~ - : Dumps a serialized representation of $expr to STDERR, optionally prefixed with $label, and returns an empty sequence. If the GUI is used, the dumped result is shown in the Info View. - : - : @param $expr value of type item()* - : @param $label value of type xs:string - :) -declare function prof:dump($expr as item()*, $label as xs:string) as empty-sequence() external; - -(:~ - : Prints a list of all current local and global variable assignments to standard error or, if the GUI is used, to the Info View.
As every query is optimized before being evaluated, not all of the original variables may be visible in the output. Moreover, many variables of function calls will disappear because functions are inlined. Function inlining can be turned off by setting INLINELIMIT to 0. - :) -declare function prof:variables() as empty-sequence() external; - -(:~ - : Similar to fn:trace($expr, $msg), but instead of a user-defined message, it emits the compile-time type and estimated result size of its argument. - : - : @param $expr value of type item()* - : @return value of type item()* - :) -declare function prof:type($expr as item()*) as item()* external; - -(:~ - : Enforces Java garbage collection. If no $count is supplied, garbage will be collected once. Please note that this function should only be used for debugging purposes; in productive code, it is best to trust the garbage collecting strategies of Java. - :) -declare function prof:gc() as empty-sequence() external; - -(:~ - : Enforces Java garbage collection. If no $count is supplied, garbage will be collected once. Please note that this function should only be used for debugging purposes; in productive code, it is best to trust the garbage collecting strategies of Java. - : - : @param $count value of type xs:integer - :) -declare function prof:gc($count as xs:integer) as empty-sequence() external; - -(:~ - : Returns the value of the specified runtime $option. The following options exist:
  • max: Maximum memory that the Java virtual machine will attempt to use.
  • total: Total memory in the Java virtual machine (varies over time).
  • used: Currently used memory (varies over time, will shrink after garbage collection).
  • processors: number of processors available to the Java virtual machine.
- : - : @param $name of xs:string value of type - : @return value of type xs:integer - :) -declare function prof:runtime($name of xs:string) as xs:integer external; - -(:~ - : Swallows all items of the specified $value and returns an empty sequence. This function is helpful if some code needs to be evaluated and if the actual result is irrelevant. - : - : @param $value value of type item()* - :) -declare function prof:void($value as item()*) as empty-sequence() external; - -(:~ - : Sleeps for the specified number of milliseconds. - : - : @param $ms value of type xs:integer - :) -declare function prof:sleep($ms as xs:integer) as empty-sequence() external; - -(:~ - : Returns a human-readable representation of the specified $number. - : - : @param $number value of type xs:integer - : @return value of type xs:string - :) -declare function prof:human($number as xs:integer) as xs:string external; diff --git a/packages.src/basex-10.0/random.xqm b/packages.src/basex-10.0/random.xqm deleted file mode 100644 index 81b70d0..0000000 --- a/packages.src/basex-10.0/random.xqm +++ /dev/null @@ -1,87 +0,0 @@ -(:~ - : This XQuery Module contains functions for computing random values. All functions except for random:seeded-double and random:seeded-integer are non-deterministic, i. e., they return different values for each call. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Random_Module - :) -module namespace random = "http://basex.org/modules/random"; - -(:~ - : Returns a double value between 0.0 (inclusive) and 1.0 (exclusive).
- : - : @return value of type xs:double - :) -declare function random:double() as xs:double external; - -(:~ - : Returns an integer value, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive)
- : - : @return value of type xs:integer - : @error random:bounds the maximum value is out of bounds. - :) -declare function random:integer() as xs:integer external; - -(:~ - : Returns an integer value, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive)
- : - : @param $max value of type xs:integer - : @return value of type xs:integer - : @error random:bounds the maximum value is out of bounds. - :) -declare function random:integer($max as xs:integer) as xs:integer external; - -(:~ - : Returns a sequence with $num double values between 0.0 (inclusive) and 1.0 (exclusive). The random values are created using the initial seed given in $seed.
- : - : @param $seed value of type xs:integer - : @param $num value of type xs:integer - : @return value of type xs:double* - :) -declare function random:seeded-double($seed as xs:integer, $num as xs:integer) as xs:double* external; - -(:~ - : Returns a sequence with $num integer values, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive). The random values are created using the initial seed given in $seed.
- : - : @param $seed value of type xs:integer - : @param $num value of type xs:integer - : @return value of type xs:integer* - : @error random:bounds the maximum value is out of bounds. - : @error random:negative the number of values to be returned is negative. - :) -declare function random:seeded-integer($seed as xs:integer, $num as xs:integer) as xs:integer* external; - -(:~ - : Returns a sequence with $num integer values, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive). The random values are created using the initial seed given in $seed.
- : - : @param $seed value of type xs:integer - : @param $num value of type xs:integer - : @param $max value of type xs:integer - : @return value of type xs:integer* - : @error random:bounds the maximum value is out of bounds. - : @error random:negative the number of values to be returned is negative. - :) -declare function random:seeded-integer($seed as xs:integer, $num as xs:integer, $max as xs:integer) as xs:integer* external; - -(:~ - : Returns a sequence with $num double values. The random values are Gaussian (i.e. normally) distributed with the mean 0.0. and the derivation 1.0.
- : - : @param $num value of type xs:integer - : @return value of type xs:double* - :) -declare function random:gaussian($num as xs:integer) as xs:double* external; - -(:~ - : Returns a random permutation of the specified $items. The random order is created using the initial seed given in $seed.
- : - : @param $seed value of type xs:integer - : @param $items value of type item()* - : @return value of type item()* - :) -declare function random:seeded-permutation($seed as xs:integer, $items as item()*) as item()* external; - -(:~ - : Creates a random universally unique identifier (UUID), represented as 128-bit value. - : - : @return value of type xs:string - :) -declare function random:uuid() as xs:string external; diff --git a/packages.src/basex-10.0/repo.xqm b/packages.src/basex-10.0/repo.xqm deleted file mode 100644 index 2fdbd80..0000000 --- a/packages.src/basex-10.0/repo.xqm +++ /dev/null @@ -1,35 +0,0 @@ -(:~ - : This XQuery Module contains functions for installing, listing and deleting modules contained in the Repository. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Repository_Module - :) -module namespace repo = "http://basex.org/modules/repo"; - -(:~ - : Retrieves and installs a package from the given $uri. Existing packages are replaced. - : - : @param $uri value of type xs:string - : @error repo:not-found a package does not exist. - : @error repo:descriptor the package descriptor is invalid. - : @error repo:installed the module contained in the package to be installed is already installed as part of another package. - : @error repo:parse an error occurred while parsing the package. - : @error repo:version the package version is not supported. - :) -declare function repo:install($uri as xs:string) as empty-sequence() external; - -(:~ - : Deletes a $package. The argument contains the package name, optionally suffixed with a dash and the package version.
- : - : @param $package value of type xs:string - : @error repo:not-found a package does not exist. - : @error repo:delete the package cannot be deleted. - :) -declare function repo:delete($package as xs:string) as empty-sequence() external; - -(:~ - : Lists the names and versions of all currently installed packages.
- : - : @return value of type element(package)* - :) -declare function repo:list() as element(package)* external; diff --git a/packages.src/basex-10.0/request.xqm b/packages.src/basex-10.0/request.xqm deleted file mode 100644 index b854f73..0000000 --- a/packages.src/basex-10.0/request.xqm +++ /dev/null @@ -1,198 +0,0 @@ -(:~ - : This XQuery Module contains functions for retrieving information on an HTTP request that has triggered the query. It is mostly useful when building Web Applications. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Request_Module - :) -module namespace request = "http://exquery.org/ns/request"; - -(:~ - : Returns the Method of the HTTP request. - : - : @return value of type xs:string - :) -declare function request:method() as xs:string external; - -(:~ - : Returns the Scheme component of the URI of an HTTP request. - : - : @return value of type xs:string - :) -declare function request:scheme() as xs:string external; - -(:~ - : Returns the Hostname component of the URI of an HTTP request. - : - : @return value of type xs:string - :) -declare function request:hostname() as xs:string external; - -(:~ - : Returns the Port component of the URI of an HTTP request, or a default port if it has not been explicitly specified in the URI. - : - : @return value of type xs:integer - :) -declare function request:port() as xs:integer external; - -(:~ - : Returns the Path component of the URI of an HTTP request. - : - : @return value of type xs:string - :) -declare function request:path() as xs:string external; - -(:~ - : Returns the Query component of the URI of an HTTP request. If no query component exists, an empty sequence is returned. - : - : @return value of type xs:string? - :) -declare function request:query() as xs:string? external; - -(:~ - : Returns the complete URI of an HTTP request as it has been specified by the client. - : - : @return value of type xs:anyURI - :) -declare function request:uri() as xs:anyURI external; - -(:~ - : Returns the context of the request. For servlets in the default (root) context, this method returns an empty string. - : - : @return value of type xs:string - :) -declare function request:context-path() as xs:string external; - -(:~ - : Returns the IP address of the server. - : - : @return value of type xs:string - :) -declare function request:address() as xs:string external; - -(:~ - : Returns the fully qualified hostname of the client that sent the request. - : - : @return value of type xs:string - :) -declare function request:remote-hostname() as xs:string external; - -(:~ - : Returns the IP address of the client that sent the request. - : - : @return value of type xs:string - :) -declare function request:remote-address() as xs:string external; - -(:~ - : Returns the TCP port of the client socket that triggered the request. - : - : @return value of type xs:string - :) -declare function request:remote-port() as xs:string external; - -(:~ - : Returns the names of all query and form field parameters available from the HTTP request. With RESTXQ, this function can be used to access parameters that have not been statically bound by %rest:query-param. - : - : @return value of type xs:string* - : @error request:parameter the request has invalid parameters. - :) -declare function request:parameter-names() as xs:string* external; - -(:~ - : Returns the value of the named query or form field parameter in an HTTP request. If the parameter does not exist, an empty sequence or the optionally specified default value is returned instead. If both query and form field parameters with the same name exist, the form field values will be attached to the query values. - : - : @param $name value of type xs:string - : @return value of type xs:string* - : @error request:parameter the request has invalid parameters. - :) -declare function request:parameter($name as xs:string) as xs:string* external; - -(:~ - : Returns the value of the named query or form field parameter in an HTTP request. If the parameter does not exist, an empty sequence or the optionally specified default value is returned instead. If both query and form field parameters with the same name exist, the form field values will be attached to the query values. - : - : @param $name value of type xs:string - : @param $default value of type xs:string - : @return value of type xs:string* - : @error request:parameter the request has invalid parameters. - :) -declare function request:parameter($name as xs:string, $default as xs:string) as xs:string* external; - -(:~ - : Returns the names of all headers available from the HTTP request. If RESTXQ is used, this function can be used to access headers that have not been statically bound by %rest:header-param. - : - : @return value of type xs:string* - :) -declare function request:header-names() as xs:string* external; - -(:~ - : Returns the value of the named header in an HTTP request. If the header does not exist, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @return value of type xs:string? - :) -declare function request:header($name as xs:string) as xs:string? external; - -(:~ - : Returns the value of the named header in an HTTP request. If the header does not exist, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @param $default value of type xs:string - : @return value of type xs:string - :) -declare function request:header($name as xs:string, $default as xs:string) as xs:string external; - -(:~ - : Returns the names of all cookies in the HTTP headers available from the HTTP request. If RESTXQ is used, this function can be used to access cookies that have not been statically bound by %rest:cookie-param. - : - : @return value of type xs:string* - :) -declare function request:cookie-names() as xs:string* external; - -(:~ - : Returns the value of the named Cookie in an HTTP request. If there is no such cookie, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @return value of type xs:string? - :) -declare function request:cookie($name as xs:string) as xs:string? external; - -(:~ - : Returns the value of the named Cookie in an HTTP request. If there is no such cookie, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @param $default value of type xs:string - : @return value of type xs:string - :) -declare function request:cookie($name as xs:string, $default as xs:string) as xs:string external; - -(:~ - : Returns the names of all HTTP request attributes. - : - : @return value of type xs:string* - :) -declare function request:attribute-names() as xs:string* external; - -(:~ - : Returns the value of an attribute of the HTTP request. If the attribute does not exist, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @return value of type item()* - :) -declare function request:attribute($name as xs:string) as item()* external; - -(:~ - : Returns the value of an attribute of the HTTP request. If the attribute does not exist, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @param $default value of type item()* - : @return value of type item()* - :) -declare function request:attribute($name as xs:string, $default as item()*) as item()* external; - -(:~ - : Binds the specified $value to the request attribute with the specified $name. - : - : @param $name value of type xs:string - : @param $value value of type item()* - :) -declare function request:set-attribute($name as xs:string, $value as item()*) as empty-sequence() external; diff --git a/packages.src/basex-10.0/rest.xqm b/packages.src/basex-10.0/rest.xqm deleted file mode 100644 index b904cf7..0000000 --- a/packages.src/basex-10.0/rest.xqm +++ /dev/null @@ -1,41 +0,0 @@ -(:~ - : This XQuery Module contains helper functions for the RESTXQ API, some of which are defined in the RESTXQ Draft. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/RESTXQ_Module - :) -module namespace rest = "http://exquery.org/ns/restxq"; -declare namespace wadl = "http://wadl.dev.java.net/2009/02"; - -(:~ - : Returns the implementation-defined base URI of the resource function. - : - : @return value of type xs:anyURI - :) -declare function rest:base-uri() as xs:anyURI external; - -(:~ - : Returns the complete URI that addresses the Resource Function. This is the result of rest:base-uri appended with the path from the path annotation of the resource function. - : - : @return value of type xs:anyURI - :) -declare function rest:uri() as xs:anyURI external; - -(:~ - : Returns a WADL description of all available REST services. - : - : @return value of type element(wadl:application) - :) -declare function rest:wadl() as element(wadl:application) external; - -(:~ - : Initializes the RESTXQ module cache:
  • By default, the cache will be discarded, and all modules will be parsed and cached again.
  • If $update is enabled, the background caching behavior is simulated (see PARSERESTXQ ): Only updated modules will be parsed.
  • This function should be called if new RESTXQ code is deployed at runtime.
- :) -declare function rest:init() as empty-sequence() external; - -(:~ - : Initializes the RESTXQ module cache:
  • By default, the cache will be discarded, and all modules will be parsed and cached again.
  • If $update is enabled, the background caching behavior is simulated (see PARSERESTXQ ): Only updated modules will be parsed.
  • This function should be called if new RESTXQ code is deployed at runtime.
- : - : @param $update value of type xs:boolean - :) -declare function rest:init($update as xs:boolean) as empty-sequence() external; diff --git a/packages.src/basex-10.0/session.xqm b/packages.src/basex-10.0/session.xqm deleted file mode 100644 index 6f07568..0000000 --- a/packages.src/basex-10.0/session.xqm +++ /dev/null @@ -1,76 +0,0 @@ -(:~ - : This XQuery Module contains functions for accessing and modifying server-side session information. This module is mainly useful in the context of Web Applications. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Session_Module - :) -module namespace session = "http://basex.org/modules/session"; - -(:~ - : Returns the session ID of a servlet request. - : - : @return value of type xs:string - : @error session:not-found No session is available for the current client. - :) -declare function session:id() as xs:string external; - -(:~ - : Returns the creation time of a session. - : - : @return value of type xs:dateTime - : @error session:not-found No session is available for the current client. - :) -declare function session:created() as xs:dateTime external; - -(:~ - : Returns the last access time of a session. - : - : @return value of type xs:dateTime - : @error session:not-found No session is available for the current client. - :) -declare function session:accessed() as xs:dateTime external; - -(:~ - : Returns the names of all attributes bound to the current session. - : - : @return value of type xs:string* - :) -declare function session:names() as xs:string* external; - -(:~ - : Returns the value of a session attribute with the specified $name. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $name value of type xs:string - : @return value of type item()* - :) -declare function session:get($name as xs:string) as item()* external; - -(:~ - : Returns the value of a session attribute with the specified $name. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $name value of type xs:string - : @param $default value of type item()* - : @return value of type item()* - :) -declare function session:get($name as xs:string, $default as item()*) as item()* external; - -(:~ - : Binds the specified $value to the session attribute with the specified $name. - : - : @param $name value of type xs:string - : @param $value value of type item()* - : @error session:not-found No session is available for the current client. - :) -declare function session:set($name as xs:string, $value as item()*) as empty-sequence() external; - -(:~ - : Deletes a session attribute with the specified $name. - : - : @param $name value of type xs:string - :) -declare function session:delete($name as xs:string) as empty-sequence() external; - -(:~ - : Unregisters a session and all data associated with it. - :) -declare function session:close() as empty-sequence() external; diff --git a/packages.src/basex-10.0/sessions.xqm b/packages.src/basex-10.0/sessions.xqm deleted file mode 100644 index c636cb7..0000000 --- a/packages.src/basex-10.0/sessions.xqm +++ /dev/null @@ -1,81 +0,0 @@ -(:~ - : This XQuery Module can only be called from users with Admin permissions. It contains functions for accessing and modifying all registered server-side sessions. This module is mainly useful in the context of Web Applications. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Sessions_Module - :) -module namespace sessions = "http://basex.org/modules/sessions"; - -(:~ - : Returns the IDs of all registered sessions. - : - : @return value of type xs:string* - :) -declare function sessions:ids() as xs:string* external; - -(:~ - : Returns the creation time of the session specified by $id. - : - : @param $id value of type xs:string - : @return value of type xs:dateTime - :) -declare function sessions:created($id as xs:string) as xs:dateTime external; - -(:~ - : Returns the last access time of the session specified by $id. - : - : @param $id value of type xs:string - : @return value of type xs:dateTime - :) -declare function sessions:accessed($id as xs:string) as xs:dateTime external; - -(:~ - : Returns the names of all attributes bound to the session specified by $id. - : - : @param $id value of type xs:string - : @return value of type xs:string* - :) -declare function sessions:names($id as xs:string) as xs:string* external; - -(:~ - : Returns the value of an attribute with the specified $name from the session with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @return value of type item()* - :) -declare function sessions:get($id as xs:string, $name as xs:string) as item()* external; - -(:~ - : Returns the value of an attribute with the specified $name from the session with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @param $default value of type item()* - : @return value of type item()* - :) -declare function sessions:get($id as xs:string, $name as xs:string, $default as item()*) as item()* external; - -(:~ - : Returns the specified value to the attribute with the specified $name from the session with the specified $id. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @param $value value of type item()* - :) -declare function sessions:set($id as xs:string, $name as xs:string, $value as item()*) as empty-sequence() external; - -(:~ - : Deletes an attribute with the specified $name from the session with the specified $id. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - :) -declare function sessions:delete($id as xs:string, $name as xs:string) as empty-sequence() external; - -(:~ - : Unregisters the session specified by $id. - : - : @param $id value of type xs:string - :) -declare function sessions:close($id as xs:string) as empty-sequence() external; diff --git a/packages.src/basex-10.0/sql.xqm b/packages.src/basex-10.0/sql.xqm deleted file mode 100644 index 7d75877..0000000 --- a/packages.src/basex-10.0/sql.xqm +++ /dev/null @@ -1,141 +0,0 @@ -(:~ - : This XQuery Module contains functions to access relational databases from XQuery using SQL. With this module, you can execute query, update and prepared statements, and the result sets are returned as sequences of XML elements representing tuples. Each element has children representing the columns returned by the SQL statement. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/SQL_Module - :) -module namespace sql = "http://basex.org/modules/sql"; - -(:~ - : This function initializes a JDBC driver specified via $class. This step might be superfluous if the SQL database is not embedded.
- : - : @param $class value of type xs:string - : @error sql:init the specified driver is not found. - :) -declare function sql:init($class as xs:string) as empty-sequence() external; - -(:~ - : This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:<server> [/<database>]. If $username and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options. - : - : @param $url value of type xs:string - : @return value of type xs:anyURI - : @error sql:error an SQL exception occurred when connecting to the database. - :) -declare function sql:connect($url as xs:string) as xs:anyURI external; - -(:~ - : This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:<server> [/<database>]. If $username and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options. - : - : @param $url value of type xs:string - : @param $username value of type xs:string - : @param $password value of type xs:string - : @return value of type xs:anyURI - : @error sql:error an SQL exception occurred when connecting to the database. - :) -declare function sql:connect($url as xs:string, $username as xs:string, $password as xs:string) as xs:anyURI external; - -(:~ - : This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:<server> [/<database>]. If $username and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options. - : - : @param $url value of type xs:string - : @param $username value of type xs:string - : @param $password value of type xs:string - : @param $options value of type map(*)? - : @return value of type xs:anyURI - : @error sql:error an SQL exception occurred when connecting to the database. - :) -declare function sql:connect($url as xs:string, $username as xs:string, $password as xs:string, $options as map(*)?) as xs:anyURI external; - -(:~ - : This function executes an SQL $statement, using the connection with the specified $id. The returned result depends on the kind of statement:
  • If an update statement was executed, the number of updated rows will be returned as integer.
  • Otherwise, an XML representation of all results will be returned.

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
- : - : @param $id value of type xs:anyURI - : @param $statement value of type xs:string - : @return value of type item()* - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - : @error sql:timeout query execution exceeded timeout. - :) -declare function sql:execute($id as xs:anyURI, $statement as xs:string) as item()* external; - -(:~ - : This function executes an SQL $statement, using the connection with the specified $id. The returned result depends on the kind of statement:
  • If an update statement was executed, the number of updated rows will be returned as integer.
  • Otherwise, an XML representation of all results will be returned.

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
- : - : @param $id value of type xs:anyURI - : @param $statement value of type xs:string - : @param $options value of type map(*)? - : @return value of type item()* - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - : @error sql:timeout query execution exceeded timeout. - :) -declare function sql:execute($id as xs:anyURI, $statement as xs:string, $options as map(*)?) as item()* external; - -(:~ - : This function executes a prepared statement with the specified $id. The output format is identical to sql:execute . The optional parameter $params is an element <sql:parameters/> representing the parameters for a prepared statement along with their types and values. The following schema shall be used:
  element sql:parameters { element sql:parameter { attribute type { "bigdecimal" | "boolean" | "byte" | "date" | "double" | "float" | "int" | "long" | "short" | "sqlxml" | "string" | "time" | "timestamp" }, attribute null { "true" | "false" }?, text } + } ? 

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
- : - : @param $id value of type xs:anyURI - : @param $params value of type element(sql:parameters) - : @return value of type item()* - : @error sql:attribute an attribute different from type and null is set for a <sql:parameter/> element. - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - : @error sql:parameters no parameter type specified. - : @error sql:timeout query execution exceeded timeout. - : @error sql:type the value of a parameter cannot be converted to the specified format. - :) -declare function sql:execute-prepared($id as xs:anyURI, $params as element(sql:parameters)) as item()* external; - -(:~ - : This function executes a prepared statement with the specified $id. The output format is identical to sql:execute . The optional parameter $params is an element <sql:parameters/> representing the parameters for a prepared statement along with their types and values. The following schema shall be used:
  element sql:parameters { element sql:parameter { attribute type { "bigdecimal" | "boolean" | "byte" | "date" | "double" | "float" | "int" | "long" | "short" | "sqlxml" | "string" | "time" | "timestamp" }, attribute null { "true" | "false" }?, text } + } ? 

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
- : - : @param $id value of type xs:anyURI - : @param $params value of type element(sql:parameters) - : @param $options value of type map(*)? - : @return value of type item()* - : @error sql:attribute an attribute different from type and null is set for a <sql:parameter/> element. - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - : @error sql:parameters no parameter type specified. - : @error sql:timeout query execution exceeded timeout. - : @error sql:type the value of a parameter cannot be converted to the specified format. - :) -declare function sql:execute-prepared($id as xs:anyURI, $params as element(sql:parameters), $options as map(*)?) as item()* external; - -(:~ - : This function prepares an SQL $statement, using the specified connection $id, and returns the id reference to this statement. The statement is a string with one or more '?' placeholders. If the value of a field has to be set to NULL, then the attribute null of the <sql:parameter/> element must be true. - : - : @param $id value of type xs:anyURI - : @param $statement value of type xs:string - : @return value of type xs:anyURI - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - :) -declare function sql:prepare($id as xs:anyURI, $statement as xs:string) as xs:anyURI external; - -(:~ - : This function commits the changes made to a relational database, using the specified connection $id. - : - : @param $id value of type xs:anyURI - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - :) -declare function sql:commit($id as xs:anyURI) as empty-sequence() external; - -(:~ - : This function rolls back the changes made to a relational database, using the specified connection $id. - : - : @param $id value of type xs:anyURI - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - :) -declare function sql:rollback($id as xs:anyURI) as empty-sequence() external; - -(:~ - : This function closes a database connection with the specified $id.
Opened connections will automatically be closed after the XQuery expression has been evaluated, but in order to save memory, it is always recommendable to close connections that are not used anymore. - : - : @param $id value of type xs:anyURI - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - :) -declare function sql:close($id as xs:anyURI) as empty-sequence() external; diff --git a/packages.src/basex-10.0/store.xqm b/packages.src/basex-10.0/store.xqm deleted file mode 100644 index 0e4d822..0000000 --- a/packages.src/basex-10.0/store.xqm +++ /dev/null @@ -1,103 +0,0 @@ -(:~ - : This XQuery Module provides functions to organize values in a persistent main-memory key-value store. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Store_Module - :) -module namespace store = "http://basex.org/modules/store"; - -(:~ - : Retrieves an entry from the store with the given $key. If the addressed entry does not exist, an empty sequence is returned. - : - : @param $key value of type xs:string - : @return value of type item()* - :) -declare function store:get($key as xs:string) as item()* external; - -(:~ - : Stores an entry with the given $key and $value in the store:
  • If the value is an empty sequence, the entry is removed.
  • If a value refers to an opened database or is a lazy item, its contents are materialized in main memory.
  • Values with function items are rejected.
- : - : @param $key value of type xs:string - : @param $value value of type item()* - :) -declare function store:put($key as xs:string, $value as item()*) as empty-sequence() external; - -(:~ - : Retrieves an entry from the store with the given $key. The $put function will only be invoked if the entry does not exist, and its result will be stored and returned instead. - : - : @param $key value of type xs:string - : @param $put value of type function( - : @return value of type item()* - :) -declare function store:get-or-put($key as xs:string, $put as function() as item()*) as item()* external; - -(:~ - : Removes an entry with the given $key from the store. No error will be raised if an addressed entry does not exist. - : - : @param $key value of type xs:string - :) -declare function store:remove($key as xs:string) as empty-sequence() external; - -(:~ - : Lists the names of all keys. - : - : @return value of type xs:string* - :) -declare function store:keys() as xs:string* external; - -(:~ - : Resets the store by removing all its entries. - :) -declare function store:clear() as empty-sequence() external; - -(:~ - : Retrieves the standard store from disk, or a custom store if a $name is supplied. - : - : @error store:io The store could not be read. - : @error store:name The specified name is invalid. - : @error store:not-found A store with the specified name does not exist. - :) -declare function store:read() as empty-sequence() external; - -(:~ - : Retrieves the standard store from disk, or a custom store if a $name is supplied. - : - : @param $name value of type xs:string - : @error store:io The store could not be read. - : @error store:name The specified name is invalid. - : @error store:not-found A store with the specified name does not exist. - :) -declare function store:read($name as xs:string) as empty-sequence() external; - -(:~ - : Writes the standard store to disk, or to a custom store file if a $name is supplied. If the standard store is empty, the store file will be deleted. - : - : @error store:io The store could not be written. - : @error store:name The specified name is invalid. - :) -declare function store:write() as empty-sequence() external; - -(:~ - : Writes the standard store to disk, or to a custom store file if a $name is supplied. If the standard store is empty, the store file will be deleted. - : - : @param $name value of type xs:string - : @error store:io The store could not be written. - : @error store:name The specified name is invalid. - :) -declare function store:write($name as xs:string) as empty-sequence() external; - -(:~ - : Lists the names of all custom stores. - : - : @return value of type xs:string* - :) -declare function store:list() as xs:string* external; - -(:~ - : Deletes a custom store from disk. - : - : @param $name value of type xs:string - : @error store:name The specified name is invalid. - : @error store:not-found A store with the specified name does not exist. - :) -declare function store:delete($name as xs:string) as empty-sequence() external; diff --git a/packages.src/basex-10.0/string.xqm b/packages.src/basex-10.0/string.xqm deleted file mode 100644 index a3cf3ea..0000000 --- a/packages.src/basex-10.0/string.xqm +++ /dev/null @@ -1,66 +0,0 @@ -(:~ - : Updated with Version 10: Renamed from Strings Module to String Module. The namespace URI has been updated as well. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/String_Module - :) -module namespace string = "http://basex.org/modules/string"; - -(:~ - : Computes the Damerau-Levenshtein Distance for two strings and returns a double value (0.0 - 1.0). The returned value is computed as follows:
  • 1.0 – distance / max(length of strings)
  • 1.0 is returned if the strings are equal; 0.0 is returned if the strings are too different.
- : - : @param $string1 value of type xs:string - : @param $string2 value of type xs:string - : @return value of type xs:double - :) -declare function string:levenshtein($string1 as xs:string, $string2 as xs:string) as xs:double external; - -(:~ - : Computes the Soundex value for the specified string. The algorithm can be used to find and index English words with similar pronouncation. - : - : @param $string value of type xs:string - : @return value of type xs:string - :) -declare function string:soundex($string as xs:string) as xs:string external; - -(:~ - : Computes the Kölner Phonetik value for the specified string. Similar to Soundex, the algorithm is used to find similarly pronounced words, but for the German language. As the first returned digit can be 0, the value is returned as string. - : - : @param $string value of type xs:string - : @return value of type xs:string - :) -declare function string:cologne-phonetic($string as xs:string) as xs:string external; - -(:~ - : Returns a formatted string. The remaining arguments specified by $items are applied to the $format string, according to Java’s printf syntax. - : - : @param $format value of type xs:string - : @param $items value of type item( - : @return value of type xs:string - : @error string:format The specified format is not valid. - :) -declare function string:format($format as xs:string, $items as item()) as xs:string external; - -(:~ - : Returns a single carriage return character (&#13;). - : - : @param value of type xs:string - : @return value of type xs:string - :) -declare function string:cr() as xs:string external; - -(:~ - : Returns a single newline character (&#10;). - : - : @param value of type xs:string - : @return value of type xs:string - :) -declare function string:nl() as xs:string external; - -(:~ - : Returns a single tabulator character (&#9;). - : - : @param value of type xs:string - : @return value of type xs:string - :) -declare function string:tab() as xs:string external; diff --git a/packages.src/basex-10.0/unit.xqm b/packages.src/basex-10.0/unit.xqm deleted file mode 100644 index 2d18c18..0000000 --- a/packages.src/basex-10.0/unit.xqm +++ /dev/null @@ -1,58 +0,0 @@ -(:~ - : This XQuery Module contains annotations and functions for performing XQUnit tests. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Unit_Module - :) -module namespace unit = "http://basex.org/modules/unit"; - -(:~ - : Asserts that the effective boolean value of the specified $test is true and returns an empty sequence. Otherwise, raises an error. The effective boolean value of an expression can be explicitly computed by using the fn:boolean function.
The default failure message can be overridden with the $info argument. - : - : @param $test value of type item()* - : @error unit:fail the assertion failed, or an error was raised. - :) -declare function unit:assert($test as item()*) as empty-sequence() external; - -(:~ - : Asserts that the effective boolean value of the specified $test is true and returns an empty sequence. Otherwise, raises an error. The effective boolean value of an expression can be explicitly computed by using the fn:boolean function.
The default failure message can be overridden with the $info argument. - : - : @param $test value of type item()* - : @param $info value of type item() - : @error unit:fail the assertion failed, or an error was raised. - :) -declare function unit:assert($test as item()*, $info as item()) as empty-sequence() external; - -(:~ - : Asserts that the specified arguments are equal according to the rules of the fn:deep-equal function. Otherwise, raises an error.
The default failure message can be overridden with the $info argument. - : - : @param $returned value of type item()* - : @param $expected value of type item()* - : @error unit:fail the assertion failed, or an error was raised. - :) -declare function unit:assert-equals($returned as item()*, $expected as item()*) as empty-sequence() external; - -(:~ - : Asserts that the specified arguments are equal according to the rules of the fn:deep-equal function. Otherwise, raises an error.
The default failure message can be overridden with the $info argument. - : - : @param $returned value of type item()* - : @param $expected value of type item()* - : @param $info value of type item() - : @error unit:fail the assertion failed, or an error was raised. - :) -declare function unit:assert-equals($returned as item()*, $expected as item()*, $info as item()) as empty-sequence() external; - -(:~ - : Raises a unit error. The default failure message can be overridden with the $info argument. - : - : @error unit:fail default error raised by this function. - :) -declare function unit:fail() as empty-sequence() external; - -(:~ - : Raises a unit error. The default failure message can be overridden with the $info argument. - : - : @param $info value of type item() - : @error unit:fail default error raised by this function. - :) -declare function unit:fail($info as item()) as empty-sequence() external; diff --git a/packages.src/basex-10.0/update.xqm b/packages.src/basex-10.0/update.xqm deleted file mode 100644 index 08882df..0000000 --- a/packages.src/basex-10.0/update.xqm +++ /dev/null @@ -1,63 +0,0 @@ -(:~ - : This XQuery Module provides additional functions for performing updates and returning results in updating expressions. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Update_Module - :) -module namespace update = "http://basex.org/modules/update"; - -(:~ - : The updating variant of fn:apply applies the specified updating $function to the specified $arguments. - : - : @param $function value of type function(*) - : @param $arguments value of type array(*) - :) -declare function update:apply($function as function(*), $arguments as array(*)) as empty-sequence() external; - -(:~ - : The updating variant of fn:for-each applies the specified updating $function to every item of $seq. - : - : @param $seq value of type item()* - : @param $function value of type function(item() - :) -declare function update:for-each($seq as item()*, $function as function(item()) as item()*) as empty-sequence() external; - -(:~ - : The updating variant of fn:for-each-pair applies the specified updating $function to the successive pairs of items of $seq1 and $seq2. Evaluation is stopped if one sequence yields no more items. - : - : @param $seq1 value of type item()* - : @param $function value of type function(item() - :) -declare function update:for-each-pair($seq1 as item()*, $function as function(item()) as item()*) as empty-sequence() external; - -(:~ - : The updating variant of map:for-each applies the specified $function to every key/value pair of the supplied $map and returns the results as a sequence. - : - : @param $map value of type map(*) - : @param $function value of type function(xs:anyAtomicType - : @param item()* value of type - : @return value of type item()* - :) -declare function update:map-for-each($map as map(*), $function as function(xs:anyAtomicType, item()*) as item()*) as item()* external; - -(:~ - : This function can be used if MIXUPDATES is not enabled, and if values need to returned within an updating expression: The supplied $items will be cached and returned at the very end, i.e., after all updates on the pending update list have been processed. If one of the supplied items is affected by an update, a copy will be created and cached instead. - : - : @param $items value of type item()* - :) -declare function update:output($items as item()*) as empty-sequence() external; - -(:~ - : Returns the items that have been cached by update:output . The output cache can optionally be $reset. The function can be used to check which items will eventually be returned as result of an updating function.
This function is non-deterministic: It will return different results before and after items have been cached. It is e. g. useful when writing unit tests. - : - : @return value of type item()* - :) -declare function update:cache() as item()* external; - -(:~ - : Returns the items that have been cached by update:output . The output cache can optionally be $reset. The function can be used to check which items will eventually be returned as result of an updating function.
This function is non-deterministic: It will return different results before and after items have been cached. It is e. g. useful when writing unit tests. - : - : @param $reset value of type xs:boolean - : @return value of type item()* - :) -declare function update:cache($reset as xs:boolean) as item()* external; diff --git a/packages.src/basex-10.0/user.xqm b/packages.src/basex-10.0/user.xqm deleted file mode 100644 index 36df825..0000000 --- a/packages.src/basex-10.0/user.xqm +++ /dev/null @@ -1,233 +0,0 @@ -(:~ - : This XQuery Module contains functions for creating and administering database users. The User Management article gives more information on database users and permissions. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/User_Module - :) -module namespace user = "http://basex.org/modules/user"; - -(:~ - : Returns the name of the currently logged in user. - : - : @return value of type xs:string - :) -declare function user:current() as xs:string external; - -(:~ - : Returns the names of all registered users that are visible to the current user. - : - : @return value of type xs:string* - :) -declare function user:list() as xs:string* external; - -(:~ - : Returns an element sequence, containing all registered users that are visible to the current user.
In addition to the SHOW USERS command, encoded password strings and database permissions will be output. A user $name can be specified to filter the results in advance. - : - : @return value of type element(user)* - : @error user:unknown The specified username is unknown. - :) -declare function user:list-details() as element(user)* external; - -(:~ - : Returns an element sequence, containing all registered users that are visible to the current user.
In addition to the SHOW USERS command, encoded password strings and database permissions will be output. A user $name can be specified to filter the results in advance. - : - : @param $name value of type xs:string - : @return value of type element(user)* - : @error user:unknown The specified username is unknown. - :) -declare function user:list-details($name as xs:string) as element(user)* external; - -(:~ - : Checks if a user with the specified $name exists. - : - : @param $name value of type xs:string - : @return value of type xs:boolean - : @error user:name The specified username is invalid. - :) -declare function user:exists($name as xs:string) as xs:boolean external; - -(:~ - : Checks if the specified user and password is correct. Raises errors otherwise. - : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @error user:name The specified username is invalid. - : @error user:unknown The specified user does not exist. - : @error user:password The specified password is wrong. - :) -declare function user:check($name as xs:string, $password as xs:string) as empty-sequence() external; - -(:~ - : Returns an info element, which may contain application-specific data. If a user $name is supplied, a user-specific element is returned. By default, the returned element has no contents. It can be modified via user:update-info . - : - : @return value of type element(info) - :) -declare function user:info() as element(info) external; - -(:~ - : Returns an info element, which may contain application-specific data. If a user $name is supplied, a user-specific element is returned. By default, the returned element has no contents. It can be modified via user:update-info . - : - : @param $name value of type xs:string - : @return value of type element(info) - :) -declare function user:info($name as xs:string) as element(info) external; - -(:~ - : Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
- : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @error user:name The specified username is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:create($name as xs:string, $password as xs:string) as empty-sequence() external; - -(:~ - : Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
- : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @param $permissions value of type xs:string* - : @error user:name The specified username is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:create($name as xs:string, $password as xs:string, $permissions as xs:string*) as empty-sequence() external; - -(:~ - : Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
- : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @param $permissions value of type xs:string* - : @param $patterns value of type xs:string* - : @error user:name The specified username is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:create($name as xs:string, $password as xs:string, $permissions as xs:string*, $patterns as xs:string*) as empty-sequence() external; - -(:~ - : Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
- : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @param $permissions value of type xs:string* - : @param $patterns value of type xs:string* - : @param $info value of type element(info) - : @error user:name The specified username is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:create($name as xs:string, $password as xs:string, $permissions as xs:string*, $patterns as xs:string*, $info as element(info)) as empty-sequence() external; - -(:~ - : Grants global or local $permissions to a user with the specified $name. Local permissions are granted with non-empty glob $patterns. - : - : @param $name value of type xs:string - : @param $permissions value of type xs:string* - : @error user:unknown The specified username is unknown. - : @error user:name The specified username is invalid. - : @error user:pattern The specified database pattern is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:local A local permission can only be 'none', 'read' or 'write'. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:grant($name as xs:string, $permissions as xs:string*) as empty-sequence() external; - -(:~ - : Grants global or local $permissions to a user with the specified $name. Local permissions are granted with non-empty glob $patterns. - : - : @param $name value of type xs:string - : @param $permissions value of type xs:string* - : @param $patterns value of type xs:string* - : @error user:unknown The specified username is unknown. - : @error user:name The specified username is invalid. - : @error user:pattern The specified database pattern is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:local A local permission can only be 'none', 'read' or 'write'. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:grant($name as xs:string, $permissions as xs:string*, $patterns as xs:string*) as empty-sequence() external; - -(:~ - : Drops a user with the specified $name. If non-empty glob $patterns are specified, only the database patterns will be removed. - : - : @param $name value of type xs:string - : @error user:unknown The specified username is unknown. - : @error user:name The specified username is invalid. - : @error user:pattern The specified database pattern is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - : @error user:conflict A user cannot be both altered and dropped. - :) -declare function user:drop($name as xs:string) as empty-sequence() external; - -(:~ - : Drops a user with the specified $name. If non-empty glob $patterns are specified, only the database patterns will be removed. - : - : @param $name value of type xs:string - : @param $patterns value of type xs:string* - : @error user:unknown The specified username is unknown. - : @error user:name The specified username is invalid. - : @error user:pattern The specified database pattern is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - : @error user:conflict A user cannot be both altered and dropped. - :) -declare function user:drop($name as xs:string, $patterns as xs:string*) as empty-sequence() external; - -(:~ - : Renames a user with the specified $name to $newname. - : - : @param $name value of type xs:string - : @param $newname value of type xs:string - : @error user:unknown The specified username is unknown. - : @error user:name The specified username is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - : @error user:conflict A user cannot be both altered and dropped. - :) -declare function user:alter($name as xs:string, $newname as xs:string) as empty-sequence() external; - -(:~ - : Changes the password of a user with the specified $name. - : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @error user:unknown The specified username is unknown. - : @error user:name The specified username is invalid. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:password($name as xs:string, $password as xs:string) as empty-sequence() external; - -(:~ - : Assigns the specified $info element to the user management or, if $name is supplied, to a specific user. This function can be used to manage application-specific data (groups, enhanced user info, etc.). - : - : @param $info value of type element(info) - :) -declare function user:update-info($info as element(info)) as empty-sequence() external; - -(:~ - : Assigns the specified $info element to the user management or, if $name is supplied, to a specific user. This function can be used to manage application-specific data (groups, enhanced user info, etc.). - : - : @param $info value of type element(info) - : @param $name value of type xs:string - :) -declare function user:update-info($info as element(info), $name as xs:string) as empty-sequence() external; diff --git a/packages.src/basex-10.0/util.xqm b/packages.src/basex-10.0/util.xqm deleted file mode 100644 index 77cb11a..0000000 --- a/packages.src/basex-10.0/util.xqm +++ /dev/null @@ -1,209 +0,0 @@ -(:~ - : This XQuery Module contains various utility and helper functions. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Utility_Module - :) -module namespace util = "http://basex.org/modules/util"; - -(:~ - : Alternative writing for the if/then/else expression:
  • If the effective boolean value of $condition is true, the $then branch will be evaluated.
  • Otherwise, $else will be evaluated. If no third argument is supplied, an empty sequence will be returned.
- : - : @param $condition value of type item()* - : @param $then value of type item()* - : @return value of type item()* - :) -declare function util:if($condition as item()*, $then as item()*) as item()* external; - -(:~ - : Alternative writing for the if/then/else expression:
  • If the effective boolean value of $condition is true, the $then branch will be evaluated.
  • Otherwise, $else will be evaluated. If no third argument is supplied, an empty sequence will be returned.
- : - : @param $condition value of type item()* - : @param $then value of type item()* - : @param $else value of type item()* - : @return value of type item()* - :) -declare function util:if($condition as item()*, $then as item()*, $else as item()*) as item()* external; - -(:~ - : Returns $items if it is a non-empty sequence. Otherwise, returns $default. Equivalent to the following expressions:
  if ( exists ( $ items )) then $ items else $ default , (: Elvis operator :) $ items ?: $ default 
- : - : @param $items value of type item()* - : @param $default value of type item()* - : @return value of type item()* - :) -declare function util:or($items as item()*, $default as item()*) as item()* external; - -(:~ - : Checks if the specified $sequence has at least $min and, optionally, at most $max items. Equivalent to:
  let $ count := count ( $ sequence ) return $ count >= $ min and $ count <= $ max 
- : - : @param $sequence value of type item()* - : @param $min value of type xs:integer - : @return value of type xs:boolean - :) -declare function util:count-within($sequence as item()*, $min as xs:integer) as xs:boolean external; - -(:~ - : Checks if the specified $sequence has at least $min and, optionally, at most $max items. Equivalent to:
  let $ count := count ( $ sequence ) return $ count >= $ min and $ count <= $ max 
- : - : @param $sequence value of type item()* - : @param $min value of type xs:integer - : @param $max value of type xs:integer - : @return value of type xs:boolean - :) -declare function util:count-within($sequence as item()*, $min as xs:integer, $max as xs:integer) as xs:boolean external; - -(:~ - : Returns the item from $sequence at the specified $position. Equivalent to:
  $ sequence [ $ position ] 
- : - : @param $sequence value of type item()* - : @param $position value of type xs:double - : @return value of type item()? - :) -declare function util:item($sequence as item()*, $position as xs:double) as item()? external; - -(:~ - : Returns items from $sequence, starting at position $first and ending at $last. Equivalent to:
  subsequence ( $ sequence , $ first , $ last - $ first + 1 ) 
- : - : @param $sequence value of type item()* - : @param $first value of type xs:double - : @param $last value of type xs:double - : @return value of type item()* - :) -declare function util:range($sequence as item()*, $first as xs:double, $last as xs:double) as item()* external; - -(:~ - : Returns last item of a $sequence. Equivalent to:
  $ sequence [ last ()] 
- : - : @param $sequence value of type item()* - : @return value of type item()? - :) -declare function util:last($sequence as item()*) as item()? external; - -(:~ - : Returns all items of a $sequence except for the last one. Equivalent to:
  $ sequence [ position () < last ()] 
- : - : @param $sequence value of type item()* - : @return value of type item()* - :) -declare function util:init($sequence as item()*) as item()* external; - -(:~ - : Returns nodes in distinct document order: duplicate nodes will be removed, and the remaining nodes will be returned in document order. As results of path expressions are brought distinct document order before they are returned, the function is equivalent to:
  $ nodes / self :: node () 
- : - : @param $nodes value of type node()* - : @return value of type node()* - :) -declare function util:ddo($nodes as node()*) as node()* external; - -(:~ - : Returns the document nodes of the specified $nodes. The path expression /abc is internally represented as util:root(.)/abc. Equivalent to:
  $ nodes ! / 
- : - : @param $nodes value of type node()* - : @return value of type document-node()* - :) -declare function util:root($nodes as node()*) as document-node()* external; - -(:~ - : Removes namespaces with the specified $prefixes from the supplied $node. An empty string can be supplied to remove the default namespace. If no prefixes are specified, all namespaces will be removed. - : - : @param $node value of type node() - : @return value of type node() - :) -declare function util:strip-namespaces($node as node()) as node() external; - -(:~ - : Removes namespaces with the specified $prefixes from the supplied $node. An empty string can be supplied to remove the default namespace. If no prefixes are specified, all namespaces will be removed. - : - : @param $node value of type node() - : @param $prefixes value of type xs:string* - : @return value of type node() - :) -declare function util:strip-namespaces($node as node(), $prefixes as xs:string*) as node() external; - -(:~ - : Returns each member of an $array as a new array. Equivalent to:
  for $ a in 1 to array:size ( $ array ) return [ $ array ( $ a ) ] 
- : - : @param $array value of type array(*) - : @return value of type array(*)* - :) -declare function util:array-members($array as array(*)) as array(*)* external; - -(:~ - : Returns all members of an $array as a sequence. Equivalent to:
  $ array ? * 
- : - : @param $array value of type array(*) - : @return value of type item()* - :) -declare function util:array-values($array as array(*)) as item()* external; - -(:~ - : Returns each entry of a $map as a new map, each with a key and value entry. Equivalent to:
  map:for-each ( $ map , function ( $ key , $ value ) { map { "key" : $ key , "value" : $ value } }) 
- : - : @param $map value of type map(*) - : @return value of type map(xs:string, item()*)* - :) -declare function util:map-entries($map as map(*)) as map(xs:string, item()*)* external; - -(:~ - : Returns all values of a $map as a sequence. Equivalent to:
  $ map ? * 
- : - : @param $map value of type map(*) - : @return value of type item()* - :) -declare function util:map-values($map as map(*)) as item()* external; - -(:~ - : Evaluates $input and returns the result $count times. Unless $multiple is enabled, the input expression is only evaluated once. Equivalent expressions:
  util:replicate ( $ input , $ count , true ()), ( 1 to $ count ) ! $ input 
- : - : @param $input value of type item()* - : @param $count value of type xs:integer - : @return value of type item()* - : @error util:negative The specified number is negative. - :) -declare function util:replicate($input as item()*, $count as xs:integer) as item()* external; - -(:~ - : Evaluates $input and returns the result $count times. Unless $multiple is enabled, the input expression is only evaluated once. Equivalent expressions:
  util:replicate ( $ input , $ count , true ()), ( 1 to $ count ) ! $ input 
- : - : @param $input value of type item()* - : @param $count value of type xs:integer - : @param $multiple value of type xs:boolean - : @return value of type item()* - : @error util:negative The specified number is negative. - :) -declare function util:replicate($input as item()*, $count as xs:integer, $multiple as xs:boolean) as item()* external; - -(:~ - : Inserts the defined $separator between the $items of a sequence and returns the resulting sequence. Equivalent to:
  head ( $ items ), for $ item in tail ( $ items ) return ( $ separator , $ item ) 
- : - : @param $items value of type item()* - : @param $separator value of type item()* - : @return value of type item()* - :) -declare function util:intersperse($items as item()*, $separator as item()*) as item()* external; - -(:~ - : Returns duplicate values in a $sequence. See fn:distinct-values for the applied equality rules and the usage of the $collation argument. - : - : @param $sequence value of type item()* - : @return value of type xs:anyAtomicType* - :) -declare function util:duplicates($sequence as item()*) as xs:anyAtomicType* external; - -(:~ - : Returns duplicate values in a $sequence. See fn:distinct-values for the applied equality rules and the usage of the $collation argument. - : - : @param $sequence value of type item()* - : @param $collation value of type xs:string - : @return value of type xs:anyAtomicType* - :) -declare function util:duplicates($sequence as item()*, $collation as xs:string) as xs:anyAtomicType* external; - -(:~ - : Returns all characters of a $string as a sequence. Equivalent to:
  for $ cp in string-to-codepoints ( $ string ) return codepoints-to-string ( $ cp ) 
- : - : @param $string value of type xs:string? - : @return value of type xs:string* - :) -declare function util:chars($string as xs:string?) as xs:string* external; diff --git a/packages.src/basex-10.0/validate.xqm b/packages.src/basex-10.0/validate.xqm deleted file mode 100644 index 800f295..0000000 --- a/packages.src/basex-10.0/validate.xqm +++ /dev/null @@ -1,252 +0,0 @@ -(:~ - : This XQuery Module contains functions to perform validations against DTDs, XML Schema and RelaxNG. The documentation further describes how to use Schematron validation with BaseX. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Validation_Module - :) -module namespace validate = "http://basex.org/modules/validate"; - -(:~ - : Validates the XML $input document against a $schema and returns an empty sequence or an error. - : - : @param $input value of type item() - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd($input as item()) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema and returns an empty sequence or an error. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd($input as item(), $schema as xs:string?) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd-info($input as item()) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd-info($input as item(), $schema as xs:string?) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd-report($input as item()) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd-report($input as item(), $schema as xs:string?) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features. - : - : @param $input value of type item() - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd($input as item()) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features. - : - : @param $input value of type item() - : @param $schema value of type item()? - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd($input as item(), $schema as item()?) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features. - : - : @param $input value of type item() - : @param $schema value of type item()? - : @param $features value of type map(*) - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd($input as item(), $schema as item()?, $features as map(*)) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd-info($input as item()) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type item()? - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd-info($input as item(), $schema as item()?) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type item()? - : @param $features value of type map(*) - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd-info($input as item(), $schema as item()?, $features as map(*)) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd-report($input as item()) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd-report($input as item(), $schema as xs:string?) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @param $features value of type map(*) - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd-report($input as item(), $schema as xs:string?, $features as map(*)) as element(report) external; - -(:~ - : Returns the name of the applied XSD processor. - : - : @return value of type xs:string - :) -declare function validate:xsd-processor() as xs:string external; - -(:~ - : Returns the supported version of XSD Schema. - : - : @return value of type xs:string - :) -declare function validate:xsd-version() as xs:string external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation. - : - : @param $input value of type item() - : @param $schema value of type item() - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found the RelaxNG validator is not available. - :) -declare function validate:rng($input as item(), $schema as item()) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation. - : - : @param $input value of type item() - : @param $schema value of type item() - : @param $compact value of type xs:boolean - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found the RelaxNG validator is not available. - :) -declare function validate:rng($input as item(), $schema as item(), $compact as xs:boolean) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type item() - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found the RelaxNG validator is not available. - :) -declare function validate:rng-info($input as item(), $schema as item()) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type item() - : @param $compact value of type xs:boolean - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found the RelaxNG validator is not available. - :) -declare function validate:rng-info($input as item(), $schema as item(), $compact as xs:boolean) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found The RelaxNG validator is not available. - :) -declare function validate:rng-report($input as item(), $schema as xs:string) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string - : @param $compact value of type xs:boolean - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found The RelaxNG validator is not available. - :) -declare function validate:rng-report($input as item(), $schema as xs:string, $compact as xs:boolean) as element(report) external; diff --git a/packages.src/basex-10.0/web.xqm b/packages.src/basex-10.0/web.xqm deleted file mode 100644 index 49f8af6..0000000 --- a/packages.src/basex-10.0/web.xqm +++ /dev/null @@ -1,139 +0,0 @@ -(:~ - : This XQuery Module provides convenience functions for building web applications with RESTXQ. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/Web_Module - :) -module namespace web = "http://basex.org/modules/web"; - -(:~ - : Returns the content type of a path by analyzing its file suffix. application/octet-stream is returned if the file suffix is unknown. - : - : @param $path value of type xs:string - : @return value of type xs:string - :) -declare function web:content-type($path as xs:string) as xs:string external; - -(:~ - : Creates a new URL from the specified $url string, query string $parameters and an optional $anchor reference. The keys and values of the map entries will be converted to strings, URL-encoded (see web:encode-url ), and appended to the URL as query parameters. If a map entry has more than a single item, all of them will be appended as single parameters. - : - : @param $url value of type xs:string - : @param $parameters value of type map(*) - : @return value of type xs:string - :) -declare function web:create-url($url as xs:string, $parameters as map(*)) as xs:string external; - -(:~ - : Creates a new URL from the specified $url string, query string $parameters and an optional $anchor reference. The keys and values of the map entries will be converted to strings, URL-encoded (see web:encode-url ), and appended to the URL as query parameters. If a map entry has more than a single item, all of them will be appended as single parameters. - : - : @param $url value of type xs:string - : @param $parameters value of type map(*) - : @param $anchor value of type xs:string - : @return value of type xs:string - :) -declare function web:create-url($url as xs:string, $parameters as map(*), $anchor as xs:string) as xs:string external; - -(:~ - : Encodes a string to a URL. Spaces are rewritten to +; *, -, . and _ are adopted; and all other non-ASCII characters and special characters are percent-encoded. - : - : @param $string value of type xs:string - : @return value of type xs:string - :) -declare function web:encode-url($string as xs:string) as xs:string external; - -(:~ - : Decodes a URL to the original string. Percent-encoded characters are decoded to their UTF8 codepoints, and + characters are rewritten to spaces. - : - : @param $string value of type xs:string - : @return value of type xs:string - : @error web:invalid the string contains invalid XML characters. - :) -declare function web:decode-url($string as xs:string) as xs:string external; - -(:~ - : Creates a server-side RESTXQ forward request to the specified $path:
  • The client will not get notified of this forwarding.
  • Supplied query parameters will be attached to parameters of the current request.
  • The $parameter argument is processed as described in web:create-url .
- : - : @param $path value of type xs:string - : @return value of type element(rest:forward) - :) -declare function web:forward($path as xs:string) as element(rest:forward) external; - -(:~ - : Creates a server-side RESTXQ forward request to the specified $path:
  • The client will not get notified of this forwarding.
  • Supplied query parameters will be attached to parameters of the current request.
  • The $parameter argument is processed as described in web:create-url .
- : - : @param $path value of type xs:string - : @param $parameters value of type map(*) - : @return value of type element(rest:forward) - :) -declare function web:forward($path as xs:string, $parameters as map(*)) as element(rest:forward) external; - -(:~ - : Creates a RESTXQ redirection to the specified $url. The returned response will only work if no other items are returned by the RESTXQ function.
The $parameters and $anchor arguments are processed as described in (see web:create-url ). - : - : @param $url value of type xs:string - : @return value of type element(rest:response) - :) -declare function web:redirect($url as xs:string) as element(rest:response) external; - -(:~ - : Creates a RESTXQ redirection to the specified $url. The returned response will only work if no other items are returned by the RESTXQ function.
The $parameters and $anchor arguments are processed as described in (see web:create-url ). - : - : @param $url value of type xs:string - : @param $parameters value of type map(*) - : @return value of type element(rest:response) - :) -declare function web:redirect($url as xs:string, $parameters as map(*)) as element(rest:response) external; - -(:~ - : Creates a RESTXQ redirection to the specified $url. The returned response will only work if no other items are returned by the RESTXQ function.
The $parameters and $anchor arguments are processed as described in (see web:create-url ). - : - : @param $url value of type xs:string - : @param $parameters value of type map(*) - : @param $anchor value of type xs:string - : @return value of type element(rest:response) - :) -declare function web:redirect($url as xs:string, $parameters as map(*), $anchor as xs:string) as element(rest:response) external; - -(:~ - : Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
- : - : @return value of type element(rest:response) - :) -declare function web:response-header() as element(rest:response) external; - -(:~ - : Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
- : - : @param $output value of type map(*)? - : @return value of type element(rest:response) - :) -declare function web:response-header($output as map(*)?) as element(rest:response) external; - -(:~ - : Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
- : - : @param $output value of type map(*)? - : @param $headers value of type map(*)? - : @return value of type element(rest:response) - :) -declare function web:response-header($output as map(*)?, $headers as map(*)?) as element(rest:response) external; - -(:~ - : Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
- : - : @param $output value of type map(*)? - : @param $headers value of type map(*)? - : @param $atts value of type map(*)? - : @return value of type element(rest:response) - :) -declare function web:response-header($output as map(*)?, $headers as map(*)?, $atts as map(*)?) as element(rest:response) external; - -(:~ - : Raises an error with the QName rest:error, the specified $message and the specified $status as error value.
Calls to this function are equivalent to fn:error(xs:QName('rest:error'), $message, $status).

See RESTXQ: Raise Errors to learn how the function is helpful in web applications.

- : - : @param $status value of type xs:integer - : @param $message value of type xs:string - : @return value of type none - : @error web:status The supplied status code is invalid. - :) -declare function web:error($status as xs:integer, $message as xs:string) as none external; diff --git a/packages.src/basex-10.0/ws.xqm b/packages.src/basex-10.0/ws.xqm deleted file mode 100644 index 24b2872..0000000 --- a/packages.src/basex-10.0/ws.xqm +++ /dev/null @@ -1,134 +0,0 @@ -(:~ - : This XQuery Module contains functions for accessing specific WebSocket functions. This module is mainly useful in the context of WebSockets. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/WebSocket_Module - :) -module namespace ws = "http://basex.org/modules/ws"; - -(:~ - : Returns the ID of the current WebSocket. - : - : @return value of type xs:string - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:id() as xs:string external; - -(:~ - : Returns the ids of all currently registered WebSockets. - : - : @return value of type xs:string* - :) -declare function ws:ids() as xs:string* external; - -(:~ - : Returns the path of the WebSocket with the specified $id. - : - : @param $id value of type xs:string - : @return value of type xs:string - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:path($id as xs:string) as xs:string external; - -(:~ - : Closes the connection of the WebSocket with the specified $id. - : - : @param $id value of type xs:string - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:close($id as xs:string) as empty-sequence() external; - -(:~ - : Sends a $message to the clients with the specified $ids. Ids that cannot be assigned to clients will be ignored. The message will be handled as follows:
  • Items of type xs:base64Binary and xs:hexBinary will be transmitted as binary messages.
  • Function items (maps, arrays) will be serialized as JSON and transmitted as string messages.
  • All other items will be serialized with the default serialization options and transmitted as string messages.
- : - : @param $message value of type item() - : @param $ids value of type xs:string* - :) -declare function ws:send($message as item(), $ids as xs:string*) as empty-sequence() external; - -(:~ - : Broadcasts a $message to all connected clients except to the caller. Invocations of this convenience function are equivalent to ws:send($message, ws:ids()[. != ws:id()]). See ws:send for more details on the message handling. - : - : @param $message value of type xs:anyAtomicType - :) -declare function ws:broadcast($message as xs:anyAtomicType) as empty-sequence() external; - -(:~ - : Emits a $message to all connected clients. Invocations of this function are equivalent to ws:send($message, ws:ids()). See ws:send for more details on the message handling. - : - : @param $message value of type xs:anyAtomicType - :) -declare function ws:emit($message as xs:anyAtomicType) as empty-sequence() external; - -(:~ - : Schedules the evaluation of the supplied $query and returns the result to the calling WebSocket client. The query can be a URI or a string, and variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.

Query scheduling is recommendable if the immediate query execution might be too time consuming and lead to a timeout.

- : - : @param $query value of type xs:anyAtomicType - : @return value of type xs:string - : @error ws:overflow Query execution is rejected, because too many jobs are queued or being executed. - : @error ws:id The specified id is invalid or has already been assigned. - :) -declare function ws:eval($query as xs:anyAtomicType) as xs:string external; - -(:~ - : Schedules the evaluation of the supplied $query and returns the result to the calling WebSocket client. The query can be a URI or a string, and variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.

Query scheduling is recommendable if the immediate query execution might be too time consuming and lead to a timeout.

- : - : @param $query value of type xs:anyAtomicType - : @param $bindings value of type map(*)? - : @return value of type xs:string - : @error ws:overflow Query execution is rejected, because too many jobs are queued or being executed. - : @error ws:id The specified id is invalid or has already been assigned. - :) -declare function ws:eval($query as xs:anyAtomicType, $bindings as map(*)?) as xs:string external; - -(:~ - : Schedules the evaluation of the supplied $query and returns the result to the calling WebSocket client. The query can be a URI or a string, and variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.

Query scheduling is recommendable if the immediate query execution might be too time consuming and lead to a timeout.

- : - : @param $query value of type xs:anyAtomicType - : @param $bindings value of type map(*)? - : @param $options value of type map(*)? - : @return value of type xs:string - : @error ws:overflow Query execution is rejected, because too many jobs are queued or being executed. - : @error ws:id The specified id is invalid or has already been assigned. - :) -declare function ws:eval($query as xs:anyAtomicType, $bindings as map(*)?, $options as map(*)?) as xs:string external; - -(:~ - : Returns the value of an attribute with the specified $name from the WebSocket with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @return value of type item()* - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:get($id as xs:string, $name as xs:string) as item()* external; - -(:~ - : Returns the value of an attribute with the specified $name from the WebSocket with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @param $default value of type item()* - : @return value of type item()* - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:get($id as xs:string, $name as xs:string, $default as item()*) as item()* external; - -(:~ - : Returns the specified value of the attribute with the specified $name from the WebSocket with the specified $id. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @param $value value of type item()* - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:set($id as xs:string, $name as xs:string, $value as item()*) as empty-sequence() external; - -(:~ - : Deletes an attribute with the specified $name from the WebSocket with the specified $id. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:delete($id as xs:string, $name as xs:string) as empty-sequence() external; diff --git a/packages.src/basex-10.0/xquery.xqm b/packages.src/basex-10.0/xquery.xqm deleted file mode 100644 index ecce963..0000000 --- a/packages.src/basex-10.0/xquery.xqm +++ /dev/null @@ -1,117 +0,0 @@ -(:~ - : This XQuery Module contains functions for parsing and evaluating XQuery strings at runtime, and to run code in parallel. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/XQuery_Module - :) -module namespace xquery = "http://basex.org/modules/xquery"; - -(:~ - : Evaluates the supplied $query and returns the resulting items. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string.

Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:

  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. Overwrites the base URI of the query; will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
- : - : @param $query value of type xs:anyAtomicType - : @return value of type item()* - : @error xquery:update the query contains updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval($query as xs:anyAtomicType) as item()* external; - -(:~ - : Evaluates the supplied $query and returns the resulting items. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string.

Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:

  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. Overwrites the base URI of the query; will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
- : - : @param $query value of type xs:anyAtomicType - : @param $bindings value of type map(*)? - : @return value of type item()* - : @error xquery:update the query contains updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval($query as xs:anyAtomicType, $bindings as map(*)?) as item()* external; - -(:~ - : Evaluates the supplied $query and returns the resulting items. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string.

Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:

  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. Overwrites the base URI of the query; will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
- : - : @param $query value of type xs:anyAtomicType - : @param $bindings value of type map(*)? - : @param $options value of type map(*)? - : @return value of type item()* - : @error xquery:update the query contains updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval($query as xs:anyAtomicType, $bindings as map(*)?, $options as map(*)?) as item()* external; - -(:~ - : Evaluates a query as updating expression. All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules for all arguments are the same as for xquery:eval . - : - : @param $query value of type xs:anyAtomicType - : @return value of type item()* - : @error xquery:update the query contains no updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval-update($query as xs:anyAtomicType) as item()* external; - -(:~ - : Evaluates a query as updating expression. All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules for all arguments are the same as for xquery:eval . - : - : @param $query value of type xs:anyAtomicType - : @param $bindings value of type map(*)? - : @return value of type item()* - : @error xquery:update the query contains no updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval-update($query as xs:anyAtomicType, $bindings as map(*)?) as item()* external; - -(:~ - : Evaluates a query as updating expression. All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules for all arguments are the same as for xquery:eval . - : - : @param $query value of type xs:anyAtomicType - : @param $bindings value of type map(*)? - : @param $options value of type map(*)? - : @return value of type item()* - : @error xquery:update the query contains no updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval-update($query as xs:anyAtomicType, $bindings as map(*)?, $options as map(*)?) as item()* external; - -(:~ - : Parses the specified $query as XQuery module and returns the resulting query plan. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string. The $options parameter influences the output:
  • compile: additionally compiles the query after parsing it. By default, this option is false.
  • plan: returns an XML representation of the internal query plan. By default, this option is true. The naming of the expressions in the query plan may change over time
  • pass: by default, the option is false. If an error is raised, the line/column number and the optional file uri will refer to the location of the function call. If the option is enabled, the line/column and file uri will be adopted from the raised error.
  • base-uri: set base-uri property for the query. This URI will be used when resolving relative URIs by functions such as fn:doc.
- : - : @param $query value of type xs:anyAtomicType - : @return value of type item()? - :) -declare function xquery:parse($query as xs:anyAtomicType) as item()? external; - -(:~ - : Parses the specified $query as XQuery module and returns the resulting query plan. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string. The $options parameter influences the output:
  • compile: additionally compiles the query after parsing it. By default, this option is false.
  • plan: returns an XML representation of the internal query plan. By default, this option is true. The naming of the expressions in the query plan may change over time
  • pass: by default, the option is false. If an error is raised, the line/column number and the optional file uri will refer to the location of the function call. If the option is enabled, the line/column and file uri will be adopted from the raised error.
  • base-uri: set base-uri property for the query. This URI will be used when resolving relative URIs by functions such as fn:doc.
- : - : @param $query value of type xs:anyAtomicType - : @param $options value of type map(*)? - : @return value of type item()? - :) -declare function xquery:parse($query as xs:anyAtomicType, $options as map(*)?) as item()? external; - -(:~ - : This function executes the supplied (non-updating) functions in parallel. - : - : @param $functions value of type function(*)* - : @return value of type item()* - : @error xquery:error an unexpected error occurred. - :) -declare function xquery:fork-join($functions as function(*)*) as item()* external; diff --git a/packages.src/basex-10.0/xslt.xqm b/packages.src/basex-10.0/xslt.xqm deleted file mode 100644 index da0ec53..0000000 --- a/packages.src/basex-10.0/xslt.xqm +++ /dev/null @@ -1,111 +0,0 @@ -(:~ - : This XQuery Module contains functions and variables to perform XSL transformations. - : - : @author BaseX Team - : @see https://docs.basex.org/wiki/XSLT_Module - :) -module namespace xslt = "http://basex.org/modules/xslt"; - -(:~ - : Returns the name of the applied XSLT processor, or the path to a custom implementation (currently: "Java", "Saxon EE", "Saxon PE", or "Saxon HE").
- : - : @return value of type xs:string - :) -declare function xslt:processor() as xs:string external; - -(:~ - : Returns the supported XSLT version (currently: "1.0" or "3.0"). "Unknown" is returned if a custom implementation was chosen.
- : - : @return value of type xs:string - :) -declare function xslt:version() as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

XML Catalog files will be considered when resolving URIs. Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available:

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @return value of type node() - :) -declare function xslt:transform($input as item(), $stylesheet as item()) as node() external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

XML Catalog files will be considered when resolving URIs. Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available:

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $params value of type map(*)? - : @return value of type node() - :) -declare function xslt:transform($input as item(), $stylesheet as item(), $params as map(*)?) as node() external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

XML Catalog files will be considered when resolving URIs. Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available:

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $args value of type map(*)? - : @param $options value of type map(*)? - : @return value of type node() - :) -declare function xslt:transform($input as item(), $stylesheet as item(), $args as map(*)?, $options as map(*)?) as node() external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform .
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @return value of type xs:string - :) -declare function xslt:transform-text($input as item(), $stylesheet as item()) as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform .
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $params value of type map(*)? - : @return value of type xs:string - :) -declare function xslt:transform-text($input as item(), $stylesheet as item(), $params as map(*)?) as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform .
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $params value of type map(*)? - : @param $options value of type map(*)? - : @return value of type xs:string - :) -declare function xslt:transform-text($input as item(), $stylesheet as item(), $params as map(*)?, $options as map(*)?) as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns a map with the following keys:
  • result: The transformation result: One or more document nodes, or (if the result cannot be converted to XML) an item of type xs:untypedAtomic.
  • messages: Informational output generated by xsl:message elements: A sequence of arrays. The arrays consist of XML elements, or (for those messages that cannot be converted to XML) items of type xs:untypedAtomic.

The semantics of $params and $options is the same as for xslt:transform .
For the moment, messages can only be returned with recent versions of Saxon.

  • error (optional): An error string, which would be raised as an error by the other functions of this module.
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @return value of type xs:string - :) -declare function xslt:transform-report($input as item(), $stylesheet as item()) as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns a map with the following keys:
  • result: The transformation result: One or more document nodes, or (if the result cannot be converted to XML) an item of type xs:untypedAtomic.
  • messages: Informational output generated by xsl:message elements: A sequence of arrays. The arrays consist of XML elements, or (for those messages that cannot be converted to XML) items of type xs:untypedAtomic.

The semantics of $params and $options is the same as for xslt:transform .
For the moment, messages can only be returned with recent versions of Saxon.

  • error (optional): An error string, which would be raised as an error by the other functions of this module.
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $params value of type map(*)? - : @return value of type xs:string - :) -declare function xslt:transform-report($input as item(), $stylesheet as item(), $params as map(*)?) as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns a map with the following keys:
  • result: The transformation result: One or more document nodes, or (if the result cannot be converted to XML) an item of type xs:untypedAtomic.
  • messages: Informational output generated by xsl:message elements: A sequence of arrays. The arrays consist of XML elements, or (for those messages that cannot be converted to XML) items of type xs:untypedAtomic.

The semantics of $params and $options is the same as for xslt:transform .
For the moment, messages can only be returned with recent versions of Saxon.

  • error (optional): An error string, which would be raised as an error by the other functions of this module.
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $params value of type map(*)? - : @param $options value of type map(*)? - : @return value of type xs:string - :) -declare function xslt:transform-report($input as item(), $stylesheet as item(), $params as map(*)?, $options as map(*)?) as xs:string external; diff --git a/packages.src/basex-9.6/admin.xqm b/packages.src/basex-9.6/admin.xqm deleted file mode 100644 index b805120..0000000 --- a/packages.src/basex-9.6/admin.xqm +++ /dev/null @@ -1,64 +0,0 @@ -(:~ - : This XQuery Module contains functions for performing admin-centric operations such as managing database users and log data. - : - : @author BaseX Team - : @see /wiki/Admin_Module - :) -module namespace admin = "http://basex.org/modules/admin"; - -(:~ - : Returns an element sequence with all currently opened database sessions, including the user name, address (IP:port) and an optionally opened database.
The output of this function and the SHOW SESSIONS command is similar. - : - : @return value of type element(session)* - :) -declare function admin:sessions() as element(session)* external; - -(:~ - : Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
- : - : @return value of type element(file)* - :) -declare function admin:logs() as element(file)* external; - -(:~ - : Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
- : - : @param $date value of type xs:string - : @return value of type element(entry)* - :) -declare function admin:logs($date as xs:string) as element(entry)* external; - -(:~ - : Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
- : - : @param $date value of type xs:string - : @param $merge value of type xs:boolean - : @return value of type element(entry)* - :) -declare function admin:logs($date as xs:string, $merge as xs:boolean) as element(entry)* external; - -(:~ - : Writes a string to the database logs, along with current user data (timestamp, user name). An optional log $type can be specified, which must consist of letters in upper case. If omitted, the log type is INFO.
If the function is called from a database client, the IP will be logged. Otherwise, the string SERVER will be logged. - : - : @param $text value of type xs:string - : @error admin:type Log type must consist of uppercase letters. - :) -declare function admin:write-log($text as xs:string) as empty-sequence() external; - -(:~ - : Writes a string to the database logs, along with current user data (timestamp, user name). An optional log $type can be specified, which must consist of letters in upper case. If omitted, the log type is INFO.
If the function is called from a database client, the IP will be logged. Otherwise, the string SERVER will be logged. - : - : @param $text value of type xs:string - : @param $type value of type xs:string - : @error admin:type Log type must consist of uppercase letters. - :) -declare function admin:write-log($text as xs:string, $type as xs:string) as empty-sequence() external; - -(:~ - : Deletes the log entries from the specified $date - : - : @param $date value of type xs:string - : @error admin:today Today's log file cannot be deleted. - : @error admin:delete An error occurred while deleting a log file. - :) -declare function admin:delete-logs($date as xs:string) as empty-sequence() external; diff --git a/packages.src/basex-9.6/archive.xqm b/packages.src/basex-9.6/archive.xqm deleted file mode 100644 index 5333107..0000000 --- a/packages.src/basex-9.6/archive.xqm +++ /dev/null @@ -1,193 +0,0 @@ -(:~ - : This XQuery Module contains functions to handle archives (including ePub, Open Office, JAR, and many other formats). New ZIP and GZIP archives can be created, existing archives can be updated, and the archive entries can be listed and extracted. The archive:extract-binary function includes an example for writing the contents of an archive to disk. - : - : @author BaseX Team - : @see /wiki/Archive_Module - :) -module namespace archive = "http://basex.org/modules/archive"; - -(:~ - : Creates a new archive from the specified entries and contents.
The $entries argument contains meta information required to create new entries. All items may either be of type xs:string, representing the entry name, or element(archive:entry), containing the name as text node and additional, optional attributes:
  • last-modified: timestamp, specified as xs:dateTime (default: current time)
  • compression-level: 0-9, 0 = uncompressed (default: 8)
  • encoding: for textual entries (default: UTF-8)

An example:

 <archive:entry last-modified='2011-11-11T11:11:11' compression-level='8' encoding='US-ASCII'>hello.txt</archive:entry> 

The actual $contents must be xs:string or xs:base64Binary items.
The $options parameter contains archiving options:

  • format: allowed values are zip and gzip. zip is the default.
  • algorithm: allowed values are deflate and stored (for the zip format). deflate is the default.
- : - : @param $entries value of type item() - : @param $contents value of type item()* - : @return value of type xs:base64Binary - : @error archive:number the number of entries and contents differs. - : @error archive:format the specified option or its value is invalid or not supported. - : @error archive:descriptor entry descriptors contain invalid entry names, timestamps or compression levels. - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if the CHECKSTRINGS option is turned off. - : @error archive:single the chosen archive format only allows single entries. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:create($entries as item(), $contents as item()*) as xs:base64Binary external; - -(:~ - : Creates a new archive from the specified entries and contents.
The $entries argument contains meta information required to create new entries. All items may either be of type xs:string, representing the entry name, or element(archive:entry), containing the name as text node and additional, optional attributes:
  • last-modified: timestamp, specified as xs:dateTime (default: current time)
  • compression-level: 0-9, 0 = uncompressed (default: 8)
  • encoding: for textual entries (default: UTF-8)

An example:

 <archive:entry last-modified='2011-11-11T11:11:11' compression-level='8' encoding='US-ASCII'>hello.txt</archive:entry> 

The actual $contents must be xs:string or xs:base64Binary items.
The $options parameter contains archiving options:

  • format: allowed values are zip and gzip. zip is the default.
  • algorithm: allowed values are deflate and stored (for the zip format). deflate is the default.
- : - : @param $entries value of type item() - : @param $contents value of type item()* - : @param $options value of type map(*)? - : @return value of type xs:base64Binary - : @error archive:number the number of entries and contents differs. - : @error archive:format the specified option or its value is invalid or not supported. - : @error archive:descriptor entry descriptors contain invalid entry names, timestamps or compression levels. - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if the CHECKSTRINGS option is turned off. - : @error archive:single the chosen archive format only allows single entries. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:create($entries as item(), $contents as item()*, $options as map(*)?) as xs:base64Binary external; - -(:~ - : This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is the same as for archive:create. - : - : @param $path value of type xs:string - : @return value of type xs:base64Binary - : @error file:no-dir the specified path does not point to a directory. - : @error file:is-dir one of the specified entries points to a directory. - : @error file:not-found a specified entry does not exist. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:create-from($path as xs:string) as xs:base64Binary external; - -(:~ - : This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is the same as for archive:create. - : - : @param $path value of type xs:string - : @param $options value of type map(*)? - : @return value of type xs:base64Binary - : @error file:no-dir the specified path does not point to a directory. - : @error file:is-dir one of the specified entries points to a directory. - : @error file:not-found a specified entry does not exist. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:create-from($path as xs:string, $options as map(*)?) as xs:base64Binary external; - -(:~ - : This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is the same as for archive:create. - : - : @param $path value of type xs:string - : @param $options value of type map(*)? - : @param $entries value of type item()* - : @return value of type xs:base64Binary - : @error file:no-dir the specified path does not point to a directory. - : @error file:is-dir one of the specified entries points to a directory. - : @error file:not-found a specified entry does not exist. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:create-from($path as xs:string, $options as map(*)?, $entries as item()*) as xs:base64Binary external; - -(:~ - : Returns the entry descriptors of the specified $archive. A descriptor contains the following attributes, provided that they are available in the archive format:
  • size: original file size
  • last-modified: timestamp, formatted as xs:dateTime
  • compressed-size: compressed file size

An example:

 <archive:entry size="1840" last-modified="2009-03-20T03:30:32" compressed-size="672"> doc/index.html </archive:entry> 
- : - : @param $archive value of type xs:base64Binary - : @return value of type element(archive:entry)* - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:entries($archive as xs:base64Binary) as element(archive:entry)* external; - -(:~ - : Returns the options of the specified $archive in the format specified by archive:create. - : - : @param $archive value of type xs:base64Binary - : @return value of type map(*) - : @error archive:format The packing format is not supported. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:options($archive as xs:base64Binary) as map(*) external; - -(:~ - : Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding. - : - : @param $archive value of type xs:base64Binary - : @return value of type xs:string* - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if the CHECKSTRINGS option is turned off. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:extract-text($archive as xs:base64Binary) as xs:string* external; - -(:~ - : Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding. - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @return value of type xs:string* - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if the CHECKSTRINGS option is turned off. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:extract-text($archive as xs:base64Binary, $entries as item()*) as xs:string* external; - -(:~ - : Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding. - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @param $encoding value of type xs:string - : @return value of type xs:string* - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if the CHECKSTRINGS option is turned off. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:extract-text($archive as xs:base64Binary, $entries as item()*, $encoding as xs:string) as xs:string* external; - -(:~ - : Extracts entries of the specified $archive and returns them as binaries.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored). - : - : @param $archive value of type xs:base64Binary - : @return value of type xs:base64Binary* - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:extract-binary($archive as xs:base64Binary) as xs:base64Binary* external; - -(:~ - : Extracts entries of the specified $archive and returns them as binaries.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored). - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @return value of type xs:base64Binary* - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:extract-binary($archive as xs:base64Binary, $entries as item()*) as xs:base64Binary* external; - -(:~ - : This convenience function writes files of an $archive directly to the specified directory $path.
The archive entries to be written can be restricted via $entries. The format of the argument is the same as for archive:create (attributes will be ignored). - : - : @param $path value of type xs:string - : @param $archive value of type xs:base64Binary - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:extract-to($path as xs:string, $archive as xs:base64Binary) as empty-sequence() external; - -(:~ - : This convenience function writes files of an $archive directly to the specified directory $path.
The archive entries to be written can be restricted via $entries. The format of the argument is the same as for archive:create (attributes will be ignored). - : - : @param $path value of type xs:string - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:extract-to($path as xs:string, $archive as xs:base64Binary, $entries as item()*) as empty-sequence() external; - -(:~ - : Creates an updated version of the specified $archive with new or replaced entries.
The format of $entries and $contents is the same as for archive:create. - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @param $contents value of type item()* - : @return value of type xs:base64Binary - : @error archive:number the number of entries and contents differs. - : @error archive:descriptor entry descriptors contain invalid entry names, timestamps, compression levels or encodings. - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if the CHECKSTRINGS option is turned off. - : @error archive:modify the entries of the given archive cannot be modified. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:update($archive as xs:base64Binary, $entries as item()*, $contents as item()*) as xs:base64Binary external; - -(:~ - : Deletes entries from an $archive.
The format of $entries is the same as for archive:create. - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @return value of type xs:base64Binary - : @error archive:modify the entries of the given archive cannot be modified. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:delete($archive as xs:base64Binary, $entries as item()*) as xs:base64Binary external; diff --git a/packages.src/basex-9.6/bin.xqm b/packages.src/basex-9.6/bin.xqm deleted file mode 100644 index e6cb9e5..0000000 --- a/packages.src/basex-9.6/bin.xqm +++ /dev/null @@ -1,419 +0,0 @@ -(:~ - : This XQuery Module contains functions to process binary data, including extracting subparts, searching, basic binary operations and conversion between binary and structured forms. This module is based on the EXPath Binary Module. - : - : @author BaseX Team - : @see /wiki/Binary_Module - :) -module namespace bin = "http://expath.org/ns/binary"; - -(:~ - : Returns the binary form of the set of octets written as a sequence of (ASCII) hex digits ([0-9A-Fa-f]).
$in will be effectively zero-padded from the left to generate an integral number of octets, i.e. an even number of hexadecimal digits. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:string? - : @return value of type xs:base64Binary? - : @error bin:non-numeric-character the input cannot be parsed as a hexadecimal number. - :) -declare function bin:hex($in as xs:string?) as xs:base64Binary? external; - -(:~ - : Returns the binary form of the set of octets written as a sequence of (8-wise) (ASCII) binary digits ([01]).
$in will be effectively zero-padded from the left to generate an integral number of octets. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:string? - : @return value of type xs:base64Binary? - : @error bin:non-numeric-character the input cannot be parsed as a binary number. - :) -declare function bin:bin($in as xs:string?) as xs:base64Binary? external; - -(:~ - : Returns the binary form of the set of octets written as a sequence of (ASCII) octal digits ([0-7]).
$in will be effectively zero-padded from the left to generate an integral number of octets. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:string? - : @return value of type xs:base64Binary? - : @error bin:non-numeric-character the input cannot be parsed as an octal number. - :) -declare function bin:octal($in as xs:string?) as xs:base64Binary? external; - -(:~ - : Returns binary data as a sequence of octets.
If $in is a zero length binary data then the empty sequence is returned. Octets are returned as integers from 0 to 255. - : - : @param $in value of type xs:base64Binary - : @return value of type xs:integer* - :) -declare function bin:to-octets($in as xs:base64Binary) as xs:integer* external; - -(:~ - : Converts a sequence of octets into binary data.
Octets are integers from 0 to 255. If the value of $in is the empty sequence, the function returns zero-sized binary data. - : - : @param $in value of type xs:integer* - : @return value of type xs:base64Binary - : @error bin:octet-out-of-range one of the octets lies outside the range 0 - 255. - :) -declare function bin:from-octets($in as xs:integer*) as xs:base64Binary external; - -(:~ - : Returns the size of binary data in octets. - : - : @param $in value of type xs:base64Binary - : @return value of type xs:integer - :) -declare function bin:length($in as xs:base64Binary) as xs:integer external; - -(:~ - : Returns a section of binary data starting at the $offset octet.
If $size is specified, the size of the returned binary data is $size octets. If $size is absent, all remaining data from $offset is returned. The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $offset value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - :) -declare function bin:part($in as xs:base64Binary?, $offset as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns a section of binary data starting at the $offset octet.
If $size is specified, the size of the returned binary data is $size octets. If $size is absent, all remaining data from $offset is returned. The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - :) -declare function bin:part($in as xs:base64Binary?, $offset as xs:integer, $size as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by concatenating the items in the sequence $in, in order. If the value of $in is the empty sequence, the function returns a binary item containing no data bytes. - : - : @param $in value of type xs:base64Binary* - : @return value of type xs:base64Binary - :) -declare function bin:join($in as xs:base64Binary*) as xs:base64Binary external; - -(:~ - : Returns binary data consisting sequentially of the data from $in up to and including the $offset - 1 octet, followed by all the data from $extra, and then the remaining data from $in.
The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $offset value of type xs:integer - : @param $extra value of type xs:base64Binary? - : @return value of type xs:base64Binary? - : @error bin:index-out-of-range the specified offset is out of range. - :) -declare function bin:insert-before($in as xs:base64Binary?, $offset as xs:integer, $extra as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by padding the input with $size octets in front of the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $size value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:octet-out-of-range the specified octet lies outside the range 0-255. - :) -declare function bin:pad-left($in as xs:base64Binary?, $size as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by padding the input with $size octets in front of the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $size value of type xs:integer - : @param $octet value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:octet-out-of-range the specified octet lies outside the range 0-255. - :) -declare function bin:pad-left($in as xs:base64Binary?, $size as xs:integer, $octet as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by padding the input with $size octets after the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $size value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:octet-out-of-range the specified octet lies outside the range 0-255. - :) -declare function bin:pad-right($in as xs:base64Binary?, $size as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by padding the input with $size octets after the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $size value of type xs:integer - : @param $octet value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:octet-out-of-range the specified octet lies outside the range 0-255. - :) -declare function bin:pad-right($in as xs:base64Binary?, $size as xs:integer, $octet as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns the first location of the binary search sequence in the input, or if not found, the empty sequence.
The $offset and the returned location are zero based. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $offset value of type xs:integer - : @param $search value of type xs:base64Binary - : @return value of type xs:integer? - : @error bin:index-out-of-range the specified offset + size is out of range. - :) -declare function bin:find($in as xs:base64Binary?, $offset as xs:integer, $search as xs:base64Binary) as xs:integer? external; - -(:~ - : Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $encoding value of type xs:string - : @return value of type xs:string? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-encoding the specified encoding is unknown. - : @error bin:conversion-error an error or malformed input occurred during decoding the string. - :) -declare function bin:decode-string($in as xs:base64Binary?, $encoding as xs:string) as xs:string? external; - -(:~ - : Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $encoding value of type xs:string - : @param $offset value of type xs:integer - : @return value of type xs:string? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-encoding the specified encoding is unknown. - : @error bin:conversion-error an error or malformed input occurred during decoding the string. - :) -declare function bin:decode-string($in as xs:base64Binary?, $encoding as xs:string, $offset as xs:integer) as xs:string? external; - -(:~ - : Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $encoding value of type xs:string - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:string? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-encoding the specified encoding is unknown. - : @error bin:conversion-error an error or malformed input occurred during decoding the string. - :) -declare function bin:decode-string($in as xs:base64Binary?, $encoding as xs:string, $offset as xs:integer, $size as xs:integer) as xs:string? external; - -(:~ - : Encodes a string into binary data using a given $encoding.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:string? - : @param $encoding value of type xs:string - : @return value of type xs:base64Binary? - : @error bin:unknown-encoding the specified encoding is unknown. - : @error bin:conversion-error an error or malformed input occurred during encoding the string. - :) -declare function bin:encode-string($in as xs:string?, $encoding as xs:string) as xs:base64Binary? external; - -(:~ - : Returns the 8-octet binary representation of a double value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. - : - : @param $in value of type xs:double - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:pack-double($in as xs:double) as xs:base64Binary external; - -(:~ - : Returns the 8-octet binary representation of a double value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. - : - : @param $in value of type xs:double - : @param $octet-order value of type xs:string - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:pack-double($in as xs:double, $octet-order as xs:string) as xs:base64Binary external; - -(:~ - : Returns the 4-octet binary representation of a float value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. - : - : @param $in value of type xs:float - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:pack-float($in as xs:float) as xs:base64Binary external; - -(:~ - : Returns the 4-octet binary representation of a float value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. - : - : @param $in value of type xs:float - : @param $octet-order value of type xs:string - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:pack-float($in as xs:float, $octet-order as xs:string) as xs:base64Binary external; - -(:~ - : Returns the twos-complement binary representation of an integer value treated as $size octets long. Any 'excess' high-order bits are discarded.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. Specifying a $size of zero yields an empty binary data. - : - : @param $in value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - : @error bin:negative-size the specified size is negative. - :) -declare function bin:pack-integer($in as xs:integer, $size as xs:integer) as xs:base64Binary external; - -(:~ - : Returns the twos-complement binary representation of an integer value treated as $size octets long. Any 'excess' high-order bits are discarded.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. Specifying a $size of zero yields an empty binary data. - : - : @param $in value of type xs:integer - : @param $size value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - : @error bin:negative-size the specified size is negative. - :) -declare function bin:pack-integer($in as xs:integer, $size as xs:integer, $octet-order as xs:string) as xs:base64Binary external; - -(:~ - : Extracts the double value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @return value of type xs:double - : @error bin:index-out-of-range the specified offset is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-double($in as xs:base64Binary, $offset as xs:integer) as xs:double external; - -(:~ - : Extracts the double value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:double - : @error bin:index-out-of-range the specified offset is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-double($in as xs:base64Binary, $offset as xs:integer, $octet-order as xs:string) as xs:double external; - -(:~ - : Extracts the float value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @return value of type xs:float - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-float($in as xs:base64Binary, $offset as xs:integer) as xs:float external; - -(:~ - : Extracts the float value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:float - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-float($in as xs:base64Binary, $offset as xs:integer, $octet-order as xs:string) as xs:float external; - -(:~ - : Returns a signed integer value represented by the $size octets starting from $offset in the input binary representation. Necessary sign extension is performed (i.e. the result is negative if the high order bit is '1').
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:integer - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-integer($in as xs:base64Binary, $offset as xs:integer, $size as xs:integer) as xs:integer external; - -(:~ - : Returns a signed integer value represented by the $size octets starting from $offset in the input binary representation. Necessary sign extension is performed (i.e. the result is negative if the high order bit is '1').
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:integer - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-integer($in as xs:base64Binary, $offset as xs:integer, $size as xs:integer, $octet-order as xs:string) as xs:integer external; - -(:~ - : Returns an unsigned integer value represented by the $size octets starting from $offset in the input binary representation.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:integer - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-unsigned-integer($in as xs:base64Binary, $offset as xs:integer, $size as xs:integer) as xs:integer external; - -(:~ - : Returns an unsigned integer value represented by the $size octets starting from $offset in the input binary representation.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:integer - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-unsigned-integer($in as xs:base64Binary, $offset as xs:integer, $size as xs:integer, $octet-order as xs:string) as xs:integer external; - -(:~ - : Returns the "bitwise or" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned. - : - : @param $a value of type xs:base64Binary? - : @param $b value of type xs:base64Binary? - : @return value of type xs:base64Binary? - : @error bin:differing-length-arguments the input arguments are of differing length. - :) -declare function bin:or($a as xs:base64Binary?, $b as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Returns the "bitwise xor" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned. - : - : @param $a value of type xs:base64Binary? - : @param $b value of type xs:base64Binary? - : @return value of type xs:base64Binary? - : @error bin:differing-length-arguments the input arguments are of differing length. - :) -declare function bin:xor($a as xs:base64Binary?, $b as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Returns the "bitwise and" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned. - : - : @param $a value of type xs:base64Binary? - : @param $b value of type xs:base64Binary? - : @return value of type xs:base64Binary? - : @error bin:differing-length-arguments the input arguments are of differing length. - :) -declare function bin:and($a as xs:base64Binary?, $b as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Returns the "bitwise not" of a binary argument.
If the argument is the empty sequence, an empty sequence is returned. - : - : @param $in value of type xs:base64Binary? - : @return value of type xs:base64Binary? - :) -declare function bin:not($in as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Shifts bits in binary data.
If $by is zero, the result is identical to $in. If $by is positive then bits are shifted to the left. Otherwise, bits are shifted to the right. If the absolute value of $by is greater than the bit-length of $in then an all-zeros result is returned. The result always has the same size as $in. The shifting is logical: zeros are placed into discarded bits. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $by value of type xs:integer - : @return value of type xs:base64Binary? - :) -declare function bin:shift($in as xs:base64Binary?, $by as xs:integer) as xs:base64Binary? external; diff --git a/packages.src/basex-9.6/client.xqm b/packages.src/basex-9.6/client.xqm deleted file mode 100644 index fc03701..0000000 --- a/packages.src/basex-9.6/client.xqm +++ /dev/null @@ -1,71 +0,0 @@ -(:~ - : This XQuery Module contains functions to access BaseX server instances from XQuery. With this module, you can execute database commands and evaluate XQuery expressions. Please note that the client module should always be used to address independent BaseX server instances. You can create deadlocks if you evaluate a query with a server instance, and if you are addressing the same server instance in your query. See the following example: The read-only query cannot be processed, because the conflict database is currently write-locked by the main query. See Transaction Management for more background information. - : - : @author BaseX Team - : @see /wiki/Client_Module - :) -module namespace client = "http://basex.org/modules/client"; - -(:~ - : This function establishes a connection to a remote BaseX server, creates a new client session, and returns a session id. The parameter $host is the name of the database server, $port specifies the server port, and $user and $password represent the login data. - : - : @param $host value of type xs:string - : @param $port value of type xs:integer - : @param $user value of type xs:string - : @param $password value of type xs:string - : @return value of type xs:anyURI - : @error client:connect an error occurs while creating the session (possible reasons: server not available, access denied). - :) -declare function client:connect($host as xs:string, $port as xs:integer, $user as xs:string, $password as xs:string) as xs:anyURI external; - -(:~ - : This function executes a command and returns the result as string. The parameter $id contains the session id returned by client:connect. The $command argument represents a single command, which will be executed by the server. - : - : @param $id value of type xs:anyURI - : @param $command value of type xs:string - : @return value of type xs:string - : @error client:error an I/O error occurs while transferring data from or to the server. - : @error client:command an error occurs while executing a command. - :) -declare function client:execute($id as xs:anyURI, $command as xs:string) as xs:string external; - -(:~ - : This function returns an information string, created by the last call of client:execute. $id specifies the session id. - : - : @param $id value of type xs:anyURI - : @return value of type xs:string - :) -declare function client:info($id as xs:anyURI) as xs:string external; - -(:~ - : Evaluates a query and returns the result as sequence. The parameter $id contains the session id returned by client:connect, and $query represents the query string, which will be evaluated by the server.
Variables and the context item can be declared via $bindings. The specified keys must be QNames or strings:
  • If a key is a QName, it will be directly adopted as variable name.
  • If a key is a string, it may be prefixed with a dollar sign. A namespace can be specified using the Clark Notation. If the specified string is empty, the value will be bound to the context item.
- : - : @param $id value of type xs:anyURI - : @param $query value of type xs:string - : @return value of type item()* - : @error client:error an I/O error occurs while transferring data from or to the server. - : @error client:query an error occurs while evaluating a query, and if the original error cannot be extracted from the returned error string. - : @error client:function function items (including maps and arrays) cannot be returned. - :) -declare function client:query($id as xs:anyURI, $query as xs:string) as item()* external; - -(:~ - : Evaluates a query and returns the result as sequence. The parameter $id contains the session id returned by client:connect, and $query represents the query string, which will be evaluated by the server.
Variables and the context item can be declared via $bindings. The specified keys must be QNames or strings:
  • If a key is a QName, it will be directly adopted as variable name.
  • If a key is a string, it may be prefixed with a dollar sign. A namespace can be specified using the Clark Notation. If the specified string is empty, the value will be bound to the context item.
- : - : @param $id value of type xs:anyURI - : @param $query value of type xs:string - : @param $bindings value of type map(*)? - : @return value of type item()* - : @error client:error an I/O error occurs while transferring data from or to the server. - : @error client:query an error occurs while evaluating a query, and if the original error cannot be extracted from the returned error string. - : @error client:function function items (including maps and arrays) cannot be returned. - :) -declare function client:query($id as xs:anyURI, $query as xs:string, $bindings as map(*)?) as item()* external; - -(:~ - : This function closes a client session. $id specifies the session id.
Opened connections will automatically be closed after the XQuery expression has been evaluated, but it is recommendable to explicitly close them with this function if you open many connections. - : - : @param $id value of type xs:anyURI - : @error client:error an I/O error occurs while transferring data from or to the server. - :) -declare function client:close($id as xs:anyURI) as empty-sequence() external; diff --git a/packages.src/basex-9.6/convert.xqm b/packages.src/basex-9.6/convert.xqm deleted file mode 100644 index ef74260..0000000 --- a/packages.src/basex-9.6/convert.xqm +++ /dev/null @@ -1,167 +0,0 @@ -(:~ - : This XQuery Module contains functions to convert data between different formats. - : - : @author BaseX Team - : @see /wiki/Conversion_Module - :) -module namespace convert = "http://basex.org/modules/convert"; - -(:~ - : Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $bytes value of type xs:anyAtomicType - : @return value of type xs:string - : @error convert:string The input is an invalid XML string, or the wrong encoding has been specified. - : @error convert:BXCO0002 The specified encoding is invalid or not supported. - :) -declare function convert:binary-to-string($bytes as xs:anyAtomicType) as xs:string external; - -(:~ - : Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $bytes value of type xs:anyAtomicType - : @param $encoding value of type xs:string - : @return value of type xs:string - : @error convert:string The input is an invalid XML string, or the wrong encoding has been specified. - : @error convert:BXCO0002 The specified encoding is invalid or not supported. - :) -declare function convert:binary-to-string($bytes as xs:anyAtomicType, $encoding as xs:string) as xs:string external; - -(:~ - : Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $bytes value of type xs:anyAtomicType - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @return value of type xs:string - : @error convert:string The input is an invalid XML string, or the wrong encoding has been specified. - : @error convert:BXCO0002 The specified encoding is invalid or not supported. - :) -declare function convert:binary-to-string($bytes as xs:anyAtomicType, $encoding as xs:string, $fallback as xs:boolean) as xs:string external; - -(:~ - : Converts the specified $string to an xs:base64Binary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument. - : - : @param $string value of type xs:string - : @return value of type xs:base64Binary - : @error convert:binary The input cannot be represented in the specified encoding. - : @error convert:encoding The specified encoding is invalid or not supported. - :) -declare function convert:string-to-base64($string as xs:string) as xs:base64Binary external; - -(:~ - : Converts the specified $string to an xs:base64Binary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument. - : - : @param $string value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:base64Binary - : @error convert:binary The input cannot be represented in the specified encoding. - : @error convert:encoding The specified encoding is invalid or not supported. - :) -declare function convert:string-to-base64($string as xs:string, $encoding as xs:string) as xs:base64Binary external; - -(:~ - : Converts the specified $string to an xs:hexBinary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument. - : - : @param $string value of type xs:string - : @return value of type xs:hexBinary - : @error convert:binary The input cannot be represented in the specified encoding. - : @error convert:encoding The specified encoding is invalid or not supported. - :) -declare function convert:string-to-hex($string as xs:string) as xs:hexBinary external; - -(:~ - : Converts the specified $string to an xs:hexBinary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument. - : - : @param $string value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:hexBinary - : @error convert:binary The input cannot be represented in the specified encoding. - : @error convert:encoding The specified encoding is invalid or not supported. - :) -declare function convert:string-to-hex($string as xs:string, $encoding as xs:string) as xs:hexBinary external; - -(:~ - : Converts the specified $integers to an item of type xs:base64Binary:
  • Only the first 8 bits of the supplied integers will be considered.
  • Conversion of byte sequences is particularly cheap, as items of binary type are internally represented as byte arrays.
- : - : @param $integers value of type xs:integer* - : @return value of type xs:base64Binary - :) -declare function convert:integers-to-base64($integers as xs:integer*) as xs:base64Binary external; - -(:~ - : Converts the specified $integers to an item of type xs:hexBinary:
  • Only the first 8 bits of the supplied integers will be considered.
  • Conversion of byte sequences is particularly cheap, as items of binary type are internally represented as byte arrays.
- : - : @param $integers value of type xs:integer* - : @return value of type xs:hexBinary - :) -declare function convert:integers-to-hex($integers as xs:integer*) as xs:hexBinary external; - -(:~ - : Returns the specified $binary (xs:base64Binary, xs:hexBinary) as a sequence of unsigned integers (octets). - : - : @param $binary value of type xs:anyAtomicType - : @return value of type xs:integer* - :) -declare function convert:binary-to-integers($binary as xs:anyAtomicType) as xs:integer* external; - -(:~ - : Returns the specified $binary (xs:base64Binary, xs:hexBinary) as a sequence of bytes. The conversion is very cheap and takes no additional memory, as items of binary type are internally represented as byte arrays. - : - : @param $binary value of type xs:anyAtomicType - : @return value of type xs:byte* - :) -declare function convert:binary-to-bytes($binary as xs:anyAtomicType) as xs:byte* external; - -(:~ - : Converts $number to a string, using the specified $base, interpreting it as a 64-bit unsigned integer.
The first base elements of the sequence '0',..,'9','a',..,'z' are used as digits.
Valid bases are 2, .., 36.
- : - : @param $number value of type xs:integer - : @param $base value of type xs:integer - : @return value of type xs:string - : @error convert:base The specified base is not in the range 2-36. - :) -declare function convert:integer-to-base($number as xs:integer, $base as xs:integer) as xs:string external; - -(:~ - : Decodes an integer from $string, using the specified $base.
The first base elements of the sequence '0',..,'9','a',..,'z' are allowed as digits; case does not matter.
Valid bases are 2 - 36.
If the supplied string contains more than 64 bits of information, the result will be truncated. - : - : @param $string value of type xs:string - : @param $base value of type xs:integer - : @return value of type xs:integer - : @error convert:base The specified base is not in the range 2-36. - : @error convert:integer The specified digit is not valid for the given range. - :) -declare function convert:integer-from-base($string as xs:string, $base as xs:integer) as xs:integer external; - -(:~ - : Converts the specified number of $milliseconds since 1 Jan 1970 to an item of type xs:dateTime.
- : - : @param $milliseconds value of type xs:integer - : @return value of type xs:dateTime - :) -declare function convert:integer-to-dateTime($milliseconds as xs:integer) as xs:dateTime external; - -(:~ - : Converts the specified $dateTime item to the number of milliseconds since 1 Jan 1970.
- : - : @param $dateTime value of type xs:dateTime - : @return value of type xs:integer - :) -declare function convert:dateTime-to-integer($dateTime as xs:dateTime) as xs:integer external; - -(:~ - : Converts the specified number of $milliseconds to an item of type xs:dayTimeDuration.
- : - : @param $milliseconds value of type xs:integer - : @return value of type xs:dayTimeDuration - :) -declare function convert:integer-to-dayTime($milliseconds as xs:integer) as xs:dayTimeDuration external; - -(:~ - : Converts the specified $dayTime duration to milliseconds represented by an integer.
- : - : @param $dayTime value of type xs:dayTimeDuration - : @return value of type xs:integer - :) -declare function convert:dayTime-to-integer($dayTime as xs:dayTimeDuration) as xs:integer external; diff --git a/packages.src/basex-9.6/crypto.xqm b/packages.src/basex-9.6/crypto.xqm deleted file mode 100644 index 45aa73a..0000000 --- a/packages.src/basex-9.6/crypto.xqm +++ /dev/null @@ -1,158 +0,0 @@ -(:~ - : This XQuery Module contains functions to perform cryptographic operations in XQuery. The cryptographic module is based on an early draft of the EXPath Cryptographic Module and provides the following functionality: creation of message authentication codes (HMAC), encryption and decryption, and creation and validation of XML Digital Signatures. - : - : @author BaseX Team - : @see /wiki/Cryptographic_Module - :) -module namespace crypto = "http://expath.org/ns/crypto"; -declare namespace experr = "http://expath.org/ns/error"; - -(:~ - : Creates a message authentication code via a cryptographic hash function and a secret $key.

$encoding must either be hex, base64 or the empty string and specifies the encoding of the returned authentication code. Default is base64 .
$algorithm describes the hash algorithm which is used for encryption. Currently supported are md5, sha1, sha256, sha384, sha512. Default is md5 .

- : - : @param $message value of type xs:string - : @param $key value of type xs:anyAtomicType - : @return value of type xs:string - : @error experr:CX0013 the specified hashing algorithm is not supported. - : @error experr:CX0014 the specified encoding method is not supported. - : @error experr:CX0019 the specified secret key is invalid. - :) -declare function crypto:hmac($message as xs:string, $key as xs:anyAtomicType) as xs:base64Binary, $algorithm as xs:string external; - -(:~ - : Creates a message authentication code via a cryptographic hash function and a secret $key.

$encoding must either be hex, base64 or the empty string and specifies the encoding of the returned authentication code. Default is base64 .
$algorithm describes the hash algorithm which is used for encryption. Currently supported are md5, sha1, sha256, sha384, sha512. Default is md5 .

- : - : @param $message value of type xs:string - : @param $key value of type xs:anyAtomicType - : @return value of type xs:string - : @error experr:CX0013 the specified hashing algorithm is not supported. - : @error experr:CX0014 the specified encoding method is not supported. - : @error experr:CX0019 the specified secret key is invalid. - :) -declare function crypto:hmac($message as xs:string, $key as xs:anyAtomicType) as xs:base64Binary, $algorithm as xs:string, $encoding as xs:string external; - -(:~ - : Encrypts the given input string.

$encryption must be symmetric, as asymmetric encryption is not supported so far. Default is symmetric .
$key is the secret key which is used for both encryption and decryption of input data. Its length is fixed and depends on the chosen algorithm: 8 bytes for DES, 16 bytes for AES.
$algorithm must either be DES or AES. Other algorithms are not supported so far, but, of course, can be added on demand. Default is DES .

- : - : @param $input value of type xs:string - : @param $encryption value of type xs:string - : @param $key value of type xs:string - : @param $algorithm value of type xs:string - : @return value of type xs:string - : @error experr:CX0016 padding problems arise. - : @error experr:CX0017 padding is incorrect. - : @error experr:CX0018 the encryption type is not supported. - : @error experr:CX0019 the secret key is invalid. - : @error experr:CX0020 the block size is incorrect. - : @error experr:CX0021 the specified encryption algorithm is not supported. - :) -declare function crypto:encrypt($input as xs:string, $encryption as xs:string, $key as xs:string, $algorithm as xs:string) as xs:string external; - -(:~ - : Decrypts the encrypted $input.

$type must be symmetric. An option for asymmetric encryption will most likely be added with another version of BaseX. Default is symmetric .
$key is the secret key which is used for both encryption and decryption of input data. Its length is fixed and depends on the chosen algorithm: 8 bytes for DES, 16 bytes for AES.
$algorithm must either be DES or AES. Other algorithms are not supported so far, but, of course, can be added on demand. Default is DES .

- : - : @param $input value of type xs:string - : @param $type value of type xs:string - : @param $key value of type xs:string - : @param $algorithm value of type xs:string - : @return value of type xs:string - : @error experr:CX0016 padding problems arise. - : @error experr:CX0017 padding is incorrect. - : @error experr:CX0018 the encryption type is not supported. - : @error experr:CX0019 the secret key is invalid. - : @error experr:CX0020 the block size is incorrect. - : @error experr:CX0021 the specified encryption algorithm is not supported. - :) -declare function crypto:decrypt($input as xs:string, $type as xs:string, $key as xs:string, $algorithm as xs:string) as xs:string external; - -(:~ - : $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

- : - : @param $input value of type node() - : @param $canonicalization value of type xs:string - : @param $digest value of type xs:string - : @param $signature value of type xs:string - : @param $prefix value of type xs:string - : @param $type value of type xs:string - : @return value of type node() - : @error experr:CX0001 the canonicalization algorithm is not supported. - : @error experr:CX0002 the digest algorithm is not supported. - : @error experr:CX0003 the signature algorithm is not supported. - : @error experr:CX0004 the $xpath-expression is invalid. - : @error experr:CX0005 the root name of $digital-certificate is not 'digital-certificate. - : @error experr:CX0007 the key store is null. - : @error experr:CX0012 the key cannot be found in the specified key store. - : @error experr:CX0023 the certificate alias is invalid. - : @error experr:CX0024 an invalid algorithm is specified. - : @error experr:CX0025 an exception occurs while the signing the document. - : @error experr:CX0026 an exception occurs during key store initialization. - : @error experr:CX0027 an IO exception occurs. - : @error experr:CX0028 the signature type is not supported. - :) -declare function crypto:generate-signature($input as node(), $canonicalization as xs:string, $digest as xs:string, $signature as xs:string, $prefix as xs:string, $type as xs:string) as node() external; - -(:~ - : $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

- : - : @param $input value of type node() - : @param $canonicalization value of type xs:string - : @param $digest value of type xs:string - : @param $signature value of type xs:string - : @param $prefix value of type xs:string - : @param $type value of type xs:string - : @param $xpath value of type xs:string - : @param $certificate value of type node() - : @return value of type node() - : @error experr:CX0001 the canonicalization algorithm is not supported. - : @error experr:CX0002 the digest algorithm is not supported. - : @error experr:CX0003 the signature algorithm is not supported. - : @error experr:CX0004 the $xpath-expression is invalid. - : @error experr:CX0005 the root name of $digital-certificate is not 'digital-certificate. - : @error experr:CX0007 the key store is null. - : @error experr:CX0012 the key cannot be found in the specified key store. - : @error experr:CX0023 the certificate alias is invalid. - : @error experr:CX0024 an invalid algorithm is specified. - : @error experr:CX0025 an exception occurs while the signing the document. - : @error experr:CX0026 an exception occurs during key store initialization. - : @error experr:CX0027 an IO exception occurs. - : @error experr:CX0028 the signature type is not supported. - :) -declare function crypto:generate-signature($input as node(), $canonicalization as xs:string, $digest as xs:string, $signature as xs:string, $prefix as xs:string, $type as xs:string, $xpath as xs:string, $certificate as node()) as node() external; - -(:~ - : $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

- : - : @param $input value of type node() - : @param $canonicalization value of type xs:string - : @param $digest value of type xs:string - : @param $signature value of type xs:string - : @param $prefix value of type xs:string - : @param $type value of type xs:string - : @param $ext value of type item() - : @return value of type node() - : @error experr:CX0001 the canonicalization algorithm is not supported. - : @error experr:CX0002 the digest algorithm is not supported. - : @error experr:CX0003 the signature algorithm is not supported. - : @error experr:CX0004 the $xpath-expression is invalid. - : @error experr:CX0005 the root name of $digital-certificate is not 'digital-certificate. - : @error experr:CX0007 the key store is null. - : @error experr:CX0012 the key cannot be found in the specified key store. - : @error experr:CX0023 the certificate alias is invalid. - : @error experr:CX0024 an invalid algorithm is specified. - : @error experr:CX0025 an exception occurs while the signing the document. - : @error experr:CX0026 an exception occurs during key store initialization. - : @error experr:CX0027 an IO exception occurs. - : @error experr:CX0028 the signature type is not supported. - :) -declare function crypto:generate-signature($input as node(), $canonicalization as xs:string, $digest as xs:string, $signature as xs:string, $prefix as xs:string, $type as xs:string, $ext as item()) as node() external; - -(:~ - : Checks if the given node contains a Signature element and whether the signature is valid. In this case true is returned. If the signature is invalid the function returns false. - : - : @param $input-doc value of type node() - : @return value of type xs:boolean - : @error experr:CX0015 the signature element cannot be found. - : @error experr:CX9994 an unspecified problem occurs during validation. - : @error experr:CX9996 an IO exception occurs during validation. - :) -declare function crypto:validate-signature($input-doc as node()) as xs:boolean external; diff --git a/packages.src/basex-9.6/csv.xqm b/packages.src/basex-9.6/csv.xqm deleted file mode 100644 index 646b434..0000000 --- a/packages.src/basex-9.6/csv.xqm +++ /dev/null @@ -1,45 +0,0 @@ -(:~ - : This XQuery Module contains a single function to parse CSV input. CSV (comma-separated values) is a popular representation for tabular data, exported e. g. from Excel. - : - : @author BaseX Team - : @see /wiki/CSV_Module - :) -module namespace csv = "http://basex.org/modules/csv"; - -(:~ - : Converts the CSV $string to an XQuery value. The $options argument can be used to control the way the input is converted. - : - : @param $string value of type xs:string? - : @return value of type item()? - : @error csv:parse the input cannot be parsed. - :) -declare function csv:parse($string as xs:string?) as item()? external; - -(:~ - : Converts the CSV $string to an XQuery value. The $options argument can be used to control the way the input is converted. - : - : @param $string value of type xs:string? - : @param $options value of type map(*)? - : @return value of type item()? - : @error csv:parse the input cannot be parsed. - :) -declare function csv:parse($string as xs:string?, $options as map(*)?) as item()? external; - -(:~ - : Serializes the specified $input as CSV, using the specified $options, and returns the result as string.

Values can also be serialized as CSV with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to csv, and
  • the options presented in this article need to be assigned to the csv parameter.
- : - : @param $input value of type item()? - : @return value of type xs:string - : @error csv:serialize the input cannot be serialized. - :) -declare function csv:serialize($input as item()?) as xs:string external; - -(:~ - : Serializes the specified $input as CSV, using the specified $options, and returns the result as string.

Values can also be serialized as CSV with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to csv, and
  • the options presented in this article need to be assigned to the csv parameter.
- : - : @param $input value of type item()? - : @param $options value of type map(*)? - : @return value of type xs:string - : @error csv:serialize the input cannot be serialized. - :) -declare function csv:serialize($input as item()?, $options as map(*)?) as xs:string external; diff --git a/packages.src/basex-9.6/db.xqm b/packages.src/basex-9.6/db.xqm deleted file mode 100644 index 5fd266d..0000000 --- a/packages.src/basex-9.6/db.xqm +++ /dev/null @@ -1,593 +0,0 @@ -(:~ - : This XQuery Module contains functions for processing databases from within XQuery. Existing databases can be opened and listed, its contents can be directly accessed, documents can be added to and removed, etc. - : - : @author BaseX Team - : @see /wiki/Database_Module - :) -module namespace db = "http://basex.org/modules/db"; - -(:~ - : Returns general information on the database system the current values of all global and local Options. The INFO command returns similar output. - : - : @return value of type element(system) - :) -declare function db:system() as element(system) external; - -(:~ - : Returns the current value (string, integer, boolean, map) of a global or local Option with the specified $name. The GET command works similar. - : - : @param $name value of type xs:string - : @return value of type xs:string - :) -declare function db:option($name as xs:string) as xs:string external; - -(:~ - : Returns meta information on the database $db. The output is similar to the INFO DB command. - : - : @param $db value of type xs:string - : @return value of type element(database) - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:info($db as xs:string) as element(database) external; - -(:~ - : Returns the value (string, boolean, integer) of a property with the specified $name in the database $db. The available properties are the ones returned by db:info. - : - : @param $db value of type xs:string - : @param $name value of type xs:string - : @return value of type xs:anyAtomicType - : @error db:property the specified property is unknown. - :) -declare function db:property($db as xs:string, $name as xs:string) as xs:anyAtomicType external; - -(:~ - : The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
- : - : @return value of type xs:string* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list() as xs:string* external; - -(:~ - : The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
- : - : @param $db value of type xs:string - : @return value of type xs:string* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list($db as xs:string) as xs:string* external; - -(:~ - : The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:string* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list($db as xs:string, $path as xs:string) as xs:string* external; - -(:~ - : Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
- : - : @return value of type element(database)* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list-details() as element(database)* external; - -(:~ - : Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
- : - : @param $db value of type xs:string - : @return value of type element(resource)* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list-details($db as xs:string) as element(resource)* external; - -(:~ - : Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type element(resource)* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list-details($db as xs:string, $path as xs:string) as element(resource)* external; - -(:~ - : Returns an element sequence containing all available database backups.
If a database $db is specified, the sequence will be restricted to the backups matching this database. - : - : @return value of type element(backup)* - :) -declare function db:backups() as element(backup)* external; - -(:~ - : Returns an element sequence containing all available database backups.
If a database $db is specified, the sequence will be restricted to the backups matching this database. - : - : @param $db value of type xs:string - : @return value of type element(backup)* - :) -declare function db:backups($db as xs:string) as element(backup)* external; - -(:~ - : Opens the database $db and returns all document nodes.
The document nodes to be returned can be filtered with the $path argument. - : - : @param $db value of type xs:string - : @return value of type document-node()* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:open($db as xs:string) as document-node()* external; - -(:~ - : Opens the database $db and returns all document nodes.
The document nodes to be returned can be filtered with the $path argument. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type document-node()* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:open($db as xs:string, $path as xs:string) as document-node()* external; - -(:~ - : Opens the database $db and returns the node with the specified $pre value.
The PRE value provides very fast access to an existing database node, but it will change whenever a node with a smaller pre values is added to or deleted from a database. - : - : @param $db value of type xs:string - : @param $pre value of type xs:integer - : @return value of type node() - : @error db:open the addressed database does not exist or could not be opened. - : @error db:range the specified pre value does not exist in the database. - :) -declare function db:open-pre($db as xs:string, $pre as xs:integer) as node() external; - -(:~ - : Opens the database $db and returns the node with the specified $id value.
Each database node has a persistent ID value. Access to the node id can be sped up by turning on the UPDINDEX option. - : - : @param $db value of type xs:string - : @param $id value of type xs:integer - : @return value of type node() - : @error db:open the addressed database does not exist or could not be opened. - : @error db:range the specified id value does not exist in the database. - :) -declare function db:open-id($db as xs:string, $id as xs:integer) as node() external; - -(:~ - : Returns the pre values of the nodes supplied by $nodes, which must all be database nodes.
The PRE value provides very fast access to an existing database node, but it will change whenever a node with a smaller pre values is added to or deleted from a database. - : - : @param $nodes value of type node()* - : @return value of type xs:integer* - : @error db:node $nodes contains a node which is not stored in a database. - :) -declare function db:node-pre($nodes as node()*) as xs:integer* external; - -(:~ - : Returns the id values of the nodes supplied by $nodes, which must all be database nodes.
Each database node has a persistent ID value. Access to the node id can be sped up by turning on the UPDINDEX option. - : - : @param $nodes value of type node()* - : @return value of type xs:integer* - : @error db:node $nodes contains a node which is not stored in a database. - :) -declare function db:node-id($nodes as node()*) as xs:integer* external; - -(:~ - : Returns a binary resource addressed by the database $db and $path as streamable xs:base64Binary. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:base64Binary - : @error db:open the addressed database does not exist or could not be opened. - : @error db:mainmem the database is not persistent (stored on disk). - :) -declare function db:retrieve($db as xs:string, $path as xs:string) as xs:base64Binary external; - -(:~ - : Exports the specified database $db to the specified file $path. Existing files will be overwritten. The $params argument contains serialization parameters (see Serialization for more details), which can either be specified
  • as children of an <output:serialization-parameters/> element, as defined for the fn:serialize() function; e.g.:
 <output:serialization-parameters> <output:method value='xml'/> <output:cdata-section-elements value="div"/> ... </output:serialization-parameters> 
  • as map, which contains all key/value pairs:
 map { "method": "xml", "cdata-section-elements": "div", ... } 
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:export($db as xs:string, $path as xs:string) as empty-sequence() external; - -(:~ - : Exports the specified database $db to the specified file $path. Existing files will be overwritten. The $params argument contains serialization parameters (see Serialization for more details), which can either be specified
  • as children of an <output:serialization-parameters/> element, as defined for the fn:serialize() function; e.g.:
 <output:serialization-parameters> <output:method value='xml'/> <output:cdata-section-elements value="div"/> ... </output:serialization-parameters> 
  • as map, which contains all key/value pairs:
 map { "method": "xml", "cdata-section-elements": "div", ... } 
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @param $params value of type item() - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:export($db as xs:string, $path as xs:string, $params as item()) as empty-sequence() external; - -(:~ - : Returns all text nodes of the database $db that have one of the specified $strings as values and that are stored in the text index. - : - : @param $db value of type xs:string - : @param $strings value of type xs:string* - : @return value of type text()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:text($db as xs:string, $strings as xs:string*) as text()* external; - -(:~ - : Returns all text nodes of the database $db that are located in between the $min and $max strings and that are stored in the text index. - : - : @param $db value of type xs:string - : @param $min value of type xs:string - : @param $max value of type xs:string - : @return value of type text()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:text-range($db as xs:string, $min as xs:string, $max as xs:string) as text()* external; - -(:~ - : Returns all attribute nodes of the database $db that have one of the specified $strings as values and that are stored in the attribute index.
If $name is specified, the resulting attribute nodes are filtered by their attribute name. - : - : @param $db value of type xs:string - : @param $strings value of type xs:string* - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:attribute($db as xs:string, $strings as xs:string*) as attribute()* external; - -(:~ - : Returns all attribute nodes of the database $db that have one of the specified $strings as values and that are stored in the attribute index.
If $name is specified, the resulting attribute nodes are filtered by their attribute name. - : - : @param $db value of type xs:string - : @param $strings value of type xs:strings* - : @param $name value of type xs:string - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:attribute($db as xs:string, $strings as xs:strings*, $name as xs:string) as attribute()* external; - -(:~ - : Returns all attributes of the database $db, the string values of which are larger than or equal to $min and smaller than or equal to $max and that are stored in the attribute index. - : - : @param $db value of type xs:string - : @param $min value of type xs:string - : @param $max value of type xs:string - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:attribute-range($db as xs:string, $min as xs:string, $max as xs:string) as attribute()* external; - -(:~ - : Returns all attributes of the database $db, the string values of which are larger than or equal to $min and smaller than or equal to $max and that are stored in the attribute index. - : - : @param $db value of type xs:string - : @param $min value of type xs:string - : @param $max value of type xs:string - : @param $name value of type xs:string - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:attribute-range($db as xs:string, $min as xs:string, $max as xs:string, $name as xs:string) as attribute()* external; - -(:~ - : Returns all attribute nodes of the database $db the values of which contain one of the specified $tokens.
If $name is specified, the resulting attribute nodes are filtered by their attribute name. - : - : @param $db value of type xs:string - : @param $tokens value of type xs:string* - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:token($db as xs:string, $tokens as xs:string*) as attribute()* external; - -(:~ - : Returns all attribute nodes of the database $db the values of which contain one of the specified $tokens.
If $name is specified, the resulting attribute nodes are filtered by their attribute name. - : - : @param $db value of type xs:string - : @param $tokens value of type xs:string* - : @param $name value of type xs:string - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:token($db as xs:string, $tokens as xs:string*, $name as xs:string) as attribute()* external; - -(:~ - : Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
- : - : @param $db value of type xs:string - : @error db:lock a database is opened by another process. - : @error db:name the specified name is not a valid database name. - : @error db:conflict the same database was addressed more than once. - : @error db:args the number of specified inputs and paths differs. - :) -declare function db:create($db as xs:string) as empty-sequence() external; - -(:~ - : Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
- : - : @param $db value of type xs:string - : @param $inputs value of type item()* - : @error db:lock a database is opened by another process. - : @error db:name the specified name is not a valid database name. - : @error db:conflict the same database was addressed more than once. - : @error db:args the number of specified inputs and paths differs. - :) -declare function db:create($db as xs:string, $inputs as item()*) as empty-sequence() external; - -(:~ - : Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
- : - : @param $db value of type xs:string - : @param $inputs value of type item()* - : @param $paths value of type xs:string* - : @error db:lock a database is opened by another process. - : @error db:name the specified name is not a valid database name. - : @error db:conflict the same database was addressed more than once. - : @error db:args the number of specified inputs and paths differs. - :) -declare function db:create($db as xs:string, $inputs as item()*, $paths as xs:string*) as empty-sequence() external; - -(:~ - : Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
- : - : @param $db value of type xs:string - : @param $inputs value of type item()* - : @param $paths value of type xs:string* - : @param $options value of type map(*)? - : @error db:lock a database is opened by another process. - : @error db:name the specified name is not a valid database name. - : @error db:conflict the same database was addressed more than once. - : @error db:args the number of specified inputs and paths differs. - :) -declare function db:create($db as xs:string, $inputs as item()*, $paths as xs:string*, $options as map(*)?) as empty-sequence() external; - -(:~ - : Drops the database $db and all connected resources. - : - : @param $db value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:lock a database is opened by another process. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:drop($db as xs:string) as empty-sequence() external; - -(:~ - : Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:replace instead.
  • See db:create for more details on the input argument.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
- : - : @param $db value of type xs:string - : @param $input value of type item() - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:add($db as xs:string, $input as item()) as empty-sequence() external; - -(:~ - : Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:replace instead.
  • See db:create for more details on the input argument.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
- : - : @param $db value of type xs:string - : @param $input value of type item() - : @param $path value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:add($db as xs:string, $input as item(), $path as xs:string) as empty-sequence() external; - -(:~ - : Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:replace instead.
  • See db:create for more details on the input argument.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
- : - : @param $db value of type xs:string - : @param $input value of type item() - : @param $path value of type xs:string - : @param $options value of type map(*)? - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:add($db as xs:string, $input as item(), $path as xs:string, $options as map(*)?) as empty-sequence() external; - -(:~ - : Deletes resource(s), specified by $path, from the database $db. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:path the specified path is invalid. - :) -declare function db:delete($db as xs:string, $path as xs:string) as empty-sequence() external; - -(:~ - : Creates a copy of the database $db, which will be called $name. - : - : @param $db value of type xs:string - : @param $name value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:lock a database is opened by another process. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:copy($db as xs:string, $name as xs:string) as empty-sequence() external; - -(:~ - : Renames the database $db to $name. - : - : @param $db value of type xs:string - : @param $name value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:lock a database is opened by another process. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:alter($db as xs:string, $name as xs:string) as empty-sequence() external; - -(:~ - : Creates a backup of the database $db. - : - : @param $db value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:create-backup($db as xs:string) as empty-sequence() external; - -(:~ - : Drops all backups of the database with the specified $name. If the given $name points to a specific backup file, only this specific backup file is deleted. - : - : @param $name value of type xs:string - : @error db:backup No backup file found. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:drop-backup($name as xs:string) as empty-sequence() external; - -(:~ - : Restores the database with the specified $name. The $name may include the timestamp of the backup file. - : - : @param $name value of type xs:string - : @error db:lock a database is opened by another process. - : @error db:name invalid database name. - : @error db:no-backup No backup found. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:restore($name as xs:string) as empty-sequence() external; - -(:~ - : Optimizes the meta data and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true. - : - : @param $db value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:optimize($db as xs:string) as empty-sequence() external; - -(:~ - : Optimizes the meta data and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true. - : - : @param $db value of type xs:string - : @param $all value of type xs:boolean - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:optimize($db as xs:string, $all as xs:boolean) as empty-sequence() external; - -(:~ - : Optimizes the meta data and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true. - : - : @param $db value of type xs:string - : @param $all value of type xs:boolean - : @param $options value of type map(*)? - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:optimize($db as xs:string, $all as xs:boolean, $options as map(*)?) as empty-sequence() external; - -(:~ - : Moves all resources(s) of database $db, which are found in the supplied $source path, to the supplied $target path. The paths may point to single resources or directories. No updates will take place if a non-existing source path is supplied. - : - : @param $db value of type xs:string - : @param $source value of type xs:string - : @param $target value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:path the specified source or target path, or one of its descendants, is invalid. - :) -declare function db:rename($db as xs:string, $source as xs:string, $target as xs:string) as empty-sequence() external; - -(:~ - : Replaces a resource, specified by $path, in the database $db with the contents of $input, or adds it as a new resource:
  • See db:create for more details on the input argument.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
  • For historical reasons, the order of the 2nd and 3rd argument is different to db:add and db:create
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @param $input value of type item() - : @error db:open the addressed database does not exist or could not be opened. - : @error db:target the path points to a directory. - :) -declare function db:replace($db as xs:string, $path as xs:string, $input as item()) as empty-sequence() external; - -(:~ - : Replaces a resource, specified by $path, in the database $db with the contents of $input, or adds it as a new resource:
  • See db:create for more details on the input argument.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
  • For historical reasons, the order of the 2nd and 3rd argument is different to db:add and db:create
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @param $input value of type item() - : @param $options value of type map(*)? - : @error db:open the addressed database does not exist or could not be opened. - : @error db:target the path points to a directory. - :) -declare function db:replace($db as xs:string, $path as xs:string, $input as item(), $options as map(*)?) as empty-sequence() external; - -(:~ - : Replaces a binary resource specified by $input in the database $db and the location specified by $path, or adds it as new resource. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @param $input value of type item() - : @error db:open the addressed database does not exist or could not be opened. - : @error db:mainmem the database is not persistent (stored on disk). - :) -declare function db:store($db as xs:string, $path as xs:string, $input as item()) as empty-sequence() external; - -(:~ - : Explicitly flushes the buffers of the database $db. This command is only useful if AUTOFLUSH has been set to false. - : - : @param $db value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:flush($db as xs:string) as empty-sequence() external; - -(:~ - : Returns the name of the database in which the specified database node $node is stored. - : - : @param $node value of type node() - : @return value of type xs:string - : @error db:node $nodes contains a node which is not stored in a database. - :) -declare function db:name($node as node()) as xs:string external; - -(:~ - : Returns the path of the database document in which the specified database node $node is stored. - : - : @param $node value of type node() - : @return value of type xs:string - : @error db:node $nodes contains a node which is not stored in a database. - :) -declare function db:path($node as node()) as xs:string external; - -(:~ - : Checks if the database $db or the resource specified by $path exists. false is returned if a database directory has been addressed. - : - : @param $db value of type xs:string - : @return value of type xs:boolean - :) -declare function db:exists($db as xs:string) as xs:boolean external; - -(:~ - : Checks if the database $db or the resource specified by $path exists. false is returned if a database directory has been addressed. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function db:exists($db as xs:string, $path as xs:string) as xs:boolean external; - -(:~ - : Checks if the specified resource in the database $db and the path $path exists, and if it is a binary resource. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:boolean - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:is-raw($db as xs:string, $path as xs:string) as xs:boolean external; - -(:~ - : Checks if the specified resource in the database $db and the path $path exists, and if it is an XML document. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:boolean - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:is-xml($db as xs:string, $path as xs:string) as xs:boolean external; - -(:~ - : Retrieves the content type of a resource in the database $db and the path $path.
The file extension is used to recognize the content-type of a resource stored in the database. Content-type application/xml will be returned for any XML document stored in the database, regardless of its file name extension. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:content-type($db as xs:string, $path as xs:string) as xs:string external; diff --git a/packages.src/basex-9.6/fetch.xqm b/packages.src/basex-9.6/fetch.xqm deleted file mode 100644 index f5ec394..0000000 --- a/packages.src/basex-9.6/fetch.xqm +++ /dev/null @@ -1,94 +0,0 @@ -(:~ - : This XQuery Module provides simple functions to fetch the content of resources identified by URIs. Resources can be stored locally or remotely and e.g. use the file:// or http:// scheme. If more control over HTTP requests is required, the HTTP Module can be used. With the HTML Module, retrieved HTML documents can be converted to XML. - : - : @author BaseX Team - : @see /wiki/Fetch_Module - :) -module namespace fetch = "http://basex.org/modules/fetch"; - -(:~ - : Fetches the resource referred to by the given URI and returns it as lazy xs:base64Binary item. - : - : @param $uri value of type xs:string - : @return value of type xs:base64Binary - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - :) -declare function fetch:binary($uri as xs:string) as xs:base64Binary external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $uri value of type xs:string - : @return value of type xs:string - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - : @error fetch:encoding the specified encoding is not supported, or unknown. - :) -declare function fetch:text($uri as xs:string) as xs:string external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $uri value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:string - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - : @error fetch:encoding the specified encoding is not supported, or unknown. - :) -declare function fetch:text($uri as xs:string, $encoding as xs:string) as xs:string external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $uri value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @return value of type xs:string - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - : @error fetch:encoding the specified encoding is not supported, or unknown. - :) -declare function fetch:text($uri as xs:string, $encoding as xs:string, $fallback as xs:boolean) as xs:string external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as XML document node.
In contrast to fn:doc, each function call returns a different document node. As a consequence, document instances created by this function will not be kept in memory until the end of query evaluation.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case. - : - : @param $uri value of type xs:string - : @return value of type document-node() - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - :) -declare function fetch:xml($uri as xs:string) as document-node() external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as XML document node.
In contrast to fn:doc, each function call returns a different document node. As a consequence, document instances created by this function will not be kept in memory until the end of query evaluation.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case. - : - : @param $uri value of type xs:string - : @param $options value of type map(*)? - : @return value of type document-node() - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - :) -declare function fetch:xml($uri as xs:string, $options as map(*)?) as document-node() external; - -(:~ - : Parses binary $data and returns it as XML document node.
In contrast to fn:parse-xml, which expects an XQuery string, the input of this function can be arbitrarily encoded. The encoding will be derived from the XML declaration or (in case of UTF16 or UTF32) from the first bytes of the input.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case. - : - : @param $data value of type xs:base64Binary - : @return value of type document-node() - :) -declare function fetch:xml-binary($data as xs:base64Binary) as document-node() external; - -(:~ - : Parses binary $data and returns it as XML document node.
In contrast to fn:parse-xml, which expects an XQuery string, the input of this function can be arbitrarily encoded. The encoding will be derived from the XML declaration or (in case of UTF16 or UTF32) from the first bytes of the input.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case. - : - : @param $data value of type xs:base64Binary - : @param $options value of type map(*)? - : @return value of type document-node() - :) -declare function fetch:xml-binary($data as xs:base64Binary, $options as map(*)?) as document-node() external; - -(:~ - : Returns the content-type (also called mime-type) of the resource specified by $uri:
  • If a remote resource is addressed, the request header will be evaluated.
  • If the addressed resource is locally stored, the content-type will be guessed based on the file extension.
- : - : @param $uri value of type xs:string - : @return value of type xs:string - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - :) -declare function fetch:content-type($uri as xs:string) as xs:string external; diff --git a/packages.src/basex-9.6/file.xqm b/packages.src/basex-9.6/file.xqm deleted file mode 100644 index 3f31b00..0000000 --- a/packages.src/basex-9.6/file.xqm +++ /dev/null @@ -1,628 +0,0 @@ -(:~ - : This XQuery Module contains functions related to file system operations, such as listing, reading, or writing files. This module is based on the EXPath File Module. - : - : @author BaseX Team - : @see /wiki/File_Module - :) -module namespace file = "http://expath.org/ns/file"; -declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization"; - -(:~ - : Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether sub-directories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
- : - : @param $dir value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:no-dir the specified path does not point to a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:list($dir as xs:string) as xs:string* external; - -(:~ - : Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether sub-directories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
- : - : @param $dir value of type xs:string - : @param $recursive value of type xs:boolean - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:no-dir the specified path does not point to a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:list($dir as xs:string, $recursive as xs:boolean) as xs:string* external; - -(:~ - : Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether sub-directories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
- : - : @param $dir value of type xs:string - : @param $recursive value of type xs:boolean - : @param $pattern value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:no-dir the specified path does not point to a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:list($dir as xs:string, $recursive as xs:boolean, $pattern as xs:string) as xs:string* external; - -(:~ - : Returns the full paths to all files and directories found in the specified $dir.
The inverse function is file:parent. The related function file:list returns relative file paths. - : - : @param $dir value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:no-dir the specified path does not point to a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:children($dir as xs:string) as xs:string* external; - -(:~ - : Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file. - : - : @param $path value of type xs:string - : @return value of type xs:base64Binary - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset or length is negative, or the chosen values would exceed the file bounds. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-binary($path as xs:string) as xs:base64Binary external; - -(:~ - : Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file. - : - : @param $path value of type xs:string - : @param $offset value of type xs:integer - : @return value of type xs:base64Binary - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset or length is negative, or the chosen values would exceed the file bounds. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-binary($path as xs:string, $offset as xs:integer) as xs:base64Binary external; - -(:~ - : Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file. - : - : @param $path value of type xs:string - : @param $offset value of type xs:integer - : @param $length value of type xs:integer - : @return value of type xs:base64Binary - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset or length is negative, or the chosen values would exceed the file bounds. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-binary($path as xs:string, $offset as xs:integer, $length as xs:integer) as xs:base64Binary external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $path value of type xs:string - : @return value of type xs:string - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text($path as xs:string) as xs:string external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:string - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text($path as xs:string, $encoding as xs:string) as xs:string external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @return value of type xs:string - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text($path as xs:string, $encoding as xs:string, $fallback as xs:boolean) as xs:string external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @return value of type xs:string - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string) as xs:string external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string, $encoding as xs:string) as xs:string* external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string, $encoding as xs:string, $fallback as xs:boolean) as xs:string* external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @param $offset value of type xs:integer - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string, $encoding as xs:string, $fallback as xs:boolean, $offset as xs:integer) as xs:string* external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @param $offset value of type xs:integer - : @param $length value of type xs:integer - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string, $encoding as xs:string, $fallback as xs:boolean, $offset as xs:integer, $length as xs:integer) as xs:string* external; - -(:~ - : Creates the directory specified by $dir, including all non-existing parent directories.
- : - : @param $dir value of type xs:string - : @error file:exists a file with the same path already exists. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:create-dir($dir as xs:string) as empty-sequence() external; - -(:~ - : Creates a new temporary directory that did not exist before this function was called, and returns its full file path. The directory name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the directory will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories. - : - : @param $prefix value of type xs:string - : @param $suffix value of type xs:string - : @return value of type xs:string - : @error file:no-dir the specified directory points to a file. - : @error file:io-error the directory could not be created. - :) -declare function file:create-temp-dir($prefix as xs:string, $suffix as xs:string) as xs:string external; - -(:~ - : Creates a new temporary directory that did not exist before this function was called, and returns its full file path. The directory name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the directory will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories. - : - : @param $prefix value of type xs:string - : @param $suffix value of type xs:string - : @param $dir value of type xs:string - : @return value of type xs:string - : @error file:no-dir the specified directory points to a file. - : @error file:io-error the directory could not be created. - :) -declare function file:create-temp-dir($prefix as xs:string, $suffix as xs:string, $dir as xs:string) as xs:string external; - -(:~ - : Creates a new temporary file that did not exist before this function was called, and returns its full file path. The file name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the file will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories. - : - : @param $prefix value of type xs:string - : @param $suffix value of type xs:string - : @return value of type xs:string - : @error file:no-dir the specified directory points to a file. - : @error file:io-error the directory could not be created. - :) -declare function file:create-temp-file($prefix as xs:string, $suffix as xs:string) as xs:string external; - -(:~ - : Creates a new temporary file that did not exist before this function was called, and returns its full file path. The file name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the file will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories. - : - : @param $prefix value of type xs:string - : @param $suffix value of type xs:string - : @param $dir value of type xs:string - : @return value of type xs:string - : @error file:no-dir the specified directory points to a file. - : @error file:io-error the directory could not be created. - :) -declare function file:create-temp-file($prefix as xs:string, $suffix as xs:string, $dir as xs:string) as xs:string external; - -(:~ - : Recursively deletes a file or directory specified by $path.
The optional parameter $recursive specifies whether sub-directories will be deleted, too.
- : - : @param $path value of type xs:string - : @error file:not-found the specified path does not exist. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:delete($path as xs:string) as empty-sequence() external; - -(:~ - : Recursively deletes a file or directory specified by $path.
The optional parameter $recursive specifies whether sub-directories will be deleted, too.
- : - : @param $path value of type xs:string - : @param $recursive value of type xs:boolean - : @error file:not-found the specified path does not exist. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:delete($path as xs:string, $recursive as xs:boolean) as empty-sequence() external; - -(:~ - : Writes a serialized sequence of items to the specified file. If the file already exists, it will be overwritten.
The $params argument contains serialization parameters (see Serialization for more details), which can either be specified
  • as children of an <output:serialization-parameters/> element, as defined for the fn:serialize() function; e.g.:
 <output:serialization-parameters> <output:method value='xml'/> <output:cdata-section-elements value="div"/> ... </output:serialization-parameters> 
  • as map, which contains all key/value pairs:
 map { "method": "xml", "cdata-section-elements": "div", ... } 
- : - : @param $path value of type xs:string - : @param $items value of type item()* - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write($path as xs:string, $items as item()*) as empty-sequence() external; - -(:~ - : Writes a serialized sequence of items to the specified file. If the file already exists, it will be overwritten.
The $params argument contains serialization parameters (see Serialization for more details), which can either be specified
  • as children of an <output:serialization-parameters/> element, as defined for the fn:serialize() function; e.g.:
 <output:serialization-parameters> <output:method value='xml'/> <output:cdata-section-elements value="div"/> ... </output:serialization-parameters> 
  • as map, which contains all key/value pairs:
 map { "method": "xml", "cdata-section-elements": "div", ... } 
- : - : @param $path value of type xs:string - : @param $items value of type item()* - : @param $params value of type item() - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write($path as xs:string, $items as item()*, $params as item()) as empty-sequence() external; - -(:~ - : Writes a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file already exists, it will be overwritten.
If $offset is specified, data will be written at this file position. An existing file may be resized by that operation. - : - : @param $path value of type xs:string - : @param $value value of type xs:anyAtomicType - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset is negative, or it exceeds the current file size. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-binary($path as xs:string, $value as xs:anyAtomicType) as empty-sequence() external; - -(:~ - : Writes a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file already exists, it will be overwritten.
If $offset is specified, data will be written at this file position. An existing file may be resized by that operation. - : - : @param $path value of type xs:string - : @param $value value of type xs:anyAtomicType - : @param $offset value of type xs:integer - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset is negative, or it exceeds the current file size. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-binary($path as xs:string, $value as xs:anyAtomicType, $offset as xs:integer) as empty-sequence() external; - -(:~ - : Writes a string to the specified file. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $value value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-text($path as xs:string, $value as xs:string) as empty-sequence() external; - -(:~ - : Writes a string to the specified file. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $value value of type xs:string - : @param $encoding value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-text($path as xs:string, $value as xs:string, $encoding as xs:string) as empty-sequence() external; - -(:~ - : Writes a sequence of strings to the specified file, each followed by the system specific newline character. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $values value of type xs:string* - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-text-lines($path as xs:string, $values as xs:string*) as empty-sequence() external; - -(:~ - : Writes a sequence of strings to the specified file, each followed by the system specific newline character. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $values value of type xs:string* - : @param $encoding value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-text-lines($path as xs:string, $values as xs:string*, $encoding as xs:string) as empty-sequence() external; - -(:~ - : Appends a serialized sequence of items to the specified file. If the file does not exists, a new file is created.
- : - : @param $path value of type xs:string - : @param $items value of type item()* - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append($path as xs:string, $items as item()*) as empty-sequence() external; - -(:~ - : Appends a serialized sequence of items to the specified file. If the file does not exists, a new file is created.
- : - : @param $path value of type xs:string - : @param $items value of type item()* - : @param $params value of type item() - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append($path as xs:string, $items as item()*, $params as item()) as empty-sequence() external; - -(:~ - : Appends a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file does not exists, a new one is created.
- : - : @param $path value of type xs:string - : @param $value value of type xs:anyAtomicType - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-binary($path as xs:string, $value as xs:anyAtomicType) as empty-sequence() external; - -(:~ - : Appends a string to a file specified by $path. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $value value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-text($path as xs:string, $value as xs:string) as empty-sequence() external; - -(:~ - : Appends a string to a file specified by $path. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $value value of type xs:string - : @param $encoding value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-text($path as xs:string, $value as xs:string, $encoding as xs:string) as empty-sequence() external; - -(:~ - : Appends a sequence of strings to the specified file, each followed by the system specific newline character. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $values value of type xs:string* - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-text-lines($path as xs:string, $values as xs:string*) as empty-sequence() external; - -(:~ - : Appends a sequence of strings to the specified file, each followed by the system specific newline character. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $values value of type xs:string* - : @param $encoding value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-text-lines($path as xs:string, $values as xs:string*, $encoding as xs:string) as empty-sequence() external; - -(:~ - : Copies a file or directory specified by $source to the file or directory specified by $target. If the target file already exists, it will be overwritten. No operation will be performed if the source and target path are equal.
- : - : @param $source value of type xs:string - : @param $target value of type xs:string - : @error file:not-found the specified source does not exist. - : @error file:exists the specified source is a directory and the target is a file. - : @error file:no-dir the parent of the specified target is no directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:copy($source as xs:string, $target as xs:string) as empty-sequence() external; - -(:~ - : Moves or renames the file or directory specified by $source to the path specified by $target. If the target file already exists, it will be overwritten. No operation will be performed if the source and target path are equal.
- : - : @param $source value of type xs:string - : @param $target value of type xs:string - : @error file:not-found the specified source does not exist. - : @error file:exists the specified source is a directory and the target is a file. - : @error file:no-dir the parent of the specified target is no directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:move($source as xs:string, $target as xs:string) as empty-sequence() external; - -(:~ - : Returns an xs:boolean indicating whether a file or directory specified by $path exists in the file system.
- : - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function file:exists($path as xs:string) as xs:boolean external; - -(:~ - : Returns an xs:boolean indicating whether the argument $path points to an existing directory.
- : - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function file:is-dir($path as xs:string) as xs:boolean external; - -(:~ - : Returns an xs:boolean indicating whether the argument $path is absolute.
The behavior of this function depends on the operating system: On Windows, an absolute path starts with the drive letter and a colon, whereas on Linux it starts with a slash. - : - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function file:is-absolute($path as xs:string) as xs:boolean external; - -(:~ - : Returns an xs:boolean indicating whether the argument $path points to an existing file.
- : - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function file:is-file($path as xs:string) as xs:boolean external; - -(:~ - : Retrieves the timestamp of the last modification of the file or directory specified by $path.
- : - : @param $path value of type xs:string - : @return value of type xs:dateTime - : @error file:not-found the specified path does not exist. - :) -declare function file:last-modified($path as xs:string) as xs:dateTime external; - -(:~ - : Returns the size, in bytes, of the file specified by $path, or 0 for directories.
- : - : @param $file value of type xs:string - : @return value of type xs:integer - : @error file:not-found the specified file does not exist. - :) -declare function file:size($file as xs:string) as xs:integer external; - -(:~ - : Returns the name of a file or directory specified by $path. An empty string is returned if the path points to the root directory. - : - : @param $path value of type xs:string - : @return value of type xs:string - :) -declare function file:name($path as xs:string) as xs:string external; - -(:~ - : Returns the absolute path to the parent directory of a file or directory specified by $path. An empty sequence is returned if the path points to a root directory.
The inverse function is file:children.
- : - : @param $path value of type xs:string - : @return value of type xs:string? - :) -declare function file:parent($path as xs:string) as xs:string? external; - -(:~ - : Transforms the $path argument to its native representation on the operating system.
- : - : @param $path value of type xs:string - : @return value of type xs:string - : @error file:not-found the specified file does not exist. - : @error file:io-error the specified path cannot be transformed to its native representation. - :) -declare function file:path-to-native($path as xs:string) as xs:string external; - -(:~ - : Transforms the $path argument to an absolute operating system path.
If the path is relative, and if an absolute $base path is specified, it will be resolved against this path. - : - : @param $path value of type xs:string - : @return value of type xs:string - : @error file:is-relative the specified base path is relative. - :) -declare function file:resolve-path($path as xs:string) as xs:string external; - -(:~ - : Transforms the $path argument to an absolute operating system path.
If the path is relative, and if an absolute $base path is specified, it will be resolved against this path. - : - : @param $path value of type xs:string - : @param $base value of type xs:string - : @return value of type xs:string - : @error file:is-relative the specified base path is relative. - :) -declare function file:resolve-path($path as xs:string, $base as xs:string) as xs:string external; - -(:~ - : Transforms the path specified by $path into a URI with the file:// scheme.
- : - : @param $path value of type xs:string - : @return value of type xs:string - :) -declare function file:path-to-uri($path as xs:string) as xs:string external; - -(:~ - : Returns the directory separator used by the operating system, such as / or \.
- : - : @return value of type xs:string - :) -declare function file:dir-separator() as xs:string external; - -(:~ - : Returns the path separator used by the operating system, such as ; or :.
- : - : @return value of type xs:string - :) -declare function file:path-separator() as xs:string external; - -(:~ - : Returns the line separator used by the operating system, such as &#10;, &#13;&#10; or &#13;.
- : - : @return value of type xs:string - :) -declare function file:line-separator() as xs:string external; - -(:~ - : Returns the system’s default temporary-file directory.
- : - : @return value of type xs:string - :) -declare function file:temp-dir() as xs:string external; - -(:~ - : Returns the current working directory. This function returns the same result as the function call file:resolve-path(""). - : - : @return value of type xs:string - :) -declare function file:current-dir() as xs:string external; - -(:~ - : Returns the parent directory of the static base URI. If the Base URI property is undefined, the empty sequence is returned. - If a static base URI exists, and if points to a local file path, this function returns the same result as the expression file:parent(static-base-uri()). - : - : @return value of type xs:string? - :) -declare function file:base-dir() as xs:string? external; diff --git a/packages.src/basex-9.6/ft.xqm b/packages.src/basex-9.6/ft.xqm deleted file mode 100644 index 705e6be..0000000 --- a/packages.src/basex-9.6/ft.xqm +++ /dev/null @@ -1,168 +0,0 @@ -(:~ - : This XQuery Module extends the W3C Full Text Recommendation with some useful functions: The index can be directly accessed, fulltext results can be marked with additional elements, or the relevant parts can be extracted. Moreover, the score value, which is generated by the contains text expression, can be explicitly requested from items. - : - : @author BaseX Team - : @see /wiki/Full-Text_Module - :) -module namespace ft = "http://basex.org/modules/ft"; - -(:~ - : Returns all text nodes from the full-text index of the database $db that contain the specified $terms.
The options used for tokenizing the input and building the full-text will also be applied to the search terms. As an example, if the index terms have been stemmed, the search string will be stemmed as well.

The $options argument can be used to control full-text processing. The following options are supported (the introduction on Full-Text processing gives you equivalent expressions in the XQuery Full-Text notation):

  • mode: determines the mode how tokens are searched. Allowed values are any, any word, all, all words, and phrase. any is the default search mode.
  • fuzzy: turns fuzzy querying on or off. Allowed values are true and false. By default, fuzzy querying is turned off.
  • wildcards: turns wildcard querying on or off. Allowed values are true and false. By default, wildcard querying is turned off.
  • ordered: requires that all tokens occur in the order in which they are specified. Allowed values are true and false. The default is false.
  • content: specifies that the matched tokens need to occur at the beginning or end of a searched string, or need to cover the entire string. Allowed values are start, end, and entire. By default, the option is turned off.
  • scope: defines the scope in which tokens must be located. The option has following sub options:
    • same: can be set to true or false. It specifies if tokens need to occur in the same or different units.
    • unit: can be sentence or paragraph. It specifies the unit for finding tokens.
  • window: sets up a window in which all tokens must be located. By default, the option is turned off. It has following sub options:
    • size: specifies the size of the window in terms of units.
    • unit: can be sentences, sentences or paragraphs. The default is words.
  • distance: specifies the distance in which tokens must occur. By default, the option is turned off. It has following sub options:
    • min: specifies the minimum distance in terms of units. The default is 0.
    • max: specifies the maximum distance in terms of units. The default is ∞.
    • unit: can be words, sentences or paragraphs. The default is words.
- : - : @param $db value of type xs:string - : @param $terms value of type item()* - : @return value of type text()* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - : @error ft:options the fuzzy and wildcard option cannot be both specified. - :) -declare function ft:search($db as xs:string, $terms as item()*) as text()* external; - -(:~ - : Returns all text nodes from the full-text index of the database $db that contain the specified $terms.
The options used for tokenizing the input and building the full-text will also be applied to the search terms. As an example, if the index terms have been stemmed, the search string will be stemmed as well.

The $options argument can be used to control full-text processing. The following options are supported (the introduction on Full-Text processing gives you equivalent expressions in the XQuery Full-Text notation):

  • mode: determines the mode how tokens are searched. Allowed values are any, any word, all, all words, and phrase. any is the default search mode.
  • fuzzy: turns fuzzy querying on or off. Allowed values are true and false. By default, fuzzy querying is turned off.
  • wildcards: turns wildcard querying on or off. Allowed values are true and false. By default, wildcard querying is turned off.
  • ordered: requires that all tokens occur in the order in which they are specified. Allowed values are true and false. The default is false.
  • content: specifies that the matched tokens need to occur at the beginning or end of a searched string, or need to cover the entire string. Allowed values are start, end, and entire. By default, the option is turned off.
  • scope: defines the scope in which tokens must be located. The option has following sub options:
    • same: can be set to true or false. It specifies if tokens need to occur in the same or different units.
    • unit: can be sentence or paragraph. It specifies the unit for finding tokens.
  • window: sets up a window in which all tokens must be located. By default, the option is turned off. It has following sub options:
    • size: specifies the size of the window in terms of units.
    • unit: can be sentences, sentences or paragraphs. The default is words.
  • distance: specifies the distance in which tokens must occur. By default, the option is turned off. It has following sub options:
    • min: specifies the minimum distance in terms of units. The default is 0.
    • max: specifies the maximum distance in terms of units. The default is ∞.
    • unit: can be words, sentences or paragraphs. The default is words.
- : - : @param $db value of type xs:string - : @param $terms value of type item()* - : @param $options value of type map(*)? - : @return value of type text()* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - : @error ft:options the fuzzy and wildcard option cannot be both specified. - :) -declare function ft:search($db as xs:string, $terms as item()*, $options as map(*)?) as text()* external; - -(:~ - : Checks if the specified $input items contain the specified $terms.
The function does the same as the Full-Text expression contains text, but options can be specified more dynamically. The $options are the same as for ft:search, and the following ones in addition:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.
- : - : @param $input value of type item()* - : @param $terms value of type item()* - : @return value of type xs:boolean - : @error ft:options specified options are conflicting. - :) -declare function ft:contains($input as item()*, $terms as item()*) as xs:boolean external; - -(:~ - : Checks if the specified $input items contain the specified $terms.
The function does the same as the Full-Text expression contains text, but options can be specified more dynamically. The $options are the same as for ft:search, and the following ones in addition:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.
- : - : @param $input value of type item()* - : @param $terms value of type item()* - : @param $options value of type map(*)? - : @return value of type xs:boolean - : @error ft:options specified options are conflicting. - :) -declare function ft:contains($input as item()*, $terms as item()*, $options as map(*)?) as xs:boolean external; - -(:~ - : Puts a marker element around the resulting $nodes of a full-text index request.
The default name of the marker element is mark. An alternative name can be chosen via the optional $name argument.
Please note that:
  • the full-text expression that computes the token positions must be specified as argument of the ft:mark() function, as all position information is lost in subsequent processing steps. You may need to specify more than one full-text expression if you want to use the function in a FLWOR expression, as shown in Example 2.
  • the XML node to be transformed must be an internal "database" node. The transform expression can be used to apply the method to a main-memory fragment, as shown in Example 3.
- : - : @param $nodes value of type node()* - : @return value of type node()* - :) -declare function ft:mark($nodes as node()*) as node()* external; - -(:~ - : Puts a marker element around the resulting $nodes of a full-text index request.
The default name of the marker element is mark. An alternative name can be chosen via the optional $name argument.
Please note that:
  • the full-text expression that computes the token positions must be specified as argument of the ft:mark() function, as all position information is lost in subsequent processing steps. You may need to specify more than one full-text expression if you want to use the function in a FLWOR expression, as shown in Example 2.
  • the XML node to be transformed must be an internal "database" node. The transform expression can be used to apply the method to a main-memory fragment, as shown in Example 3.
- : - : @param $nodes value of type node()* - : @param $name value of type xs:string - : @return value of type node()* - :) -declare function ft:mark($nodes as node()*, $name as xs:string) as node()* external; - -(:~ - : Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark. - : - : @param $nodes value of type node()* - : @return value of type node()* - :) -declare function ft:extract($nodes as node()*) as node()* external; - -(:~ - : Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark. - : - : @param $nodes value of type node()* - : @param $name value of type xs:string - : @return value of type node()* - :) -declare function ft:extract($nodes as node()*, $name as xs:string) as node()* external; - -(:~ - : Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark. - : - : @param $nodes value of type node()* - : @param $name value of type xs:string - : @param $length value of type xs:integer - : @return value of type node()* - :) -declare function ft:extract($nodes as node()*, $name as xs:string, $length as xs:integer) as node()* external; - -(:~ - : Returns the number of occurrences of the search terms specified in a full-text expression. - : - : @param $nodes value of type node()* - : @return value of type xs:integer - :) -declare function ft:count($nodes as node()*) as xs:integer external; - -(:~ - : Returns the score values (0.0 - 1.0) that have been attached to the specified items. 0 is returned a value if no score was attached. - : - : @param $item value of type item()* - : @return value of type xs:double* - :) -declare function ft:score($item as item()*) as xs:double* external; - -(:~ - : Returns all full-text tokens stored in the index of the database $db, along with their numbers of occurrences.
If $prefix is specified, the returned nodes will be refined to the strings starting with that prefix. The prefix will be tokenized according to the full-text used for creating the index. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the full-text index is not available. - :) -declare function ft:tokens($db as xs:string) as element(value)* external; - -(:~ - : Returns all full-text tokens stored in the index of the database $db, along with their numbers of occurrences.
If $prefix is specified, the returned nodes will be refined to the strings starting with that prefix. The prefix will be tokenized according to the full-text used for creating the index. - : - : @param $db value of type xs:string - : @param $prefix value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the full-text index is not available. - :) -declare function ft:tokens($db as xs:string, $prefix as xs:string) as element(value)* external; - -(:~ - : Tokenizes the given $string, using the current default full-text options or the $options specified as second argument, and returns a sequence with the tokenized string. The following options are available:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.

The $options argument can be used to control full-text processing.

- : - : @param $string value of type xs:string? - : @return value of type xs:string* - :) -declare function ft:tokenize($string as xs:string?) as xs:string* external; - -(:~ - : Tokenizes the given $string, using the current default full-text options or the $options specified as second argument, and returns a sequence with the tokenized string. The following options are available:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.

The $options argument can be used to control full-text processing.

- : - : @param $string value of type xs:string? - : @param $options value of type map(*)? - : @return value of type xs:string* - :) -declare function ft:tokenize($string as xs:string?, $options as map(*)?) as xs:string* external; - -(:~ - : Normalizes the given $string, using the current default full-text options or the $options specified as second argument. The function expects the same arguments as ft:tokenize. - : - : @param $string value of type xs:string? - : @return value of type xs:string - :) -declare function ft:normalize($string as xs:string?) as xs:string external; - -(:~ - : Normalizes the given $string, using the current default full-text options or the $options specified as second argument. The function expects the same arguments as ft:tokenize. - : - : @param $string value of type xs:string? - : @param $options value of type map(*)? - : @return value of type xs:string - :) -declare function ft:normalize($string as xs:string?, $options as map(*)?) as xs:string external; diff --git a/packages.src/basex-9.6/geo.xqm b/packages.src/basex-9.6/geo.xqm deleted file mode 100644 index 88e1932..0000000 --- a/packages.src/basex-9.6/geo.xqm +++ /dev/null @@ -1,471 +0,0 @@ -(:~ - : This XQuery Module contains functions that may be applied to geometry data conforming to the Open Geospatial Consortium (OGC) Simple Feature (SF) data model. It is based on the EXPath Geo Module and uses the JTS library. Geometries included in GML 2 are: Point, LineString, LinearRing, Polygon, MultiPoint, MultiLineString, MultiPolygon, and MultiGeometry. All nodes queried by BaseX should be a valid geometry. The only geometry type which is not supported by BaseX right now is MultiGeometry. Moreover, the module provides no support for GML 3. - : - : @author BaseX Team - : @see /wiki/Geo_Module - :) -module namespace geo = "http://expath.org/ns/geo"; -declare namespace experr = "http://expath.org/ns/error"; - -(:~ - : Returns the dimension of the given geometry $geometry. - : - : @param $geometry value of type element(*) - : @return value of type xs:integer - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:dimension($geometry as element(*)) as xs:integer external; - -(:~ - : Returns the name of the geometry type of given geometry $geometry, if the geometry is not recognized with an error massage. - : - : @param $geometry value of type element(*) - : @return value of type xs:QName - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:geometry-type($geometry as element(*)) as xs:QName external; - -(:~ - : Returns the ID of the Spatial Reference System used by the given geometry $geometry. Spatial Reference System information is supported in the simple way defined in the SFS. A Spatial Reference System ID (SRID) is present in each Geometry object. Geometry provides basic accessor operations for this field, but no others. The SRID is represented as an integer (based on the OpenGIS Simple Features Specifications For SQL).
Here is a difference between the EXPath Geo Module and the implementation in BaseX, since the specification return the URI. - : - : @param $geometry value of type element(*) - : @return value of type xs:integer - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:srid($geometry as element(*)) as xs:integer external; - -(:~ - : Returns the gml:Envelope of the given geometry $geometry. The envelope is the minimum bounding box of this geometry. If this Geometry is the empty geometry, returns an empty Point. If the Geometry is a point, returns a non-empty Point. Otherwise, returns a Polygon whose points are (minx, miny), (maxx, miny), (maxx, maxy), (minx, maxy), (minx, miny). - : - : @param $geometry value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:envelope($geometry as element(*)) as element(*) external; - -(:~ - : Returns the WKT (Well-known Text) representation of the given geometry $geometry. The envelope is the minimum bounding box of this geometry - : - : @param $geometry value of type element(*) - : @return value of type xs:string - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:as-text($geometry as element(*)) as xs:string external; - -(:~ - : Returns the WKB (Well-known Binary) representation of the given geometry $geometry. - : - : @param $geometry value of type element(*) - : @return value of type xs:base64Binary - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:as-binary($geometry as element(*)) as xs:base64Binary external; - -(:~ - : Returns whether the given geometry is simple $geometry and does not have has no anomalous geometric points (ie. the geometry does not self-intersect and does not pass through the same point more than once (may be a ring)). - : - : @param $geometry value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:is-simple($geometry as element(*)) as xs:boolean external; - -(:~ - : Returns the boundary of the given geometry $geometry, in GML 2. The return value is a sequence of either gml:Point or gml:LinearRing elements as a GeometryCollection object. For a Point or MultiPoint, the boundary is the empty geometry, nothing is returned. - : - : @param $geometry value of type element(*) - : @return value of type element(*)? - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:boundary($geometry as element(*)) as element(*)? external; - -(:~ - : Returns the number of geometry in a geometry-collection $geometry, in GML. For the geometries which are not a collection, it returns the instant value 1.
This function is implemented wider than the specification and accepts all types of geometries, while the specification limits it to the collection types (MultiPoint, MultiPolygon, ...). - : - : @param $geometry value of type element(*) - : @return value of type xs:integer - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:num-geometries($geometry as element(*)) as xs:integer external; - -(:~ - : Returns the Nth geometry in geometry-collection $geometry, in GML. For the geometries which are not a collection, it returns the geometry if geoNumber $geoNumber is 1.
This function is implemented wider than the specification and accepts all types of geometries, while the specification limits it to the collection types (MultiPoint, MultiPolygon, ...). - : - : @param $geometry value of type element(*) - : @param $geoNumber value of type xs:integer - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0004 the the input index of geometry is out of range. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:geometry-n($geometry as element(*), $geoNumber as xs:integer) as element(*) external; - -(:~ - : Returns the length of the geometry $geometry. If the geometry is a point, zero value will be returned. - : - : @param $geometry value of type element(*) - : @return value of type xs:double - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:length($geometry as element(*)) as xs:double external; - -(:~ - : Returns integer value of number of the points in the given geometry$geometry. It can be used not only for Lines, also any other geometry types, like MultiPolygon. For Point geometry it will return 1.
This is an implementation different from the EXPath geo specification, as it limits the input geometry type only to lines. - : - : @param $geometry value of type element(*) - : @return value of type xs:integer - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:num-points($geometry as element(*)) as xs:integer external; - -(:~ - : Returns the area of the given geometry $geometry. For points and line the return value will be zero. - : - : @param $geometry value of type element(*) - : @return value of type xs:double - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:area($geometry as element(*)) as xs:double external; - -(:~ - : Returns the mathematical centroid of the given geometry $geometry, as a gml:Point. Based on the definition, this point is not always on the surface of the geometry $geometry. - : - : @param $geometry value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:centroid($geometry as element(*)) as element(*) external; - -(:~ - : Returns an interior point on the given geometry $geometry, as a gml:Point. It is guaranteed to be on surface. Otherwise, the point may lie on the boundary of the geometry. - : - : @param $geometry value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:point-on-surface($geometry as element(*)) as element(*) external; - -(:~ - : Returns whether geometry1 $geometry1 is spatially equal to $geometry2 $geometry2. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:equals($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether geometry1 $geometry1 is spatially disjoint from $geometry2 $geometry2 (they have no point in common, they do not intersect each other, and the DE-9IM Intersection Matrix for the two geometries is FF*FF****). - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:disjoint($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether geometry1 $geometry1 is spatially intersects $geometry2 $geometry2. This is true if disjoint function of the two geometries returns false. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:intersects($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether geometry1 $geometry1 is spatially touches $geometry2 $geometry2. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:touches($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether geometry1 $geometry1 is spatially crosses $geometry2 $geometry2. It means, if the geometries have some but not all interior points in common. Returns true if the DE-9IM intersection matrix for the two geometries is:

T*T****** (for P/L, P/A, and L/A situations)
T*****T** (for L/P, A/P, and A/L situations)
0******** (for L/L situations).

- : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:crosses($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether geometry1 $geometry1 is spatially within $geometry2 $geometry2. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:within($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether geometry1 $geometry1 spatially contains $geometry2 $geometry2. Returns true if within function of these two geometries also returns true. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:contains($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether geometry1 $geometry1 is spatially overlaps $geometry2 $geometry2. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:overlaps($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether relationships between the boundaries, interiors and exteriors of geometry1 $geometry1 and geometry2 $geometry2 match the pattern specified in intersectionMatrix $geometry2, which should have the length of 9 charachters.
The values in the DE-9IM can be T, F, *, 0, 1, 2 .

- T means the intersection gives a non-empty result.
- F means the intersection gives an empty result.
- * means any result.
- 0, 1, 2 gives the expected dimension of the result (point, curve, surface)

- : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @param $intersectionMatrix value of type xs:string - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0006 the given matrix is invalid. - :) -declare function geo:relate($geometry1 as element(*), $geometry2 as element(*), $intersectionMatrix as xs:string) as xs:boolean external; - -(:~ - : Returns the shortest distance, in the units of the spatial reference system of geometry1 $geometry1, between the geometries, where that distance is the distance between a point on each of the geometries. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:double - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:distance($geometry1 as element(*), $geometry2 as element(*)) as xs:double external; - -(:~ - : Returns polygonal geometry representing the buffer by distance $distance of geometry $geometry a buffer area around this geometry having the given width, in the spatial reference system of geometry. The buffer of a Geometry is the Minkowski sum or difference of the geometry with a disc of radius abs(distance). The buffer is constructed using 8 segments per quadrant to represent curves. - : - : @param $geometry value of type element(*) - : @param $distance value of type xs:double - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:buffer($geometry as element(*), $distance as xs:double) as element(*) external; - -(:~ - : Returns the convex hull geometry of the given geometry $geometry in GML, or the empty sequence. Actually returns the object of smallest dimension possible. - : - : @param $geometry value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:convex-hull($geometry as element(*)) as element(*) external; - -(:~ - : Returns the intersection geometry of geometry1 $geometry1 with geometry2 $geometry2, in GML or empty sequence if there is no intersection of these geometries. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type element(*)? - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:intersection($geometry1 as element(*), $geometry2 as element(*)) as element(*)? external; - -(:~ - : Returns the union geometry of geometry1 $geometry1 with geometry2 $geometry2, in GML. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:union($geometry1 as element(*), $geometry2 as element(*)) as element(*) external; - -(:~ - : Returns the difference geometry of geometry1 $geometry1 with geometry2 $geometry2, in GML, or empty sequence if the difference is empty, as a set of point in geometry1 $geometry1 and not included in geometry2 $geometry2. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type element(*)? - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:difference($geometry1 as element(*), $geometry2 as element(*)) as element(*)? external; - -(:~ - : Returns the symmetric difference geometry of geometry1 $geometry1 with geometry2 $geometry2, in GML, or empty sequence if the difference is empty, as a set of point in one of the geometries and not included in the other. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type element(*)? - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:sym-difference($geometry1 as element(*), $geometry2 as element(*)) as element(*)? external; - -(:~ - : Returns the x coordinate of point $point. A point has to have an x coordinate. - : - : @param $point value of type element(*) - : @return value of type xs:double - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:x($point as element(*)) as xs:double external; - -(:~ - : Returns the y coordinate of point $point. If the point does not have the y coordinate, 0 will be returned. - : - : @param $point value of type element(*) - : @return value of type xs:double? - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:y($point as element(*)) as xs:double? external; - -(:~ - : Returns the z coordinate of point $point. If the point does not have the y coordinate, 0 will be returned. - : - : @param $point value of type element(*) - : @return value of type xs:double? - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:z($point as element(*)) as xs:double? external; - -(:~ - : Returns the starting point of the given line $line. $line has to be a single line, LineString or LinearRing. - : - : @param $line value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a line. Other geometries are not accepted. - :) -declare function geo:start-point($line as element(*)) as element(*) external; - -(:~ - : Returns the ending point of the given line $line. $line has to be a single line, LineString or LinearRing. - : - : @param $line value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a line. Other geometries are not accepted. - :) -declare function geo:end-point($line as element(*)) as element(*) external; - -(:~ - : Returns a boolean value that shows the line $line is a closed loop (start point and end point are the same) or not. $line has to be a line, as a geometry, LineString or LinearRing, and MultiLineString. - : - : @param $line value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a line. Other geometries are not accepted. - :) -declare function geo:is-closed($line as element(*)) as xs:boolean external; - -(:~ - : Returns a boolean value that shows the line $line is a ring (closed loop and single) or not. $line has to be a single line, as a geometry, LineString or LinearRing. - : - : @param $line value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a line. Other geometries are not accepted. - :) -declare function geo:is-ring($line as element(*)) as xs:boolean external; - -(:~ - : Returns the Nth point in the given line $geometry. $line has to be a single line, as a geometry, LineString or LinearRing. - : - : @param $line value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a line. Other geometries are not accepted. - : @error experr:GEO0004 the the input index of geometry is out of range. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:point-n($line as element(*)) as element(*) external; - -(:~ - : Returns the outer ring of the given polygon $geometry, as a gml:LineString. - : - : @param $polygon value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a polygon. Other geometries are not accepted. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:exterior-ring($polygon as element(*)) as element(*) external; - -(:~ - : Returns the number of interior rings in the given polygon $geometry. - : - : @param $polygon value of type element(*) - : @return value of type xs:integer - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a polygon. Other geometries are not accepted. - :) -declare function geo:num-interior-ring($polygon as element(*)) as xs:integer external; - -(:~ - : Returns the outer ring of the given polygon $geometry, as a gml:LineString. - : - : @param $polygon value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a polygon. Other geometries are not accepted. - : @error experr:GEO0004 the the input index of geometry is out of range. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:interior-ring-n($polygon as element(*)) as element(*) external; diff --git a/packages.src/basex-9.6/hash.xqm b/packages.src/basex-9.6/hash.xqm deleted file mode 100644 index 957cfd1..0000000 --- a/packages.src/basex-9.6/hash.xqm +++ /dev/null @@ -1,41 +0,0 @@ -(:~ - : This XQuery Module provides functions that perform different hash operations. - : - : @author BaseX Team - : @see /wiki/Hashing_Module - :) -module namespace hash = "http://basex.org/modules/hash"; - -(:~ - : Computes the MD5 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary. - : - : @param $value value of type xs:anyAtomicType - : @return value of type xs:base64Binary - :) -declare function hash:md5($value as xs:anyAtomicType) as xs:base64Binary external; - -(:~ - : Computes the SHA-1 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary. - : - : @param $value value of type xs:anyAtomicType - : @return value of type xs:base64Binary - :) -declare function hash:sha1($value as xs:anyAtomicType) as xs:base64Binary external; - -(:~ - : Computes the SHA-256 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary. - : - : @param $value value of type xs:anyAtomicType - : @return value of type xs:base64Binary - :) -declare function hash:sha256($value as xs:anyAtomicType) as xs:base64Binary external; - -(:~ - : Computes the hash of the given $value, using the specified $algorithm. The specified values may be of type xs:string, xs:base64Binary, or xs:hexBinary.
The following three algorihms are supported: MD5, SHA-1, and SHA-256. - : - : @param $value value of type xs:anyAtomicType - : @param $algorithm value of type xs:string - : @return value of type xs:base64Binary - : @error hash:algorithm the specified hashing algorithm is unknown. - :) -declare function hash:hash($value as xs:anyAtomicType, $algorithm as xs:string) as xs:base64Binary external; diff --git a/packages.src/basex-9.6/hof.xqm b/packages.src/basex-9.6/hof.xqm deleted file mode 100644 index daf65da..0000000 --- a/packages.src/basex-9.6/hof.xqm +++ /dev/null @@ -1,81 +0,0 @@ -(:~ - : This XQuery Module adds some useful higher-order functions, additional to the Higher-Order Functions provided by the official specification. - : - : @author BaseX Team - : @see /wiki/Higher-Order_Functions_Module - :) -module namespace hof = "http://basex.org/modules/hof"; - -(:~ - : Works the same as fn:fold-left, but does not need a seed, because the sequence must be non-empty. - : - : @param $seq value of type item()+ - : @param $f value of type function(item()* - : @param item() value of type - : @return value of type item()* - :) -declare function hof:fold-left1($seq as item()+, $f as function(item()*, item()) as item()*) as item()* external; - -(:~ - : Applies the predicate function $pred to $start. If the result is false, $f is invoked with the start value – or, subsequently, with the result of this function – until the predicate function returns true(). - : - : @param $pred value of type function(item()* - : @return value of type item()* - :) -declare function hof:until($pred as function(item()*) as xs:boolean, $f as function(item()*) as item()*, $start as item()*) as item()* external; - -(:~ - : This function is similar to fn:fold-left, but it returns a list of successive reduced values from the left. It is equivalent to:
 declare function hof:scan-left($seq, $acc, $f) { if(empty($seq)) then $acc else ( $acc, hof:scan-left(tail($seq), $f($acc, head($seq)), $f) ) }; 
- : - : @param $seq value of type item()* - : @param $start value of type item()* - : @param $f value of type function(item()* - : @param item() value of type - : @return value of type item()* - :) -declare function hof:scan-left($seq as item()*, $start as item()*, $f as function(item()*, item()) as item()*) as item()* external; - -(:~ - : The function returns items of $seq as long as the predicate $pred is satisfied. It is equivalent to:
 declare function hof:take-while($seq, $pred) { if(empty($seq) or not($pred(head($seq)))) then () else ( head($seq), hof:take-while(tail($seq), $pred) ) }; 
- : - : @param $seq value of type item()* - : @param $pred value of type function(item() - : @return value of type item()* - :) -declare function hof:take-while($seq as item()*, $pred as function(item()) as xs:boolean) as item()* external; - -(:~ - : Returns the $k items in $seq that are greatest when sorted by the result of $f applied to the item. The function is a much more efficient implementation of the following scheme:
 (for $x in $seq order by $sort-key($x) descending return $x )[position() <= $k] 
- : - : @param $seq value of type item()* - : @param $sort-key value of type function(item() - : @return value of type item()* - :) -declare function hof:top-k-by($seq as item()*, $sort-key as function(item()) as item(), $k as xs:integer) as item()* external; - -(:~ - : Returns the $k items in $seq that are greatest when sorted in the order of the less-than predicate $lt. The function is a general version of hof:top-k-by($seq, $sort-key, $k). - : - : @param $seq value of type item()* - : @param $lt value of type function(item() - : @param item() value of type - : @return value of type item()* - :) -declare function hof:top-k-with($seq as item()*, $lt as function(item(), item()) as xs:boolean, $k as xs:integer) as item()* external; - -(:~ - : Returns its argument unchanged. This function isn't useful on its own, but can be used as argument to other higher-order functions. - : - : @param $expr value of type item()* - : @return value of type item()* - :) -declare function hof:id($expr as item()*) as item()* external; - -(:~ - : Returns its first argument unchanged and ignores the second. This function isn't useful on its own, but can be used as argument to other higher-order functions, e.g. when a function combining two values is expected and one only wants to retain the left one. - : - : @param $expr value of type item()* - : @param $ignored value of type item()* - : @return value of type item()* - :) -declare function hof:const($expr as item()*, $ignored as item()*) as item()* external; diff --git a/packages.src/basex-9.6/html.xqm b/packages.src/basex-9.6/html.xqm deleted file mode 100644 index 45a55d5..0000000 --- a/packages.src/basex-9.6/html.xqm +++ /dev/null @@ -1,33 +0,0 @@ -(:~ - : This XQuery Module provides functions for converting HTML to XML. Conversion will only take place if TagSoup is included in the classpath (see HTML Parsing for more details). - : - : @author BaseX Team - : @see /wiki/HTML_Module - :) -module namespace html = "http://basex.org/modules/html"; - -(:~ - : Returns the name of the applied HTML parser (currently: TagSoup). If an empty string is returned, TagSoup was not found in the classpath, and the input will be treated as well-formed XML.
- : - : @return value of type xs:string - :) -declare function html:parser() as xs:string external; - -(:~ - : Converts the HTML document specified by $input to XML, and returns a document node:
  • The input may either be a string or a binary item (xs:hexBinary, xs:base64Binary).
  • If the input is passed on in its binary representation, the HTML parser will try to automatically choose the correct encoding.

The $options argument can be used to set TagSoup Options.

- : - : @param $input value of type xs:anyAtomicType - : @return value of type document-node() - : @error html:parse the input cannot be converted to XML. - :) -declare function html:parse($input as xs:anyAtomicType) as document-node() external; - -(:~ - : Converts the HTML document specified by $input to XML, and returns a document node:
  • The input may either be a string or a binary item (xs:hexBinary, xs:base64Binary).
  • If the input is passed on in its binary representation, the HTML parser will try to automatically choose the correct encoding.

The $options argument can be used to set TagSoup Options.

- : - : @param $input value of type xs:anyAtomicType - : @param $options value of type map(*)? - : @return value of type document-node() - : @error html:parse the input cannot be converted to XML. - :) -declare function html:parse($input as xs:anyAtomicType, $options as map(*)?) as document-node() external; diff --git a/packages.src/basex-9.6/http.xqm b/packages.src/basex-9.6/http.xqm deleted file mode 100644 index e24ac05..0000000 --- a/packages.src/basex-9.6/http.xqm +++ /dev/null @@ -1,53 +0,0 @@ -(:~ - : This XQuery Module contains a single function to send HTTP requests and handle HTTP responses. The function send-request is based on the EXPath HTTP Client Module. It gives full control over the available request and response parameters. For simple GET requests, the Fetch Module may be sufficient. If <http:header name="Accept-Encoding" value="gzip"/> is specified and if the addressed web server provides support for the gzip compression algorithm, the response will automatically be decompressed. - : - : @author BaseX Team - : @see /wiki/HTTP_Module - :) -module namespace http = "http://expath.org/ns/http-client"; -declare namespace exerr = "http://expath.org/ns/error"; - -(:~ - : Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
- : - : @param $request value of type element(http:request) - : @return value of type item()+ - : @error exerr:HC0001 an HTTP error occurred. - : @error exerr:HC0002 error parsing the entity content as XML or HTML. - : @error exerr:HC0003 with a multipart response, the override-media-type must be either a multipart media type or application/octet-stream. - : @error exerr:HC0004 the src attribute on the body element is mutually exclusive with all other attribute (except the media-type). - : @error exerr:HC0005 the request element is not valid. - : @error exerr:HC0006 a timeout occurred waiting for the response. - :) -declare function http:send-request($request as element(http:request)) as item()+ external; - -(:~ - : Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
- : - : @param $request value of type element(http:request)? - : @param $href value of type xs:string? - : @return value of type item()+ - : @error exerr:HC0001 an HTTP error occurred. - : @error exerr:HC0002 error parsing the entity content as XML or HTML. - : @error exerr:HC0003 with a multipart response, the override-media-type must be either a multipart media type or application/octet-stream. - : @error exerr:HC0004 the src attribute on the body element is mutually exclusive with all other attribute (except the media-type). - : @error exerr:HC0005 the request element is not valid. - : @error exerr:HC0006 a timeout occurred waiting for the response. - :) -declare function http:send-request($request as element(http:request)?, $href as xs:string?) as item()+ external; - -(:~ - : Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
- : - : @param $request value of type element(http:request)? - : @param $href value of type xs:string? - : @param $bodies value of type item()* - : @return value of type item()+ - : @error exerr:HC0001 an HTTP error occurred. - : @error exerr:HC0002 error parsing the entity content as XML or HTML. - : @error exerr:HC0003 with a multipart response, the override-media-type must be either a multipart media type or application/octet-stream. - : @error exerr:HC0004 the src attribute on the body element is mutually exclusive with all other attribute (except the media-type). - : @error exerr:HC0005 the request element is not valid. - : @error exerr:HC0006 a timeout occurred waiting for the response. - :) -declare function http:send-request($request as element(http:request)?, $href as xs:string?, $bodies as item()*) as item()+ external; diff --git a/packages.src/basex-9.6/index.xqm b/packages.src/basex-9.6/index.xqm deleted file mode 100644 index 246d4f2..0000000 --- a/packages.src/basex-9.6/index.xqm +++ /dev/null @@ -1,120 +0,0 @@ -(:~ - : This XQuery Module provides functions for displaying information stored in the database index structures. For functions that use the indexes to return nodes see Value Indexes in the Database Module and ft:search in the Full-Text Module. - : - : @author BaseX Team - : @see /wiki/Index_Module - :) -module namespace index = "http://basex.org/modules/index"; - -(:~ - : Returns information about all facets and facet values of the database $db in document structure format.
If $type is specified as flat, the function returns this information in a flat summarized version. The returned data is derived from the Path Index. - : - : @param $db value of type xs:string - : @return value of type xs:string - : @error db:open The addressed database does not exist or could not be opened. - :) -declare function index:facets($db as xs:string) as xs:string external; - -(:~ - : Returns information about all facets and facet values of the database $db in document structure format.
If $type is specified as flat, the function returns this information in a flat summarized version. The returned data is derived from the Path Index. - : - : @param $db value of type xs:string - : @param $type value of type xs:string - : @return value of type xs:string - : @error db:open The addressed database does not exist or could not be opened. - :) -declare function index:facets($db as xs:string, $type as xs:string) as xs:string external; - -(:~ - : Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:texts($db as xs:string) as element(value)* external; - -(:~ - : Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @param $prefix value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:texts($db as xs:string, $prefix as xs:string) as element(value)* external; - -(:~ - : Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @param $start value of type xs:string - : @param $ascending value of type xs:boolean - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:texts($db as xs:string, $start as xs:string, $ascending as xs:boolean) as element(value)* external; - -(:~ - : Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:attributes($db as xs:string) as element(value)* external; - -(:~ - : Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @param $prefix value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:attributes($db as xs:string, $prefix as xs:string) as element(value)* external; - -(:~ - : Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @param $start value of type xs:string - : @param $ascending value of type xs:boolean - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:attributes($db as xs:string, $start as xs:string, $ascending as xs:boolean) as element(value)* external; - -(:~ - : Returns all strings stored in the Token Index of the database $db, along with their number of occurrences. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:tokens($db as xs:string) as element(value)* external; - -(:~ - : Returns all element names stored in the Name Index of the database $db, along with their number of occurrences. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - :) -declare function index:element-names($db as xs:string) as element(value)* external; - -(:~ - : Returns all attribute names stored in the Name Index of the database $db, along with their number of occurrences. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - :) -declare function index:attribute-names($db as xs:string) as element(value)* external; diff --git a/packages.src/basex-9.6/inspect.xqm b/packages.src/basex-9.6/inspect.xqm deleted file mode 100644 index 29d4329..0000000 --- a/packages.src/basex-9.6/inspect.xqm +++ /dev/null @@ -1,72 +0,0 @@ -(:~ - : This XQuery Module contains functions for extracting internal information about modules and functions and generating documentation. - : - : @author BaseX Team - : @see /wiki/Inspection_Module - :) -module namespace inspect = "http://basex.org/modules/inspect"; -declare namespace xqdoc = "http://www.xqdoc.org/1.0"; - -(:~ - : Returns function items for all user-defined functions (both public and private) that are known in the current query context. If a $uri is specified, the addressed module will be compiled, and its functions will be added to the query context and returned to the user. A relative URI will be resolved against the static base URI of the query. - : - : @return value of type function(*)* - :) -declare function inspect:functions() as function(*)* external; - -(:~ - : Returns function items for all user-defined functions (both public and private) that are known in the current query context. If a $uri is specified, the addressed module will be compiled, and its functions will be added to the query context and returned to the user. A relative URI will be resolved against the static base URI of the query. - : - : @param $uri value of type xs:string - : @return value of type function(*)* - :) -declare function inspect:functions($uri as xs:string) as function(*)* external; - -(:~ - : Returns the annotations of the specified $function in a map. - : - : @param $function value of type function(*)? - : @return value of type map(xs:QName, xs:anyAtomicType*) - :) -declare function inspect:function-annotations($function as function(*)?) as map(xs:QName, xs:anyAtomicType*) external; - -(:~ - : Returns a component of the static context of a $function with the specified $name. If no function is supplied, the current static context is considered.
The following components can be requested:
  • base-uri: Static base URI.
  • namespaces: Prefix/URI map with all statically known namespaces.
  • element-namespace: Default element/type namespace URI, or an empty sequence if it is absent.
  • function-namespace: Default function namespace URI, or an empty sequence if it is absent.
  • collation: URI of the default collation.
  • ordering: Ordering mode (ordered/unordered)
  • construction: Construction mode (preserve/strip)
  • default-order-empty: Default order for empty sequences (greatest/least)
  • boundary-space: Boundary-space policy (preserve/strip)
  • copy-namespaces: Copy-namespaces mode (inherit/no-inherit, preserve/no-preserve)
  • decimal-formats: Nested map with all statically known decimal formats
- : - : @param $function value of type function(*)? - : @param $name value of type xs:string - : @return value of type item()* - : @error inspect:unknown The specified component does not exist. - :) -declare function inspect:static-context($function as function(*)?, $name as xs:string) as item()* external; - -(:~ - : Inspects the specified $function and returns an element that describes its structure. The output of this function is similar to eXist-db’s inspect:inspect-function function. - : - : @param $function value of type function(*) - : @return value of type element(function) - :) -declare function inspect:function($function as function(*)) as element(function) external; - -(:~ - : Generates an element that describes all variables and functions in the current query context. - : - : @return value of type element(context) - :) -declare function inspect:context() as element(context) external; - -(:~ - : Retrieves the resource located at the specified $uri, parses it as XQuery module, and generates an element that describes the module's structure. A relative URI will be resolved against the static base URI of the query. - : - : @param $uri value of type xs:string - : @return value of type element(module) - :) -declare function inspect:module($uri as xs:string) as element(module) external; - -(:~ - : Retrieves the resource located at the specified $uri, parses it as XQuery module, and generates an xqDoc element. A relative URI will be resolved against the static base URI of the query.
xqDoc provides a simple vendor-neutral solution for generating documentation from XQuery modules. The documentation conventions have been inspired by the JavaDoc standard. Documentation comments begin with (:~ and end with :), and tags start with @. xqDoc comments can be specified for main and library modules and variable and function declarations.

We have slightly extended the xqDoc conventions to do justice to more recent versions of XQuery (Schema: xqdoc-1.1.30052013.xsd):

  • an <xqdoc:annotations/> node is added to each variable or function that uses annotations. The xqdoc:annotation child nodes may have additional xqdoc:literal elements with type attributes (xs:string, xs:integer, xs:decimal, xs:double) and values.
  • a single <xqdoc:namespaces/> node is added to the root element, which summarizes all prefixes and namespace URIs used or declared in the module.
  • name and type elements are added to variables.
- : - : @param $uri value of type xs:string - : @return value of type element(xqdoc:xqdoc) - :) -declare function inspect:xqdoc($uri as xs:string) as element(xqdoc:xqdoc) external; diff --git a/packages.src/basex-9.6/jobs.xqm b/packages.src/basex-9.6/jobs.xqm deleted file mode 100644 index c884306..0000000 --- a/packages.src/basex-9.6/jobs.xqm +++ /dev/null @@ -1,155 +0,0 @@ -(:~ - : This XQuery Module provides functions for organizing scheduled, queued, running and cached jobs. Jobs can be commands, queries, client or HTTP requests. - : - : @author BaseX Team - : @see /wiki/Jobs_Module - :) -module namespace jobs = "http://basex.org/modules/jobs"; - -(:~ - : Returns the id of the current job. - : - : @return value of type xs:string - :) -declare function jobs:current() as xs:string external; - -(:~ - : Returns the ids of all jobs that are currently registered. The list includes scheduled, queued, running, stopped, and finished jobs with cached results. - : - : @return value of type xs:string* - :) -declare function jobs:list() as xs:string* external; - -(:~ - : Returns information on all jobs that are currently registered, or on a job with the specified $id (or an empty sequence if this job is not found). The list includes scheduled, queued, running jobs, and cached jobs. A string representation of the job, or its URI, will be returned as value. The returned elements have additional attributes:
  • id: job id
  • type: type of the job (command, query, REST, RESTXQ, etc.)
  • state: current state of the job (scheduled, queued, running, or cached)
  • user: the user who started the job
  • duration: evaluation time (for running and cached jobs)
  • start: dateTime string with next start (for jobs that will be executed repeatedly)
- : - : @return value of type element(job)* - :) -declare function jobs:list-details() as element(job)* external; - -(:~ - : Returns information on all jobs that are currently registered, or on a job with the specified $id (or an empty sequence if this job is not found). The list includes scheduled, queued, running jobs, and cached jobs. A string representation of the job, or its URI, will be returned as value. The returned elements have additional attributes:
  • id: job id
  • type: type of the job (command, query, REST, RESTXQ, etc.)
  • state: current state of the job (scheduled, queued, running, or cached)
  • user: the user who started the job
  • duration: evaluation time (for running and cached jobs)
  • start: dateTime string with next start (for jobs that will be executed repeatedly)
- : - : @param $id value of type xs:string - : @return value of type element(job)* - :) -declare function jobs:list-details($id as xs:string) as element(job)* external; - -(:~ - : Indicates if the evaluation of an already running job with the specified $id has finished. As the ids of finished jobs will usually be discarded, unless caching is enabled, the function will also return true for unknown jobs.
  • false indicates that the job id is scheduled, queued, or currently running.
  • true will be returned if the job has either finished, or if the id is unknown (because the ids of all finished jobs will not be cached).
- : - : @param $id value of type xs:string - : @return value of type xs:boolean - :) -declare function jobs:finished($id as xs:string) as xs:boolean external; - -(:~ - : Returns a list of all jobs that have been persistently registered as Services. - : - : @return value of type element(job)* - : @error jobs:services Registered services cannot be parsed. - :) -declare function jobs:services() as element(job)* external; - -(:~ - : Schedules the evaluation of the supplied $query and returns a query id. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via jobs:result, or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time or dateTime can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples for valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a time is specified, the query will be executed at this time of the day. Examples for valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same id is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service.
- : - : @param $query value of type xs:string - : @return value of type xs:string - : @error jobs:overflow Query execution is rejected, because too many jobs are queued or being executed. CACHETIMEOUT can be decreased if the default setting is too restrictive. - : @error jobs:range A specified time or duration is out of range. - : @error jobs:id The specified id is invalid or has already been assigned. - : @error jobs:options The specified options are conflicting. - :) -declare function jobs:eval($query as xs:string) as xs:string external; - -(:~ - : Schedules the evaluation of the supplied $query and returns a query id. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via jobs:result, or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time or dateTime can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples for valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a time is specified, the query will be executed at this time of the day. Examples for valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same id is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service.
- : - : @param $query value of type xs:string - : @param $bindings value of type map(*)? - : @return value of type xs:string - : @error jobs:overflow Query execution is rejected, because too many jobs are queued or being executed. CACHETIMEOUT can be decreased if the default setting is too restrictive. - : @error jobs:range A specified time or duration is out of range. - : @error jobs:id The specified id is invalid or has already been assigned. - : @error jobs:options The specified options are conflicting. - :) -declare function jobs:eval($query as xs:string, $bindings as map(*)?) as xs:string external; - -(:~ - : Schedules the evaluation of the supplied $query and returns a query id. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via jobs:result, or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time or dateTime can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples for valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a time is specified, the query will be executed at this time of the day. Examples for valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same id is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service.
- : - : @param $query value of type xs:string - : @param $bindings value of type map(*)? - : @param $options value of type map(*)? - : @return value of type xs:string - : @error jobs:overflow Query execution is rejected, because too many jobs are queued or being executed. CACHETIMEOUT can be decreased if the default setting is too restrictive. - : @error jobs:range A specified time or duration is out of range. - : @error jobs:id The specified id is invalid or has already been assigned. - : @error jobs:options The specified options are conflicting. - :) -declare function jobs:eval($query as xs:string, $bindings as map(*)?, $options as map(*)?) as xs:string external; - -(:~ - : Schedules the evaluation of the XQuery expression located at $uri and returns a query id. For further details, see jobs:eval. - : - : @param $uri value of type xs:string - : @return value of type xs:string - : @error jobs:overflow Query execution is rejected, because too many jobs are queued or being executed. CACHETIMEOUT can be decreased if the default setting is too restrictive. - : @error jobs:range A specified time or duration is out of range. - : @error jobs:id The specified id is invalid or has already been assigned. - : @error jobs:options The specified options are conflicting. - :) -declare function jobs:invoke($uri as xs:string) as xs:string external; - -(:~ - : Schedules the evaluation of the XQuery expression located at $uri and returns a query id. For further details, see jobs:eval. - : - : @param $uri value of type xs:string - : @param $bindings value of type map(*)? - : @return value of type xs:string - : @error jobs:overflow Query execution is rejected, because too many jobs are queued or being executed. CACHETIMEOUT can be decreased if the default setting is too restrictive. - : @error jobs:range A specified time or duration is out of range. - : @error jobs:id The specified id is invalid or has already been assigned. - : @error jobs:options The specified options are conflicting. - :) -declare function jobs:invoke($uri as xs:string, $bindings as map(*)?) as xs:string external; - -(:~ - : Schedules the evaluation of the XQuery expression located at $uri and returns a query id. For further details, see jobs:eval. - : - : @param $uri value of type xs:string - : @param $bindings value of type map(*)? - : @param $options value of type map(*)? - : @return value of type xs:string - : @error jobs:overflow Query execution is rejected, because too many jobs are queued or being executed. CACHETIMEOUT can be decreased if the default setting is too restrictive. - : @error jobs:range A specified time or duration is out of range. - : @error jobs:id The specified id is invalid or has already been assigned. - : @error jobs:options The specified options are conflicting. - :) -declare function jobs:invoke($uri as xs:string, $bindings as map(*)?, $options as map(*)?) as xs:string external; - -(:~ - : Returns the cached result of a job with the specified job $id:
  • Results can only be retrieved once. After retrieval, the cached result will be dropped.
  • If the original job has raised an error, the cached error will be raised instead.
- : - : @param $id value of type xs:string - : @return value of type item()* - : @error jobs:running the job is still running. - : @error jobs:unknown the supplied id is unknown: The id is unknown, or the result has already been retrieved. - :) -declare function jobs:result($id as xs:string) as item()* external; - -(:~ - : Triggers the cancelation of a job with the specified $id, drops the cached result of a query, or cancels a scheduled job. Unknown ids are ignored. All jobs are gracefully stopped; it is up to the process to decide when it is safe to shut down. The following $options can be supplied:
  • service: additionally removes the job from the job services list.
- : - : @param $id value of type xs:string - :) -declare function jobs:stop($id as xs:string) as empty-sequence() external; - -(:~ - : Waits for the completion of a job with the specified $id:
  • The function will terminate immediately if the job id is unknown. This is the case if a future job has not been queued yet, or if the id has already been discarded after job evaluation.
  • If the function is called with the id of a queued job, or repeatedly executed job, it may stall and never terminate.
- : - : @param $id value of type xs:string - : @error jobs:self The current job is addressed. - :) -declare function jobs:wait($id as xs:string) as empty-sequence() external; diff --git a/packages.src/basex-9.6/json.xqm b/packages.src/basex-9.6/json.xqm deleted file mode 100644 index 2f07a98..0000000 --- a/packages.src/basex-9.6/json.xqm +++ /dev/null @@ -1,47 +0,0 @@ -(:~ - : This XQuery Module contains functions to parse and serialize JSON data JSON (JavaScript Object Notation) is a popular data exchange format for applications written in JavaScript. As there are notable differences between JSON and XML, or XQuery data types, no mapping exists that guarantees a lossless, bidirectional conversion between JSON and XML. For this reason, we offer various mappings, all of which are suited to different use cases. - : - : @author BaseX Team - : @see /wiki/JSON_Module - :) -module namespace json = "http://basex.org/modules/json"; - -(:~ - : Converts the JSON $string to an XQuery value. If the input can be successfully parsed, it can be serialized back to the original JSON representation. The $options argument can be used to control the way the input is converted. - : - : @param $string value of type xs:string? - : @return value of type item()? - : @error json:parse the specified input cannot be parsed as JSON document. - : @error json:options the specified options are conflicting. - :) -declare function json:parse($string as xs:string?) as item()? external; - -(:~ - : Converts the JSON $string to an XQuery value. If the input can be successfully parsed, it can be serialized back to the original JSON representation. The $options argument can be used to control the way the input is converted. - : - : @param $string value of type xs:string? - : @param $options value of type map(*)? - : @return value of type item()? - : @error json:parse the specified input cannot be parsed as JSON document. - : @error json:options the specified options are conflicting. - :) -declare function json:parse($string as xs:string?, $options as map(*)?) as item()? external; - -(:~ - : Serializes the specified $input as JSON, using the specified $options, and returns the result as string:
  • The input is expected to conform to the results that are created by json:parse().
  • Non-conforming items will be serialized as specified in the json output method of the official recommendation.

Values can also be serialized as JSON with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to json, and
  • the options presented in this article need to be assigned to the json parameter.
- : - : @param $input value of type item()? - : @return value of type xs:string - : @error json:serialize the specified node cannot be serialized as JSON document. - :) -declare function json:serialize($input as item()?) as xs:string external; - -(:~ - : Serializes the specified $input as JSON, using the specified $options, and returns the result as string:
  • The input is expected to conform to the results that are created by json:parse().
  • Non-conforming items will be serialized as specified in the json output method of the official recommendation.

Values can also be serialized as JSON with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to json, and
  • the options presented in this article need to be assigned to the json parameter.
- : - : @param $input value of type item()? - : @param $options value of type map(*)? - : @return value of type xs:string - : @error json:serialize the specified node cannot be serialized as JSON document. - :) -declare function json:serialize($input as item()?, $options as map(*)?) as xs:string external; diff --git a/packages.src/basex-9.6/lazy.xqm b/packages.src/basex-9.6/lazy.xqm deleted file mode 100644 index daaa330..0000000 --- a/packages.src/basex-9.6/lazy.xqm +++ /dev/null @@ -1,40 +0,0 @@ -(:~ - : This XQuery Module contains functions for handling lazy items. In contrast to standard XQuery items, a lazy item contains a reference to the actual data, and the data itself will only be retrieved if it is requested. Hence, possible errors will be postponed, and no memory will be occupied by a lazy item as long as its content has not been requested yet. The following BaseX functions return lazy items: Some functions are capable of consuming the contents of lazy items in a streamable fashion: data will not be cached, but instead passed on to another target (file, the calling expression, etc.). The following streaming functions are currently available: The XQuery expression below serves as an example on how large files can be downloaded and written to a file with constant memory consumption: If lazy items are serialized, they will be streamed as well. - : - : @author BaseX Team - : @see /wiki/Lazy_Module - :) -module namespace lazy = "http://basex.org/modules/lazy"; - -(:~ - : Caches the data of lazy $items in a sequence:
  • data of lazy items will be retrieved and cached inside the item.
  • non-lazy items, or lazy items with cached data, will simply be passed through.
  • If $lazy is set to true(), caching will be deferred until the data is eventually requested. Streaming will be disabled: Data will always be cached before a stream is returned.

Caching is advisable if an item will be processed more than once, or if the data may not be available anymore at a later stage.

- : - : @param $items value of type item()* - : @return value of type item()* - :) -declare function lazy:cache($items as item()*) as item()* external; - -(:~ - : Caches the data of lazy $items in a sequence:
  • data of lazy items will be retrieved and cached inside the item.
  • non-lazy items, or lazy items with cached data, will simply be passed through.
  • If $lazy is set to true(), caching will be deferred until the data is eventually requested. Streaming will be disabled: Data will always be cached before a stream is returned.

Caching is advisable if an item will be processed more than once, or if the data may not be available anymore at a later stage.

- : - : @param $items value of type item()* - : @param $lazy value of type xs:boolean - : @return value of type item()* - :) -declare function lazy:cache($items as item()*, $lazy as xs:boolean) as item()* external; - -(:~ - : Checks whether the specified $item is lazy. - : - : @param $item value of type item() - : @return value of type xs:boolean - :) -declare function lazy:is-lazy($item as item()) as xs:boolean external; - -(:~ - : Checks whether the contents of the specified $item are cached. The function will always return true for non-lazy items. - : - : @param $item value of type item() - : @return value of type xs:boolean - :) -declare function lazy:is-cached($item as item()) as xs:boolean external; diff --git a/packages.src/basex-9.6/out.xqm b/packages.src/basex-9.6/out.xqm deleted file mode 100644 index 388e917..0000000 --- a/packages.src/basex-9.6/out.xqm +++ /dev/null @@ -1,41 +0,0 @@ -(:~ - : This XQuery Module contains functions for simplifying formatted data output. - : - : @author BaseX Team - : @see /wiki/Output_Module - :) -module namespace out = "http://basex.org/modules/out"; - -(:~ - : Returns a single carriage return character (&#13;). - : - : @param value of type xs:string - : @return value of type xs:string - :) -declare function out:cr() as xs:string external; - -(:~ - : Returns a single newline character (&#10;). - : - : @param value of type xs:string - : @return value of type xs:string - :) -declare function out:nl() as xs:string external; - -(:~ - : Returns a single tabulator character (&#9;). - : - : @param value of type xs:string - : @return value of type xs:string - :) -declare function out:tab() as xs:string external; - -(:~ - : Returns a formatted string. The remaining arguments specified by $items are applied to the $format string, according to Java’s printf syntax. - : - : @param $format value of type xs:string - : @param $items value of type item( - : @return value of type xs:string - : @error out:format The specified format is not valid. - :) -declare function out:format($format as xs:string, $items as item() ...) as xs:string external; diff --git a/packages.src/basex-9.6/proc.xqm b/packages.src/basex-9.6/proc.xqm deleted file mode 100644 index 2ec1104..0000000 --- a/packages.src/basex-9.6/proc.xqm +++ /dev/null @@ -1,127 +0,0 @@ -(:~ - : This XQuery Module provides functions for executing system commands from XQuery. - : - : @author BaseX Team - : @see /wiki/Process_Module - :) -module namespace proc = "http://basex.org/modules/proc"; - -(:~ - : Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
- : - : @param $cmd value of type xs:string - : @return value of type xs:string - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - : @error proc:error the command could not be executed, or an I/O exception was raised. - : @error proc:code.... If the commands returns an exit code different to 0, an error will be raised. Its code will consist of the letters code and four digits with the exit code. - :) -declare function proc:system($cmd as xs:string) as xs:string external; - -(:~ - : Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
- : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @return value of type xs:string - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - : @error proc:error the command could not be executed, or an I/O exception was raised. - : @error proc:code.... If the commands returns an exit code different to 0, an error will be raised. Its code will consist of the letters code and four digits with the exit code. - :) -declare function proc:system($cmd as xs:string, $args as xs:string*) as xs:string external; - -(:~ - : Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
- : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @param $options value of type map(xs:string - : @param xs:string) value of type - : @return value of type xs:string - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - : @error proc:error the command could not be executed, or an I/O exception was raised. - : @error proc:code.... If the commands returns an exit code different to 0, an error will be raised. Its code will consist of the letters code and four digits with the exit code. - :) -declare function proc:system($cmd as xs:string, $args as xs:string*, $options as map(xs:string, xs:string)) as xs:string external; - -(:~ - : Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system.
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

 <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
- : - : @param $cmd value of type xs:string - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - :) -declare function proc:execute($cmd as xs:string) as element(result) external; - -(:~ - : Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system.
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

 <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
- : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - :) -declare function proc:execute($cmd as xs:string, $args as xs:string*) as element(result) external; - -(:~ - : Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system.
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

 <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
- : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @param $options value of type map(xs:string - : @param xs:string) value of type - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - :) -declare function proc:execute($cmd as xs:string, $args as xs:string*, $options as map(xs:string, xs:string)) as element(result) external; - -(:~ - : Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored). - : - : @param $cmd value of type xs:string - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - :) -declare function proc:fork($cmd as xs:string) as element(result) external; - -(:~ - : Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored). - : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - :) -declare function proc:fork($cmd as xs:string, $args as xs:string*) as element(result) external; - -(:~ - : Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored). - : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @param $options value of type map(xs:string - : @param xs:string) value of type - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - :) -declare function proc:fork($cmd as xs:string, $args as xs:string*, $options as map(xs:string, xs:string)) as element(result) external; - -(:~ - : Returns the system property, specified by $name, or a context parameter of the web.xml file with that name (see Web Applications). An empty sequence is returned if the property does not exist. For environment variables of the operating system, please use fn:environment-variable. - : - : @param $name value of type xs:string - : @return value of type xs:string? - :) -declare function proc:property($name as xs:string) as xs:string? external; - -(:~ - : Returns the names of all Java system properties and context parameters of the web.xml file (see Web Applications). For environment variables of the operating system, please use fn:available-environment-variables. - : - : @return value of type xs:string* - :) -declare function proc:property-names() as xs:string* external; diff --git a/packages.src/basex-9.6/prof.xqm b/packages.src/basex-9.6/prof.xqm deleted file mode 100644 index 0ebd028..0000000 --- a/packages.src/basex-9.6/prof.xqm +++ /dev/null @@ -1,122 +0,0 @@ -(:~ - : This XQuery Module contains various functions to test and profile code, and to dump information to standard output. - : - : @author BaseX Team - : @see /wiki/Profiling_Module - :) -module namespace prof = "http://basex.org/modules/prof"; - -(:~ - : Measures the execution time and memory consumption required for evaluating the specified $expression and returns a map with the results. The following $options are available:
  • memory: Include memory consumption in result (unit: bytes; default: true).
  • time: Include execution time in result (unit: milliseconds; default: true).
  • value: Include value in result (default: true).

Helpful notes:

  • If you are not interested in some of the returned results, you should disable them to save time and memory.
  • Profiling might change the execution behavior of your code: An expression that might be executed iteratively will be cached by the profiling function.
  • If a value has a compact internal representation, memory consumption will be very low, even if the serialized result may consume much more memory.
  • Please note that memory profiling is only approximative, so it can be quite misleading. If the memory option is enabled, main-memory will be garbage-collected before and after evaluation to improve the quality of the measurement.
- : - : @param $expression value of type item() - : @return value of type item()* - :) -declare function prof:track($expression as item()) as item()* external; - -(:~ - : Measures the execution time and memory consumption required for evaluating the specified $expression and returns a map with the results. The following $options are available:
  • memory: Include memory consumption in result (unit: bytes; default: true).
  • time: Include execution time in result (unit: milliseconds; default: true).
  • value: Include value in result (default: true).

Helpful notes:

  • If you are not interested in some of the returned results, you should disable them to save time and memory.
  • Profiling might change the execution behavior of your code: An expression that might be executed iteratively will be cached by the profiling function.
  • If a value has a compact internal representation, memory consumption will be very low, even if the serialized result may consume much more memory.
  • Please note that memory profiling is only approximative, so it can be quite misleading. If the memory option is enabled, main-memory will be garbage-collected before and after evaluation to improve the quality of the measurement.
- : - : @param $expression value of type item() - : @param $options value of type map(*)? - : @return value of type item()* - :) -declare function prof:track($expression as item(), $options as map(*)?) as item()* external; - -(:~ - : Measures the time needed to evaluate $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes. - : - : @param $expr value of type item() - : @return value of type item()* - :) -declare function prof:time($expr as item()) as item()* external; - -(:~ - : Measures the time needed to evaluate $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes. - : - : @param $expr value of type item() - : @param $label value of type xs:string - : @return value of type item()* - :) -declare function prof:time($expr as item(), $label as xs:string) as item()* external; - -(:~ - : Measures the memory allocated by evaluating $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes. - : - : @param $expr value of type item() - : @return value of type item()* - :) -declare function prof:memory($expr as item()) as item()* external; - -(:~ - : Measures the memory allocated by evaluating $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes. - : - : @param $expr value of type item() - : @param $label value of type xs:string - : @return value of type item()* - :) -declare function prof:memory($expr as item(), $label as xs:string) as item()* external; - -(:~ - : Returns the number of milliseconds passed since 1970/01/01 UTC. The granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds. - : - : @return value of type xs:integer - :) -declare function prof:current-ms() as xs:integer external; - -(:~ - : Returns the current value of the most precise available system timer in nanoseconds. - : - : @return value of type xs:integer - :) -declare function prof:current-ns() as xs:integer external; - -(:~ - : Dumps a serialized representation of $expr to STDERR, optionally prefixed with $label, and returns an empty sequence. If the GUI is used, the dumped result is shown in the Info View. - : - : @param $expr value of type item() - :) -declare function prof:dump($expr as item()) as empty-sequence() external; - -(:~ - : Dumps a serialized representation of $expr to STDERR, optionally prefixed with $label, and returns an empty sequence. If the GUI is used, the dumped result is shown in the Info View. - : - : @param $expr value of type item() - : @param $label value of type xs:string - :) -declare function prof:dump($expr as item(), $label as xs:string) as empty-sequence() external; - -(:~ - : Prints a list of all current local and global variable assignments to standard error or, if the GUI is used, to the Info View.
As every query is optimized before being evaluated, not all of the original variables may be visible in the output. Moreover, many variables of function calls will disappear because functions are inlined. Function inlining can be turned off by setting the INLINELIMIT option to 0. - :) -declare function prof:variables() as empty-sequence() external; - -(:~ - : Similar to fn:trace($expr, $msg), but instead of a user-defined message, it emits the compile-time type and estimated result size of its argument. - : - : @param $expr value of type item()* - : @return value of type item()* - :) -declare function prof:type($expr as item()*) as item()* external; - -(:~ - : Swallows all items of the specified $value and returns an empty sequence. This function is helpful if some code needs to be evaluated and if the actual result is irrelevant. - : - : @param $value value of type item()* - :) -declare function prof:void($value as item()*) as empty-sequence() external; - -(:~ - : Sleeps for the specified number of milliseconds. - : - : @param $ms value of type xs:integer - :) -declare function prof:sleep($ms as xs:integer) as empty-sequence() external; - -(:~ - : Returns a human-readable representation of the specified $number. - : - : @param $number value of type xs:integer - : @return value of type xs:string - :) -declare function prof:human($number as xs:integer) as xs:string external; diff --git a/packages.src/basex-9.6/random.xqm b/packages.src/basex-9.6/random.xqm deleted file mode 100644 index 87e235f..0000000 --- a/packages.src/basex-9.6/random.xqm +++ /dev/null @@ -1,87 +0,0 @@ -(:~ - : This XQuery Module contains functions for computing random values. All functions except for random:seeded-double and random:seeded-integer are non-deterministic, i. e., they return different values for each call. - : - : @author BaseX Team - : @see /wiki/Random_Module - :) -module namespace random = "http://basex.org/modules/random"; - -(:~ - : Returns a double value between 0.0 (inclusive) and 1.0 (exclusive).
- : - : @return value of type xs:double - :) -declare function random:double() as xs:double external; - -(:~ - : Returns an integer value, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive)
- : - : @return value of type xs:integer - : @error random:bounds the maximum value is out of bounds. - :) -declare function random:integer() as xs:integer external; - -(:~ - : Returns an integer value, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive)
- : - : @param $max value of type xs:integer - : @return value of type xs:integer - : @error random:bounds the maximum value is out of bounds. - :) -declare function random:integer($max as xs:integer) as xs:integer external; - -(:~ - : Returns a sequence with $num double values between 0.0 (inclusive) and 1.0 (exclusive). The random values are created using the initial seed given in $seed.
- : - : @param $seed value of type xs:integer - : @param $num value of type xs:integer - : @return value of type xs:double* - :) -declare function random:seeded-double($seed as xs:integer, $num as xs:integer) as xs:double* external; - -(:~ - : Returns a sequence with $num integer values, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive). The random values are created using the initial seed given in $seed.
- : - : @param $seed value of type xs:integer - : @param $num value of type xs:integer - : @return value of type xs:integer* - : @error random:bounds the maximum value is out of bounds. - : @error random:negative the number of values to be returned is negative. - :) -declare function random:seeded-integer($seed as xs:integer, $num as xs:integer) as xs:integer* external; - -(:~ - : Returns a sequence with $num integer values, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive). The random values are created using the initial seed given in $seed.
- : - : @param $seed value of type xs:integer - : @param $num value of type xs:integer - : @param $max value of type xs:integer - : @return value of type xs:integer* - : @error random:bounds the maximum value is out of bounds. - : @error random:negative the number of values to be returned is negative. - :) -declare function random:seeded-integer($seed as xs:integer, $num as xs:integer, $max as xs:integer) as xs:integer* external; - -(:~ - : Returns a sequence with $num double values. The random values are Gaussian (i.e. normally) distributed with the mean 0.0. and the derivation 1.0.
- : - : @param $num value of type xs:integer - : @return value of type xs:double* - :) -declare function random:gaussian($num as xs:integer) as xs:double* external; - -(:~ - : Returns a random permutation of the specified $items. The random order is created using the initial seed given in $seed.
- : - : @param $seed value of type xs:integer - : @param $items value of type item()* - : @return value of type item()* - :) -declare function random:seeded-permutation($seed as xs:integer, $items as item()*) as item()* external; - -(:~ - : Creates a random universally unique identifier (UUID), represented as 128-bit value. - : - : @return value of type xs:string - :) -declare function random:uuid() as xs:string external; diff --git a/packages.src/basex-9.6/repo.xqm b/packages.src/basex-9.6/repo.xqm deleted file mode 100644 index 333ee6d..0000000 --- a/packages.src/basex-9.6/repo.xqm +++ /dev/null @@ -1,35 +0,0 @@ -(:~ - : This XQuery Module contains functions for installing, listing and deleting modules contained in the Repository. - : - : @author BaseX Team - : @see /wiki/Repository_Module - :) -module namespace repo = "http://basex.org/modules/repo"; - -(:~ - : Installs a package or replaces an existing package. The parameter $path indicates the path to the package.
- : - : @param $path value of type xs:string - : @error repo:not-found a package does not exist. - : @error repo:descriptor the package descriptor is invalid. - : @error repo:installed the module contained in the package to be installed is already installed as part of another package. - : @error repo:parse an error occurred while parsing the package. - : @error repo:version the package version is not supported. - :) -declare function repo:install($path as xs:string) as empty-sequence() external; - -(:~ - : Deletes a package. The parameter $pkg indicates the package name, optionally suffixed with a dash and the package version.
- : - : @param $pkg value of type xs:string - : @error repo:not-found a package does not exist. - : @error repo:delete the package cannot be deleted. - :) -declare function repo:delete($pkg as xs:string) as empty-sequence() external; - -(:~ - : Lists the names and versions of all currently installed packages.
- : - : @return value of type element(package)* - :) -declare function repo:list() as element(package)* external; diff --git a/packages.src/basex-9.6/request.xqm b/packages.src/basex-9.6/request.xqm deleted file mode 100644 index 2e23285..0000000 --- a/packages.src/basex-9.6/request.xqm +++ /dev/null @@ -1,171 +0,0 @@ -(:~ - : This XQuery Module contains functions for retrieving information on an HTTP request that has triggered the query. It is mainly useful in the context of Web Applications. The module is related to Adam Retter’s EXQuery Request Module draft. - : - : @author BaseX Team - : @see /wiki/Request_Module - :) -module namespace request = "http://exquery.org/ns/request"; - -(:~ - : Returns the Method of the HTTP request. - : - : @return value of type xs:string - :) -declare function request:method() as xs:string external; - -(:~ - : Returns the value of an attribute of the HTTP request. If the attribute does not exist, an empty sequence is returned. - : - : @param $name value of type xs:string - : @return value of type xs:string - :) -declare function request:attribute($name as xs:string) as xs:string external; - -(:~ - : Returns the Scheme component of the URI of an HTTP request. - : - : @return value of type xs:string - :) -declare function request:scheme() as xs:string external; - -(:~ - : Returns the Hostname component of the URI of an HTTP request. - : - : @return value of type xs:string - :) -declare function request:hostname() as xs:string external; - -(:~ - : Returns the Port component of the URI of an HTTP request, or a default port if it has not been explicitly specified in the URI. - : - : @return value of type xs:integer - :) -declare function request:port() as xs:integer external; - -(:~ - : Returns the Path component of the URI of an HTTP request. - : - : @return value of type xs:string - :) -declare function request:path() as xs:string external; - -(:~ - : Returns the Query component of the URI of an HTTP request. If no query has been specified, an empty sequence is returned. - : - : @return value of type xs:string? - :) -declare function request:query() as xs:string? external; - -(:~ - : Returns the complete URI of an HTTP request as it has been specified by the client. - : - : @return value of type xs:anyURI - :) -declare function request:uri() as xs:anyURI external; - -(:~ - : Returns the context of the request. For servlets in the default (root) context, this method returns an empty string. - : - : @return value of type xs:string - :) -declare function request:context-path() as xs:string external; - -(:~ - : Returns the IP address of the server. - : - : @return value of type xs:string - :) -declare function request:address() as xs:string external; - -(:~ - : Returns the fully qualified hostname of the client that sent the request. - : - : @return value of type xs:string - :) -declare function request:remote-hostname() as xs:string external; - -(:~ - : Returns the IP address of the client that sent the request. - : - : @return value of type xs:string - :) -declare function request:remote-address() as xs:string external; - -(:~ - : Returns the TCP port of the client socket that triggered the request. - : - : @return value of type xs:string - :) -declare function request:remote-port() as xs:string external; - -(:~ - : Returns the names of all query and form field parameters available from the HTTP request. With RESTXQ, this function can be used to access parameters that have not been statically bound by %rest:query-param. - : - : @return value of type xs:string* - :) -declare function request:parameter-names() as xs:string* external; - -(:~ - : Returns the value of the named query or form field parameter in an HTTP request. If the parameter does not exist, an empty sequence or the optionally specified default value is returned instead. If both query and form field parameters with the same name exist, the form field values will be attached to the query values. - : - : @param $name value of type xs:string - : @return value of type xs:string* - :) -declare function request:parameter($name as xs:string) as xs:string* external; - -(:~ - : Returns the value of the named query or form field parameter in an HTTP request. If the parameter does not exist, an empty sequence or the optionally specified default value is returned instead. If both query and form field parameters with the same name exist, the form field values will be attached to the query values. - : - : @param $name value of type xs:string - : @param $default value of type xs:string - : @return value of type xs:string* - :) -declare function request:parameter($name as xs:string, $default as xs:string) as xs:string* external; - -(:~ - : Returns the names of all headers available from the HTTP request. If RESTXQ is used, this function can be used to access headers that have not been statically bound by %rest:header-param. - : - : @return value of type xs:string* - :) -declare function request:header-names() as xs:string* external; - -(:~ - : Returns the value of the named header in an HTTP request. If the header does not exist, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @return value of type xs:string? - :) -declare function request:header($name as xs:string) as xs:string? external; - -(:~ - : Returns the value of the named header in an HTTP request. If the header does not exist, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @param $default value of type xs:string - : @return value of type xs:string - :) -declare function request:header($name as xs:string, $default as xs:string) as xs:string external; - -(:~ - : Returns the names of all cookies in the HTTP headers available from the HTTP request. If RESTXQ is used, this function can be used to access cookies that have not been statically bound by %rest:cookie-param. - : - : @return value of type xs:string* - :) -declare function request:cookie-names() as xs:string* external; - -(:~ - : Returns the value of the named Cookie in an HTTP request. If there is no such cookie, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @return value of type xs:string* - :) -declare function request:cookie($name as xs:string) as xs:string* external; - -(:~ - : Returns the value of the named Cookie in an HTTP request. If there is no such cookie, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @param $default value of type xs:string - : @return value of type xs:string - :) -declare function request:cookie($name as xs:string, $default as xs:string) as xs:string external; diff --git a/packages.src/basex-9.6/rest.xqm b/packages.src/basex-9.6/rest.xqm deleted file mode 100644 index e4f76c3..0000000 --- a/packages.src/basex-9.6/rest.xqm +++ /dev/null @@ -1,34 +0,0 @@ -(:~ - : This XQuery Module contains helper functions for the RESTXQ API, some of which are defined in the RESTXQ Draft. - : - : @author BaseX Team - : @see /wiki/RESTXQ_Module - :) -module namespace rest = "http://exquery.org/ns/restxq"; -declare namespace wadl = "http://wadl.dev.java.net/2009/02"; - -(:~ - : Returns the implementation-defined base URI of the resource function. - : - : @return value of type xs:anyURI - :) -declare function rest:base-uri() as xs:anyURI external; - -(:~ - : Returns the complete URI that addresses the Resource Function. This is the result of rest:base-uri appended with the path from the path annotation of the resource function. - : - : @return value of type xs:anyURI - :) -declare function rest:uri() as xs:anyURI external; - -(:~ - : Returns a WADL description of all available REST services. - : - : @return value of type element(wadl:application) - :) -declare function rest:wadl() as element(wadl:application) external; - -(:~ - : Initializes the RESTXQ module cache. This function should be called after RESTXQ modules have been replaced while the web server is running, and if PARSERESTXQ is not set to 0. - :) -declare function rest:init() as empty-sequence() external; diff --git a/packages.src/basex-9.6/session.xqm b/packages.src/basex-9.6/session.xqm deleted file mode 100644 index 455fe8c..0000000 --- a/packages.src/basex-9.6/session.xqm +++ /dev/null @@ -1,75 +0,0 @@ -(:~ - : This XQuery Module contains functions for accessing and modifying server-side session information. This module is mainly useful in the context of Web Applications. - : - : @author BaseX Team - : @see /wiki/Session_Module - :) -module namespace session = "http://basex.org/modules/session"; - -(:~ - : Returns the session ID of a servlet request. - : - : @return value of type xs:string - :) -declare function session:id() as xs:string external; - -(:~ - : Returns the creation time of a session. - : - : @return value of type xs:dateTime - :) -declare function session:created() as xs:dateTime external; - -(:~ - : Returns the last access time of a session. - : - : @return value of type xs:dateTime - :) -declare function session:accessed() as xs:dateTime external; - -(:~ - : Returns the names of all variables bound to the current session. - : - : @return value of type xs:string* - :) -declare function session:names() as xs:string* external; - -(:~ - : Returns the value of a session attribute with the specified $name. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $name value of type xs:string - : @return value of type item()* - : @error session:get the value of an attribute could not be retrieved. - :) -declare function session:get($name as xs:string) as item()* external; - -(:~ - : Returns the value of a session attribute with the specified $name. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $name value of type xs:string - : @param $default value of type item()* - : @return value of type item()* - : @error session:get the value of an attribute could not be retrieved. - :) -declare function session:get($name as xs:string, $default as item()*) as item()* external; - -(:~ - : Binds the specified $value to the session attribute with the specified $name. - : - : @param $name value of type xs:string - : @param $value value of type item()* - : @error session:set The supplied value cannot be materialized. - :) -declare function session:set($name as xs:string, $value as item()*) as empty-sequence() external; - -(:~ - : Deletes a session attribute with the specified $name. - : - : @param $name value of type xs:string - :) -declare function session:delete($name as xs:string) as empty-sequence() external; - -(:~ - : Unregisters a session and all data associated with it. - :) -declare function session:close() as empty-sequence() external; diff --git a/packages.src/basex-9.6/sessions.xqm b/packages.src/basex-9.6/sessions.xqm deleted file mode 100644 index 95c8a2b..0000000 --- a/packages.src/basex-9.6/sessions.xqm +++ /dev/null @@ -1,84 +0,0 @@ -(:~ - : This XQuery Module can only be called from users with Admin permissions. It contains functions for accessing and modifying all registered server-side sessions. This module is mainly useful in the context of Web Applications. - : - : @author BaseX Team - : @see /wiki/Sessions_Module - :) -module namespace sessions = "http://basex.org/modules/sessions"; - -(:~ - : Returns the IDs of all registered sessions. - : - : @return value of type xs:string* - :) -declare function sessions:ids() as xs:string* external; - -(:~ - : Returns the creation time of the session specified by $id. - : - : @param $id value of type xs:string - : @return value of type xs:dateTime - :) -declare function sessions:created($id as xs:string) as xs:dateTime external; - -(:~ - : Returns the last access time of the session specified by $id. - : - : @param $id value of type xs:string - : @return value of type xs:dateTime - :) -declare function sessions:accessed($id as xs:string) as xs:dateTime external; - -(:~ - : Returns the names of all variables bound to the session specified by $id. - : - : @param $id value of type xs:string - : @return value of type xs:string* - :) -declare function sessions:names($id as xs:string) as xs:string* external; - -(:~ - : Returns the value of an attribute with the specified $name from the session with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @return value of type item()* - : @error sessions:get the value of an attribute could not be retrieved. - :) -declare function sessions:get($id as xs:string, $name as xs:string) as item()* external; - -(:~ - : Returns the value of an attribute with the specified $name from the session with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @param $default value of type item()* - : @return value of type item()* - : @error sessions:get the value of an attribute could not be retrieved. - :) -declare function sessions:get($id as xs:string, $name as xs:string, $default as item()*) as item()* external; - -(:~ - : Returns the specified value to the attribute with the specified $name from the session with the specified $id. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @param $value value of type item()* - : @error sessions:set The supplied value cannot be materialized. - :) -declare function sessions:set($id as xs:string, $name as xs:string, $value as item()*) as empty-sequence() external; - -(:~ - : Deletes an attribute with the specified $name from the session with the specified $id. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - :) -declare function sessions:delete($id as xs:string, $name as xs:string) as empty-sequence() external; - -(:~ - : Unregisters the session specified by $id. - : - : @param $id value of type xs:string - :) -declare function sessions:close($id as xs:string) as empty-sequence() external; diff --git a/packages.src/basex-9.6/sql.xqm b/packages.src/basex-9.6/sql.xqm deleted file mode 100644 index 1195d0e..0000000 --- a/packages.src/basex-9.6/sql.xqm +++ /dev/null @@ -1,141 +0,0 @@ -(:~ - : This XQuery Module contains functions to access relational databases from XQuery using SQL. With this module, you can execute query, update and prepared statements, and the result sets are returned as sequences of XML elements representing tuples. Each element has children representing the columns returned by the SQL statement. This module uses JDBC to connect to a SQL server. Hence, your JDBC driver will need to be added to the classpath, too. If you work with the full distributions of BaseX, you can copy the driver into the lib directory. To connect to MySQL, for example, download the Connector/J Driver and extract the archive into this directory. - : - : @author BaseX Team - : @see /wiki/SQL_Module - :) -module namespace sql = "http://basex.org/modules/sql"; - -(:~ - : This function initializes a JDBC driver specified via $class. This step might be superfluous if the SQL database is not embedded.
- : - : @param $class value of type xs:string - : @error sql:init the specified driver is not found. - :) -declare function sql:init($class as xs:string) as empty-sequence() external; - -(:~ - : This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:[//<server>[/<database>]]. If the parameters $user and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options. - : - : @param $url value of type xs:string - : @return value of type xs:anyURI - : @error sql:error an SQL exception occurred when connecting to the database. - :) -declare function sql:connect($url as xs:string) as xs:anyURI external; - -(:~ - : This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:[//<server>[/<database>]]. If the parameters $user and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options. - : - : @param $url value of type xs:string - : @param $user value of type xs:string - : @param $password value of type xs:string - : @return value of type xs:anyURI - : @error sql:error an SQL exception occurred when connecting to the database. - :) -declare function sql:connect($url as xs:string, $user as xs:string, $password as xs:string) as xs:anyURI external; - -(:~ - : This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:[//<server>[/<database>]]. If the parameters $user and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options. - : - : @param $url value of type xs:string - : @param $user value of type xs:string - : @param $password value of type xs:string - : @param $options value of type map(*)? - : @return value of type xs:anyURI - : @error sql:error an SQL exception occurred when connecting to the database. - :) -declare function sql:connect($url as xs:string, $user as xs:string, $password as xs:string, $options as map(*)?) as xs:anyURI external; - -(:~ - : This function executes an SQL $statement, using the connection with the specified $id. The returned result depends on the kind of statement:
  • If an update statement was executed, the number of updated rows will be returned as integer.
  • Otherwise, an XML representation of all results will be returned.

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
- : - : @param $id value of type xs:anyURI - : @param $statement value of type xs:string - : @return value of type item()* - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - : @error sql:timeout query execution exceeded timeout. - :) -declare function sql:execute($id as xs:anyURI, $statement as xs:string) as item()* external; - -(:~ - : This function executes an SQL $statement, using the connection with the specified $id. The returned result depends on the kind of statement:
  • If an update statement was executed, the number of updated rows will be returned as integer.
  • Otherwise, an XML representation of all results will be returned.

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
- : - : @param $id value of type xs:anyURI - : @param $statement value of type xs:string - : @param $options value of type map(*)? - : @return value of type item()* - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - : @error sql:timeout query execution exceeded timeout. - :) -declare function sql:execute($id as xs:anyURI, $statement as xs:string, $options as map(*)?) as item()* external; - -(:~ - : This function executes a prepared statement with the specified $id. The output format is identical to sql:execute. The optional parameter $params is an element <sql:parameters/> representing the parameters for a prepared statement along with their types and values. The following schema shall be used:
 element sql:parameters { element sql:parameter { attribute type { "int" | "string" | "boolean" | "date" | "double" | "float" | "short" | "time" | "timestamp" | "sqlxml" }, attribute null { "true" | "false" }?, text }+ }? 

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
- : - : @param $id value of type xs:anyURI - : @param $params value of type element(sql:parameters) - : @return value of type item()* - : @error sql:attribute an attribute different from type and null is set for a <sql:parameter/> element. - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - : @error sql:parameters no parameter type specified. - : @error sql:timeout query execution exceeded timeout. - : @error sql:type the value of a parameter cannot be converted to the specified format. - :) -declare function sql:execute-prepared($id as xs:anyURI, $params as element(sql:parameters)) as item()* external; - -(:~ - : This function executes a prepared statement with the specified $id. The output format is identical to sql:execute. The optional parameter $params is an element <sql:parameters/> representing the parameters for a prepared statement along with their types and values. The following schema shall be used:
 element sql:parameters { element sql:parameter { attribute type { "int" | "string" | "boolean" | "date" | "double" | "float" | "short" | "time" | "timestamp" | "sqlxml" }, attribute null { "true" | "false" }?, text }+ }? 

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
- : - : @param $id value of type xs:anyURI - : @param $params value of type element(sql:parameters) - : @param $options value of type map(*)? - : @return value of type item()* - : @error sql:attribute an attribute different from type and null is set for a <sql:parameter/> element. - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - : @error sql:parameters no parameter type specified. - : @error sql:timeout query execution exceeded timeout. - : @error sql:type the value of a parameter cannot be converted to the specified format. - :) -declare function sql:execute-prepared($id as xs:anyURI, $params as element(sql:parameters), $options as map(*)?) as item()* external; - -(:~ - : This function prepares an SQL $statement, using the specified connection $id, and returns the id reference to this statement. The statement is a string with one or more '?' placeholders. If the value of a field has to be set to NULL, then the attribute null of the <sql:parameter/> element must be true. - : - : @param $id value of type xs:anyURI - : @param $statement value of type xs:string - : @return value of type xs:anyURI - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - :) -declare function sql:prepare($id as xs:anyURI, $statement as xs:string) as xs:anyURI external; - -(:~ - : This function commits the changes made to a relational database, using the specified connection $id. - : - : @param $id value of type xs:anyURI - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - :) -declare function sql:commit($id as xs:anyURI) as empty-sequence() external; - -(:~ - : This function rolls back the changes made to a relational database, using the specified connection $id. - : - : @param $id value of type xs:anyURI - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - :) -declare function sql:rollback($id as xs:anyURI) as empty-sequence() external; - -(:~ - : This function closes a database connection with the specified $id.
Opened connections will automatically be closed after the XQuery expression has been evaluated, but in order to save memory, it is always recommendable to close connections that are not used anymore. - : - : @param $id value of type xs:anyURI - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - :) -declare function sql:close($id as xs:anyURI) as empty-sequence() external; diff --git a/packages.src/basex-9.6/strings.xqm b/packages.src/basex-9.6/strings.xqm deleted file mode 100644 index 4935bc6..0000000 --- a/packages.src/basex-9.6/strings.xqm +++ /dev/null @@ -1,32 +0,0 @@ -(:~ - : This XQuery Module contains functions for string computations. - : - : @author BaseX Team - : @see /wiki/Strings_Module - :) -module namespace strings = "http://basex.org/modules/strings"; - -(:~ - : Computes the Damerau-Levenshtein Distance for two strings and returns a double value (0.0 - 1.0). The returned value is computed as follows:
  • 1.0 – distance / max(length of strings)
  • 1.0 is returned if the strings are equal; 0.0 is returned if the strings are too different.
- : - : @param $string1 value of type xs:string - : @param $string2 value of type xs:string - : @return value of type xs:double - :) -declare function strings:levenshtein($string1 as xs:string, $string2 as xs:string) as xs:double external; - -(:~ - : Computes the Soundex value for the specified string. The algorithm can be used to find and index English words with similar pronouncation. - : - : @param $string value of type xs:string - : @return value of type xs:string - :) -declare function strings:soundex($string as xs:string) as xs:string external; - -(:~ - : Computes the Kölner Phonetik value for the specified string. Similar to Soundex, the algorithm is used to find similarly pronounced words, but for the German language. As the first returned digit can be 0, the value is returned as string. - : - : @param $string value of type xs:string - : @return value of type xs:string - :) -declare function strings:cologne-phonetic($string as xs:string) as xs:string external; diff --git a/packages.src/basex-9.6/unit.xqm b/packages.src/basex-9.6/unit.xqm deleted file mode 100644 index aa45461..0000000 --- a/packages.src/basex-9.6/unit.xqm +++ /dev/null @@ -1,58 +0,0 @@ -(:~ - : This XQuery Module contains annotations and functions for performing XQUnit tests. - : - : @author BaseX Team - : @see /wiki/Unit_Module - :) -module namespace unit = "http://basex.org/modules/unit"; - -(:~ - : Asserts that the effective boolean value of the specified $test is true and returns an empty sequence. Otherwise, raises an error. The effective boolean value of an expression can be explicitly computed by using the fn:boolean function.
The default failure message can be overridden with the $info argument. - : - : @param $test value of type item()* - : @error unit:fail the assertion failed, or an error was raised. - :) -declare function unit:assert($test as item()*) as empty-sequence() external; - -(:~ - : Asserts that the effective boolean value of the specified $test is true and returns an empty sequence. Otherwise, raises an error. The effective boolean value of an expression can be explicitly computed by using the fn:boolean function.
The default failure message can be overridden with the $info argument. - : - : @param $test value of type item()* - : @param $info value of type item() - : @error unit:fail the assertion failed, or an error was raised. - :) -declare function unit:assert($test as item()*, $info as item()) as empty-sequence() external; - -(:~ - : Asserts that the specified arguments are equal according to the rules of the fn:deep-equal function. Otherwise, raises an error.
The default failure message can be overridden with the $info argument. - : - : @param $returned value of type item()* - : @param $expected value of type item()* - : @error unit:fail the assertion failed, or an error was raised. - :) -declare function unit:assert-equals($returned as item()*, $expected as item()*) as empty-sequence() external; - -(:~ - : Asserts that the specified arguments are equal according to the rules of the fn:deep-equal function. Otherwise, raises an error.
The default failure message can be overridden with the $info argument. - : - : @param $returned value of type item()* - : @param $expected value of type item()* - : @param $info value of type item() - : @error unit:fail the assertion failed, or an error was raised. - :) -declare function unit:assert-equals($returned as item()*, $expected as item()*, $info as item()) as empty-sequence() external; - -(:~ - : Raises a unit error. The default failure message can be overridden with the $info argument. - : - : @error unit:fail default error raised by this function. - :) -declare function unit:fail() as empty-sequence() external; - -(:~ - : Raises a unit error. The default failure message can be overridden with the $info argument. - : - : @param $info value of type item() - : @error unit:fail default error raised by this function. - :) -declare function unit:fail($info as item()) as empty-sequence() external; diff --git a/packages.src/basex-9.6/update.xqm b/packages.src/basex-9.6/update.xqm deleted file mode 100644 index 728286e..0000000 --- a/packages.src/basex-9.6/update.xqm +++ /dev/null @@ -1,55 +0,0 @@ -(:~ - : This XQuery Module provides additional functions for performing updates and returning results in updating expressions. - : - : @author BaseX Team - : @see /wiki/Update_Module - :) -module namespace update = "http://basex.org/modules/update"; - -(:~ - : The updating variant of fn:apply applies the specified updating $function to the specified $arguments. - : - : @param $function value of type function(*) - : @param $arguments value of type array(*) - :) -declare function update:apply($function as function(*), $arguments as array(*)) as empty-sequence() external; - -(:~ - : The updating variant of fn:for-each applies the specified updating $function to every item of $seq. - : - : @param $seq value of type item()* - : @param $function value of type function(item() - :) -declare function update:for-each($seq as item()*, $function as function(item()) as item()*) as empty-sequence() external; - -(:~ - : The updating variant of fn:for-each-pair applies the specified updating $function to the successive pairs of items of $seq1 and $seq2. Evaluation is stopped if one sequence yields no more items. - : - : @param $seq1 value of type item()* - : @param $function value of type function(item() - :) -declare function update:for-each-pair($seq1 as item()*, $function as function(item()) as item()*) as empty-sequence() external; - -(:~ - : The updating variant of map:for-each applies the specified $function to every key/value pair of the supplied $map and returns the results as a sequence. - : - : @param $map value of type map(*) - : @param $function value of type function(xs:anyAtomicType - : @param item()* value of type - : @return value of type item()* - :) -declare function update:map-for-each($map as map(*), $function as function(xs:anyAtomicType, item()*) as item()*) as item()* external; - -(:~ - : This function is a helper function for returning results in an updating expression. The argument of the function will be evaluated, and the resulting items will be cached and returned after the updates on the pending update list have been processed. If the supplied item will be affected by an update, a copy will be created and cached instead. - : - : @param $result value of type item()* - :) -declare function update:output($result as item()*) as empty-sequence() external; - -(:~ - : Returns the items that have been cached by update:output. It can be used to check which items will eventually be returned as result of an updating function.
This function is non-deterministic: It will return different results before and after items have been cached. It is e. g. useful when writing unit tests. - : - : @return value of type item()* - :) -declare function update:cache() as item()* external; diff --git a/packages.src/basex-9.6/user.xqm b/packages.src/basex-9.6/user.xqm deleted file mode 100644 index 0045e9e..0000000 --- a/packages.src/basex-9.6/user.xqm +++ /dev/null @@ -1,201 +0,0 @@ -(:~ - : This XQuery Module contains functions for creating and administering database users. The User Management article gives more information on database users and permissions. - : - : @author BaseX Team - : @see /wiki/User_Module - :) -module namespace user = "http://basex.org/modules/user"; - -(:~ - : Returns the name of the currently logged in user. - : - : @return value of type xs:string - :) -declare function user:current() as xs:string external; - -(:~ - : Returns the names of all registered users that are visible to the current user. - : - : @return value of type xs:string* - :) -declare function user:list() as xs:string* external; - -(:~ - : Returns an element sequence, containing all registered users that are visible to the current user.
In addition to the SHOW USERS command, encoded password strings and database permissions will be output. A user $name can be specified to filter the results in advance. - : - : @return value of type element(user)* - : @error user:unknown The specified user name is unknown. - :) -declare function user:list-details() as element(user)* external; - -(:~ - : Returns an element sequence, containing all registered users that are visible to the current user.
In addition to the SHOW USERS command, encoded password strings and database permissions will be output. A user $name can be specified to filter the results in advance. - : - : @param $name value of type xs:string - : @return value of type element(user)* - : @error user:unknown The specified user name is unknown. - :) -declare function user:list-details($name as xs:string) as element(user)* external; - -(:~ - : Checks if a user with the specified $name exists. - : - : @param $name value of type xs:string - : @return value of type xs:boolean - : @error user:name The specified user name is invalid. - :) -declare function user:exists($name as xs:string) as xs:boolean external; - -(:~ - : Checks if the specified user and password is correct. Raises errors otherwise. - : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @error user:name The specified user name is invalid. - : @error user:unknown The specified user does not exist. - : @error user:password The specified password is wrong. - :) -declare function user:check($name as xs:string, $password as xs:string) as empty-sequence() external; - -(:~ - : Returns an info element, which can be used to organize application-specific data. By default, the element has no contents. It can be modified via user:update-info. - : - : @return value of type element(info) - :) -declare function user:info() as element(info) external; - -(:~ - : Creates a new user with the specified $name, $password, and $permissions. Local permissions are granted with non-empty glob $patterns. The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument. Existing users will be overwritten. - : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @error user:name The specified user name is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:create($name as xs:string, $password as xs:string) as empty-sequence() external; - -(:~ - : Creates a new user with the specified $name, $password, and $permissions. Local permissions are granted with non-empty glob $patterns. The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument. Existing users will be overwritten. - : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @param $permissions value of type xs:string* - : @error user:name The specified user name is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:create($name as xs:string, $password as xs:string, $permissions as xs:string*) as empty-sequence() external; - -(:~ - : Creates a new user with the specified $name, $password, and $permissions. Local permissions are granted with non-empty glob $patterns. The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument. Existing users will be overwritten. - : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @param $permissions value of type xs:string* - : @param $patterns value of type xs:string* - : @error user:name The specified user name is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:create($name as xs:string, $password as xs:string, $permissions as xs:string*, $patterns as xs:string*) as empty-sequence() external; - -(:~ - : Grants global or local $permissions to a user with the specified $name. Local permissions are granted with non-empty glob $patterns. - : - : @param $name value of type xs:string - : @param $permissions value of type xs:string* - : @error user:unknown The specified user name is unknown. - : @error user:name The specified user name is invalid. - : @error user:pattern The specified database pattern is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:local A local permission can only be 'none', 'read' or 'write'. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:grant($name as xs:string, $permissions as xs:string*) as empty-sequence() external; - -(:~ - : Grants global or local $permissions to a user with the specified $name. Local permissions are granted with non-empty glob $patterns. - : - : @param $name value of type xs:string - : @param $permissions value of type xs:string* - : @param $patterns value of type xs:string* - : @error user:unknown The specified user name is unknown. - : @error user:name The specified user name is invalid. - : @error user:pattern The specified database pattern is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:local A local permission can only be 'none', 'read' or 'write'. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:grant($name as xs:string, $permissions as xs:string*, $patterns as xs:string*) as empty-sequence() external; - -(:~ - : Drops a user with the specified $name. If non-empty glob $patterns are specified, only the database patterns will be dropped. - : - : @param $name value of type xs:string - : @error user:unknown The specified user name is unknown. - : @error user:name The specified user name is invalid. - : @error user:pattern The specified database pattern is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - : @error user:conflict A user cannot be both altered and dropped. - :) -declare function user:drop($name as xs:string) as empty-sequence() external; - -(:~ - : Drops a user with the specified $name. If non-empty glob $patterns are specified, only the database patterns will be dropped. - : - : @param $name value of type xs:string - : @param $patterns value of type xs:string* - : @error user:unknown The specified user name is unknown. - : @error user:name The specified user name is invalid. - : @error user:pattern The specified database pattern is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - : @error user:conflict A user cannot be both altered and dropped. - :) -declare function user:drop($name as xs:string, $patterns as xs:string*) as empty-sequence() external; - -(:~ - : Renames a user with the specified $name to $newname. - : - : @param $name value of type xs:string - : @param $newname value of type xs:string - : @error user:unknown The specified user name is unknown. - : @error user:name The specified user name is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - : @error user:conflict A user cannot be both altered and dropped. - :) -declare function user:alter($name as xs:string, $newname as xs:string) as empty-sequence() external; - -(:~ - : Changes the password of a user with the specified $name. - : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @error user:unknown The specified user name is unknown. - : @error user:name The specified user name is invalid. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:password($name as xs:string, $password as xs:string) as empty-sequence() external; - -(:~ - : Updates the info element with $info. This node can be used to organize application-specific data (groups, enhanced user info, etc.). - : - : @param $info value of type element(info) - :) -declare function user:update-info($info as element(info)) as empty-sequence() external; diff --git a/packages.src/basex-9.6/util.xqm b/packages.src/basex-9.6/util.xqm deleted file mode 100644 index 5079ba1..0000000 --- a/packages.src/basex-9.6/util.xqm +++ /dev/null @@ -1,72 +0,0 @@ -(:~ - : This XQuery Module contains various small utility and helper functions. Please note that some of the functions are used for internal query rewritings. They may be renamed or moved to other modules in future versions of BaseX. - : - : @author BaseX Team - : @see /wiki/Utility_Module - :) -module namespace util = "http://basex.org/modules/util"; - -(:~ - : Alternative writing for the if/then/else expression:
  • If the effective boolean value of $condition is true, the $then branch will be evaluated.
  • Otherwise, $else will be evaluated. If no third argument is supplied, an empty sequence will be returned.
- : - : @param $condition value of type item()* - : @param $then value of type item()* - : @return value of type item()* - :) -declare function util:if($condition as item()*, $then as item()*) as item()* external; - -(:~ - : Alternative writing for the if/then/else expression:
  • If the effective boolean value of $condition is true, the $then branch will be evaluated.
  • Otherwise, $else will be evaluated. If no third argument is supplied, an empty sequence will be returned.
- : - : @param $condition value of type item()* - : @param $then value of type item()* - : @param $else value of type item()* - : @return value of type item()* - :) -declare function util:if($condition as item()*, $then as item()*, $else as item()*) as item()* external; - -(:~ - : Returns $items if it is a non-empty sequence. Otherwise, returns $default. The function is equivalent to the expression if(exists($items)) then $items else $default. - : - : @param $items value of type item()* - : @param $default value of type item()* - : @return value of type item()* - :) -declare function util:or($items as item()*, $default as item()*) as item()* external; - -(:~ - : Returns the item from $sequence at the specified $position. Equivalent to $sequence[$position]. - : - : @param $sequence value of type item()* - : @param $position value of type xs:double - : @return value of type item()? - :) -declare function util:item-at($sequence as item()*, $position as xs:double) as item()? external; - -(:~ - : Returns items from $sequence, starting at position $first and ending at $last. Equivalent to subsequence($sequence, $first, $last - $first + 1). - : - : @param $sequence value of type item()* - : @param $first value of type xs:double - : @param $last value of type xs:double - : @return value of type item()* - :) -declare function util:item-range($sequence as item()*, $first as xs:double, $last as xs:double) as item()* external; - -(:~ - : Returns last item of a $sequence. Equivalent to $sequence[last()]. - : - : @param $sequence value of type item()* - : @return value of type item()? - :) -declare function util:last-from($sequence as item()*) as item()? external; - -(:~ - : Returns $count instances of the specified $sequence. A similar result can be generated with (1 to $count) ! $sequence, but in the latter case, the right-hand expression will be evaluated multiple times. - : - : @param $sequence value of type item()* - : @param $count value of type xs:integer - : @return value of type item()* - : @error util:negative The specified number is negative. - :) -declare function util:replicate($sequence as item()*, $count as xs:integer) as item()* external; diff --git a/packages.src/basex-9.6/validate.xqm b/packages.src/basex-9.6/validate.xqm deleted file mode 100644 index 00500c9..0000000 --- a/packages.src/basex-9.6/validate.xqm +++ /dev/null @@ -1,247 +0,0 @@ -(:~ - : This XQuery Module contains functions to perform validations against DTDs, XML Schema and RelaxNG. The documentation further describes how to use Schematron validation with BaseX. - : - : @author BaseX Team - : @see /wiki/Validation_Module - :) -module namespace validate = "http://basex.org/modules/validate"; - -(:~ - : Validates the XML $input document against a $schema and returns an empty sequence or an error. - : - : @param $input value of type item() - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd($input as item()) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema and returns an empty sequence or an error. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd($input as item(), $schema as xs:string?) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd-info($input as item()) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd-info($input as item(), $schema as xs:string?) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd-report($input as item()) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd-report($input as item(), $schema as xs:string?) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema, using the specified $version of XML Schema. - : - : @param $input value of type item() - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - : @error validate:version no validator is found for the specified version. - :) -declare function validate:xsd($input as item()) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the specified $version of XML Schema. - : - : @param $input value of type item() - : @param $schema value of type item()? - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - : @error validate:version no validator is found for the specified version. - :) -declare function validate:xsd($input as item(), $schema as item()?) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the specified $version of XML Schema. - : - : @param $input value of type item() - : @param $schema value of type item()? - : @param $version value of type xs:string - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - : @error validate:version no validator is found for the specified version. - :) -declare function validate:xsd($input as item(), $schema as item()?, $version as xs:string) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the specified $version of XML Schema, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - : @error validate:version no validator is found for the specified version. - :) -declare function validate:xsd-info($input as item()) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the specified $version of XML Schema, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type item()? - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - : @error validate:version no validator is found for the specified version. - :) -declare function validate:xsd-info($input as item(), $schema as item()?) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the specified $version of XML Schema, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type item()? - : @param $version value of type xs:string - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - : @error validate:version no validator is found for the specified version. - :) -declare function validate:xsd-info($input as item(), $schema as item()?, $version as xs:string) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the specified $version of XML Schema, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - : @error validate:version no validator is found for the specified version. - :) -declare function validate:xsd-report($input as item()) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema, using the specified $version of XML Schema, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - : @error validate:version no validator is found for the specified version. - :) -declare function validate:xsd-report($input as item(), $schema as xs:string?) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema, using the specified $version of XML Schema, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @param $version value of type xs:string - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - : @error validate:version no validator is found for the specified version. - :) -declare function validate:xsd-report($input as item(), $schema as xs:string?, $version as xs:string) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation. - : - : @param $input value of type item() - : @param $schema value of type item() - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found the RelaxNG validator is not available. - :) -declare function validate:rng($input as item(), $schema as item()) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation. - : - : @param $input value of type item() - : @param $schema value of type item() - : @param $compact value of type xs:boolean - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found the RelaxNG validator is not available. - :) -declare function validate:rng($input as item(), $schema as item(), $compact as xs:boolean) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type item() - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found the RelaxNG validator is not available. - :) -declare function validate:rng-info($input as item(), $schema as item()) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type item() - : @param $compact value of type xs:boolean - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found the RelaxNG validator is not available. - :) -declare function validate:rng-info($input as item(), $schema as item(), $compact as xs:boolean) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found The RelaxNG validator is not available. - :) -declare function validate:rng-report($input as item(), $schema as xs:string) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string - : @param $compact value of type xs:boolean - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found The RelaxNG validator is not available. - :) -declare function validate:rng-report($input as item(), $schema as xs:string, $compact as xs:boolean) as element(report) external; diff --git a/packages.src/basex-9.6/web.xqm b/packages.src/basex-9.6/web.xqm deleted file mode 100644 index 54a19e5..0000000 --- a/packages.src/basex-9.6/web.xqm +++ /dev/null @@ -1,92 +0,0 @@ -(:~ - : This XQuery Module provides convenience functions for building web applications with RESTXQ. - : - : @author BaseX Team - : @see /wiki/Web_Module - :) -module namespace web = "http://basex.org/modules/web"; - -(:~ - : Returns the content type of a path by analyzing its file suffix. application/octet-stream is returned if the file suffix is unknown. - : - : @param $path value of type xs:string - : @return value of type xs:string - :) -declare function web:content-type($path as xs:string) as xs:string external; - -(:~ - : Creates a new URL from the specified $url string and the $parameters specified in a map. The keys and and values of the map entries will be converted to strings, URL-encoded (see web:encode-url), and appended to the url as query parameters. If a map entry has more than a single item, all of them will be appended as single parameters. - : - : @param $url value of type xs:string - : @param $parameters value of type map(*) - : @return value of type xs:string - :) -declare function web:create-url($url as xs:string, $parameters as map(*)) as xs:string external; - -(:~ - : Encodes a string to a URL. Spaces are rewritten to +; *, -, . and _ are adopted; and all other non-ASCII characters and special characters are percent-encoded. - : - : @param $string value of type xs:string - : @return value of type xs:string - :) -declare function web:encode-url($string as xs:string) as xs:string external; - -(:~ - : Decodes a URL to the original string. Percent-encoded characters are decoded to their UTF8 codepoints, and + characters are rewritten to spaces. - : - : @param $string value of type xs:string - : @return value of type xs:string - : @error web:invalid the string contains invalid XML characters. - :) -declare function web:decode-url($string as xs:string) as xs:string external; - -(:~ - : Creates a RESTXQ redirection to the specified location. The returned response will only work if no other items are returned by the RESTXQ function.
If $parameters are specified, they will be appended as query parameters to the URL as described for web:create-url. - : - : @param $location value of type xs:string - : @return value of type element(rest:response) - :) -declare function web:redirect($location as xs:string) as element(rest:response) external; - -(:~ - : Creates a RESTXQ redirection to the specified location. The returned response will only work if no other items are returned by the RESTXQ function.
If $parameters are specified, they will be appended as query parameters to the URL as described for web:create-url. - : - : @param $location value of type xs:string - : @param $parameters value of type map(*) - : @return value of type element(rest:response) - :) -declare function web:redirect($location as xs:string, $parameters as map(*)) as element(rest:response) external; - -(:~ - : Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the top element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
- : - : @return value of type element(rest:response) - :) -declare function web:response-header() as element(rest:response) external; - -(:~ - : Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the top element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
- : - : @param $output value of type map(*)? - : @return value of type element(rest:response) - :) -declare function web:response-header($output as map(*)?) as element(rest:response) external; - -(:~ - : Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the top element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
- : - : @param $output value of type map(*)? - : @param $headers value of type map(*)? - : @return value of type element(rest:response) - :) -declare function web:response-header($output as map(*)?, $headers as map(*)?) as element(rest:response) external; - -(:~ - : Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the top element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
- : - : @param $output value of type map(*)? - : @param $headers value of type map(*)? - : @param $atts value of type map(*)? - : @return value of type element(rest:response) - :) -declare function web:response-header($output as map(*)?, $headers as map(*)?, $atts as map(*)?) as element(rest:response) external; diff --git a/packages.src/basex-9.6/ws.xqm b/packages.src/basex-9.6/ws.xqm deleted file mode 100644 index c067a16..0000000 --- a/packages.src/basex-9.6/ws.xqm +++ /dev/null @@ -1,102 +0,0 @@ -(:~ - : This XQuery Module contains functions for accessing specific WebSocket functions. This module is mainly useful in the context of WebSockets. - : - : @author BaseX Team - : @see /wiki/WebSocket_Module - :) -module namespace ws = "http://basex.org/modules/ws"; - -(:~ - : Returns the ID of the current WebSocket. - : - : @return value of type xs:string - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:id() as xs:string external; - -(:~ - : Returns the ids of all currently registered WebSocket. - : - : @return value of type xs:string* - :) -declare function ws:ids() as xs:string* external; - -(:~ - : Returns the path of the WebSocket with the specified $id. - : - : @param $id value of type xs:string - : @return value of type xs:string - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:path($id as xs:string) as xs:string external; - -(:~ - : Closes the connection of the WebSocket with the specified $id. - : - : @param $id value of type xs:string - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:close($id as xs:string) as empty-sequence() external; - -(:~ - : Sends a $message to the clients with the specified $ids. Ids that cannot be assigned to clients will be ignored. The message will be handled as follows:
  • Items of type xs:base64Binary and xs:hexBinary will be transmitted as binary messages.
  • Function items (maps, arrays) will be serialized as JSON and transmitted as string messages.
  • All other items will be serialized with the default serialization options and transmitted as string messages.
- : - : @param $message value of type item() - : @param $ids value of type xs:string* - :) -declare function ws:send($message as item(), $ids as xs:string*) as empty-sequence() external; - -(:~ - : Broadcasts a $message to all connected clients except to the caller. Invocations of this convenience function are equivalent to ws:send($message, ws:ids()[. != ws:id()]). See ws:send for more details on the message handling. - : - : @param $message value of type xs:anyAtomicType - :) -declare function ws:broadcast($message as xs:anyAtomicType) as empty-sequence() external; - -(:~ - : Emits a $message to all connected clients. Invocations of this function are equivalent to ws:send($message, ws:ids()). See ws:send for more details on the message handling. - : - : @param $message value of type xs:anyAtomicType - :) -declare function ws:emit($message as xs:anyAtomicType) as empty-sequence() external; - -(:~ - : Returns the value of an attribute with the specified $name from the WebSocket with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @return value of type item()* - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:get($id as xs:string, $name as xs:string) as item()* external; - -(:~ - : Returns the value of an attribute with the specified $name from the WebSocket with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @param $default value of type item()* - : @return value of type item()* - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:get($id as xs:string, $name as xs:string, $default as item()*) as item()* external; - -(:~ - : Returns the specified value of the attribute with the specified $name from the WebSocket with the specified $id. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @param $value value of type item()* - : @error ws:not-found No WebSocket with the specified id exists. - : @error ws:set The supplied value cannot be materialized. - :) -declare function ws:set($id as xs:string, $name as xs:string, $value as item()*) as empty-sequence() external; - -(:~ - : Deletes an attribute with the specified $name from the WebSocket with the specified $id. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:delete($id as xs:string, $name as xs:string) as empty-sequence() external; diff --git a/packages.src/basex-9.6/xquery.xqm b/packages.src/basex-9.6/xquery.xqm deleted file mode 100644 index 52a6070..0000000 --- a/packages.src/basex-9.6/xquery.xqm +++ /dev/null @@ -1,212 +0,0 @@ -(:~ - : This XQuery Module contains functions for parsing and evaluating XQuery strings at runtime, and to run code in parallel. - : - : @author BaseX Team - : @see /wiki/XQuery_Module - :) -module namespace xquery = "http://basex.org/modules/xquery"; - -(:~ - : Evaluates the supplied $query string as XQuery expression and returns the resulting items.
The evaluated query has its own query context. If a returned node is stored in a database, a main-memory copy will be returned as result, because the referenced database is closed after query execution and will not be accessible anymore.
Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:
  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. This URI will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
- : - : @param $query value of type xs:string - : @return value of type item()* - : @error xquery:update the query contains updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval($query as xs:string) as item()* external; - -(:~ - : Evaluates the supplied $query string as XQuery expression and returns the resulting items.
The evaluated query has its own query context. If a returned node is stored in a database, a main-memory copy will be returned as result, because the referenced database is closed after query execution and will not be accessible anymore.
Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:
  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. This URI will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
- : - : @param $query value of type xs:string - : @param $bindings value of type map(*)? - : @return value of type item()* - : @error xquery:update the query contains updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval($query as xs:string, $bindings as map(*)?) as item()* external; - -(:~ - : Evaluates the supplied $query string as XQuery expression and returns the resulting items.
The evaluated query has its own query context. If a returned node is stored in a database, a main-memory copy will be returned as result, because the referenced database is closed after query execution and will not be accessible anymore.
Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:
  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. This URI will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
- : - : @param $query value of type xs:string - : @param $bindings value of type map(*)? - : @param $options value of type map(*)? - : @return value of type item()* - : @error xquery:update the query contains updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval($query as xs:string, $bindings as map(*)?, $options as map(*)?) as item()* external; - -(:~ - : Evaluates $query as updating XQuery expression at runtime.
All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules of the $bindings and $options parameters are the same as for xquery:eval. - : - : @param $query value of type xs:string - : @return value of type item()* - : @error xquery:update the query contains no updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval-update($query as xs:string) as item()* external; - -(:~ - : Evaluates $query as updating XQuery expression at runtime.
All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules of the $bindings and $options parameters are the same as for xquery:eval. - : - : @param $query value of type xs:string - : @param $bindings value of type map(*)? - : @return value of type item()* - : @error xquery:update the query contains no updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval-update($query as xs:string, $bindings as map(*)?) as item()* external; - -(:~ - : Evaluates $query as updating XQuery expression at runtime.
All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules of the $bindings and $options parameters are the same as for xquery:eval. - : - : @param $query value of type xs:string - : @param $bindings value of type map(*)? - : @param $options value of type map(*)? - : @return value of type item() - : @error xquery:update the query contains no updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval-update($query as xs:string, $bindings as map(*)?, $options as map(*)?) as item() external; - -(:~ - : Evaluates the XQuery module located at $uri at runtime and returns the resulting items. A relative URI will be resolved against the static base URI of the query.
The rules of the $bindings and $options parameters are the same as for xquery:eval. - : - : @param $uri value of type xs:string - : @return value of type item()* - : @error xquery:update the expression contains updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:invoke($uri as xs:string) as item()* external; - -(:~ - : Evaluates the XQuery module located at $uri at runtime and returns the resulting items. A relative URI will be resolved against the static base URI of the query.
The rules of the $bindings and $options parameters are the same as for xquery:eval. - : - : @param $uri value of type xs:string - : @param $bindings value of type map(*)? - : @return value of type item()* - : @error xquery:update the expression contains updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:invoke($uri as xs:string, $bindings as map(*)?) as item()* external; - -(:~ - : Evaluates the XQuery module located at $uri at runtime and returns the resulting items. A relative URI will be resolved against the static base URI of the query.
The rules of the $bindings and $options parameters are the same as for xquery:eval. - : - : @param $uri value of type xs:string - : @param $bindings value of type map(*)? - : @param $options value of type map(*)? - : @return value of type item()* - : @error xquery:update the expression contains updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:invoke($uri as xs:string, $bindings as map(*)?, $options as map(*)?) as item()* external; - -(:~ - : Evaluates the updating XQuery module located at $uri at runtime. A relative URI will be resolved against the static base URI of the query.
The rules of the $bindings and $options parameters are the same as for xquery:eval. - : - : @param $uri value of type xs:string - : @return value of type item()* - : @error xquery:update the expression contains no updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:invoke-update($uri as xs:string) as item()* external; - -(:~ - : Evaluates the updating XQuery module located at $uri at runtime. A relative URI will be resolved against the static base URI of the query.
The rules of the $bindings and $options parameters are the same as for xquery:eval. - : - : @param $uri value of type xs:string - : @param $bindings value of type map(*)? - : @return value of type item()* - : @error xquery:update the expression contains no updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:invoke-update($uri as xs:string, $bindings as map(*)?) as item()* external; - -(:~ - : Evaluates the updating XQuery module located at $uri at runtime. A relative URI will be resolved against the static base URI of the query.
The rules of the $bindings and $options parameters are the same as for xquery:eval. - : - : @param $uri value of type xs:string - : @param $bindings value of type map(*)? - : @param $options value of type map(*)? - : @return value of type item()* - : @error xquery:update the expression contains no updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:invoke-update($uri as xs:string, $bindings as map(*)?, $options as map(*)?) as item()* external; - -(:~ - : Parses the specified $query string as XQuery module and returns the resulting query plan. The $options parameter influences the output:
  • compile: additionally compiles the query after parsing it. By default, this option is false.
  • plan: returns an XML representation of the internal query plan. By default, this option is true. The naming of the expressions in the query plan may change over time
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
  • base-uri: set base-uri property for the query. This URI will be used when resolving relative URIs by functions such as fn:doc.
- : - : @param $query value of type xs:string - : @return value of type item()? - :) -declare function xquery:parse($query as xs:string) as item()? external; - -(:~ - : Parses the specified $query string as XQuery module and returns the resulting query plan. The $options parameter influences the output:
  • compile: additionally compiles the query after parsing it. By default, this option is false.
  • plan: returns an XML representation of the internal query plan. By default, this option is true. The naming of the expressions in the query plan may change over time
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
  • base-uri: set base-uri property for the query. This URI will be used when resolving relative URIs by functions such as fn:doc.
- : - : @param $query value of type xs:string - : @param $options value of type map(*)? - : @return value of type item()? - :) -declare function xquery:parse($query as xs:string, $options as map(*)?) as item()? external; - -(:~ - : Parses the XQuery module located at $uri and returns the resulting query plan. A relative URI will be resolved against the static base URI of the query. The rules for the $options parameter are the same as for xquery:parse. - : - : @param $uri value of type xs:string - : @return value of type item()? - :) -declare function xquery:parse-uri($uri as xs:string) as item()? external; - -(:~ - : Parses the XQuery module located at $uri and returns the resulting query plan. A relative URI will be resolved against the static base URI of the query. The rules for the $options parameter are the same as for xquery:parse. - : - : @param $uri value of type xs:string - : @param $options value of type map(*)? - : @return value of type item()? - :) -declare function xquery:parse-uri($uri as xs:string, $options as map(*)?) as item()? external; - -(:~ - : This function executes the supplied (non-updating) functions in parallel. - : - : @param $functions value of type function(*)* - : @return value of type item()* - : @error xquery:error an unexpected error occurred. - :) -declare function xquery:fork-join($functions as function(*)*) as item()* external; diff --git a/packages.src/basex-9.6/xslt.xqm b/packages.src/basex-9.6/xslt.xqm deleted file mode 100644 index 3e1aa02..0000000 --- a/packages.src/basex-9.6/xslt.xqm +++ /dev/null @@ -1,81 +0,0 @@ -(:~ - : This XQuery Module contains functions and variables to perform XSL transformations. By default, this module uses Java’s XSLT 1.0 Xalan implementation to transform documents. XSLT 3.0 will be enabled if Version 9.x of the Saxon XSLT Processor (saxon9he.jar, saxon9pe.jar, saxon9ee.jar) is found in the classpath (see Distributions for more details. A custom transformer can be specified by overwriting the system property javax.xml.transform.TransformerFactory, as shown in the following Java example: - : - : @author BaseX Team - : @see /wiki/XSLT_Module - :) -module namespace xslt = "http://basex.org/modules/xslt"; - -(:~ - : Returns the name of the applied XSLT processor, or the path to a custom implementation (currently: "Java", "Saxon EE", "Saxon PE", or "Saxon HE").
- : - : @return value of type xs:string - :) -declare function xslt:processor() as xs:string external; - -(:~ - : Returns the supported XSLT version (currently: "1.0" or "3.0"). "Unknown" is returned if a custom implementation was chosen.
- : - : @return value of type xs:string - :) -declare function xslt:version() as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available (currently, it is just a single one):

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @return value of type node() - :) -declare function xslt:transform($input as item(), $stylesheet as item()) as node() external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available (currently, it is just a single one):

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $params value of type map(*)? - : @return value of type node() - :) -declare function xslt:transform($input as item(), $stylesheet as item(), $params as map(*)?) as node() external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available (currently, it is just a single one):

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $args value of type map(*)? - : @param $options value of type map(*)? - : @return value of type node() - :) -declare function xslt:transform($input as item(), $stylesheet as item(), $args as map(*)?, $options as map(*)?) as node() external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform.
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @return value of type xs:string - :) -declare function xslt:transform-text($input as item(), $stylesheet as item()) as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform.
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $params value of type map(*)? - : @return value of type xs:string - :) -declare function xslt:transform-text($input as item(), $stylesheet as item(), $params as map(*)?) as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform.
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $params value of type map(*)? - : @param $options value of type map(*)? - : @return value of type xs:string - :) -declare function xslt:transform-text($input as item(), $stylesheet as item(), $params as map(*)?, $options as map(*)?) as xs:string external; diff --git a/packages.src/basex-9.6/zip.xqm b/packages.src/basex-9.6/zip.xqm deleted file mode 100644 index 5a4df47..0000000 --- a/packages.src/basex-9.6/zip.xqm +++ /dev/null @@ -1,95 +0,0 @@ -(:~ - : This XQuery Module contains functions to handle ZIP archives. The contents of ZIP files can be extracted and listed, and new archives can be created. The module is based on the EXPath ZIP Module. Please note that the ZIP module is not being actively maintained but is still distributed for compatibility with older applications. We recommend you use the Archive Module wherever possible. - : - : @author BaseX Team - : @see /wiki/ZIP_Module - :) -module namespace zip = "http://expath.org/ns/zip"; -declare namespace experr = "http://expath.org/ns/error"; - -(:~ - : Extracts the binary file at $path within the ZIP file located at $uri and returns it as an xs:base64Binary item. - : - : @param $uri value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:base64Binary - : @error experr:ZIP0001 the specified path does not exist. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:binary-entry($uri as xs:string, $path as xs:string) as xs:base64Binary external; - -(:~ - : Extracts the text file at $path within the ZIP file located at $uri and returns it as an xs:string item.
An optional encoding can be specified via $encoding. - : - : @param $uri value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:string - : @error experr:ZIP0001 the specified path does not exist. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:text-entry($uri as xs:string, $path as xs:string) as xs:string external; - -(:~ - : Extracts the text file at $path within the ZIP file located at $uri and returns it as an xs:string item.
An optional encoding can be specified via $encoding. - : - : @param $uri value of type xs:string - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:string - : @error experr:ZIP0001 the specified path does not exist. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:text-entry($uri as xs:string, $path as xs:string, $encoding as xs:string) as xs:string external; - -(:~ - : Extracts the XML file at $path within the ZIP file located at $uri and returns it as a document node. - : - : @param $uri value of type xs:string - : @param $path value of type xs:string - : @return value of type document-node() - : @error experr:ZIP0001 the specified path does not exist. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:xml-entry($uri as xs:string, $path as xs:string) as document-node() external; - -(:~ - : Extracts the HTML file at $path within the ZIP file located at $uri and returns it as a document node. The file is converted to XML first if Tagsoup is found in the classpath. - : - : @param $uri value of type xs:string - : @param $path value of type xs:string - : @return value of type document-node() - : @error experr:ZIP0001 the specified path does not exist. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:html-entry($uri as xs:string, $path as xs:string) as document-node() external; - -(:~ - : Generates an ZIP XML Representation of the hierarchical structure of the ZIP file located at $uri and returns it as an element node. The file contents are not returned by this function. - : - : @param $uri value of type xs:string - : @return value of type element(zip:file) - : @error experr:ZIP0001 the specified path does not exist. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:entries($uri as xs:string) as element(zip:file) external; - -(:~ - : Creates a new ZIP archive with the characteristics described by $zip, the ZIP XML Representation. - : - : @param $zip value of type element(zip:file) - : @error experr:ZIP0001 an addressed file does not exist. - : @error experr:ZIP0002 entries in the ZIP archive description are unknown, missing, or invalid. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:zip-file($zip as element(zip:file)) as empty-sequence() external; - -(:~ - : Updates an existing ZIP archive or creates a modifed copy, based on the characteristics described by $zip, the ZIP XML Representation. The $output argument is the URI where the modified ZIP file is copied to. - : - : @param $zip value of type element(zip:file) - : @param $output value of type xs:string - : @error experr:ZIP0001 an addressed file does not exist. - : @error experr:ZIP0002 entries in the ZIP archive description are unknown, missing, or invalid. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:update-entries($zip as element(zip:file), $output as xs:string) as empty-sequence() external; diff --git a/packages.src/basex-9.7/admin.xqm b/packages.src/basex-9.7/admin.xqm deleted file mode 100644 index 2f198d6..0000000 --- a/packages.src/basex-9.7/admin.xqm +++ /dev/null @@ -1,64 +0,0 @@ -(:~ - : This XQuery Module contains functions for performing admin-centric operations such as managing database users and log data. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Admin_Module - :) -module namespace admin = "http://basex.org/modules/admin"; - -(:~ - : Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
- : - : @return value of type element(file)* - :) -declare function admin:logs() as element(file)* external; - -(:~ - : Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
- : - : @param $date value of type xs:string - : @return value of type element(entry)* - :) -declare function admin:logs($date as xs:string) as element(entry)* external; - -(:~ - : Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
- : - : @param $date value of type xs:string - : @param $merge value of type xs:boolean - : @return value of type element(entry)* - :) -declare function admin:logs($date as xs:string, $merge as xs:boolean) as element(entry)* external; - -(:~ - : Writes a string to the database logs, along with current user data (timestamp, user name). An optional log $type can be specified. If omitted, the log type is INFO.
If the function is called from a database client, the IP will be logged. Otherwise, the string SERVER will be logged. - : - : @param $text value of type xs:string - : @error admin:type Type string contains whitespaces. - :) -declare function admin:write-log($text as xs:string) as empty-sequence() external; - -(:~ - : Writes a string to the database logs, along with current user data (timestamp, user name). An optional log $type can be specified. If omitted, the log type is INFO.
If the function is called from a database client, the IP will be logged. Otherwise, the string SERVER will be logged. - : - : @param $text value of type xs:string - : @param $type value of type xs:string - : @error admin:type Type string contains whitespaces. - :) -declare function admin:write-log($text as xs:string, $type as xs:string) as empty-sequence() external; - -(:~ - : Deletes the log entries from the specified $date - : - : @param $date value of type xs:string - : @error admin:today Today's log file cannot be deleted. - : @error admin:delete An error occurred while deleting a log file. - :) -declare function admin:delete-logs($date as xs:string) as empty-sequence() external; - -(:~ - : Returns an element sequence with all currently opened database sessions, including the user name, address (IP:port) and an optionally opened database.
The output of this function and the SHOW SESSIONS command is similar. - : - : @return value of type element(session)* - :) -declare function admin:sessions() as element(session)* external; diff --git a/packages.src/basex-9.7/archive.xqm b/packages.src/basex-9.7/archive.xqm deleted file mode 100644 index d8c451c..0000000 --- a/packages.src/basex-9.7/archive.xqm +++ /dev/null @@ -1,193 +0,0 @@ -(:~ - : This XQuery Module contains functions to handle archives (including ePub, Open Office, JAR, and many other formats). New ZIP and GZIP archives can be created, existing archives can be updated, and the archive entries can be listed and extracted. The archive:extract-binary function includes an example for writing the contents of an archive to disk. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Archive_Module - :) -module namespace archive = "http://basex.org/modules/archive"; - -(:~ - : Creates a new archive from the specified entries and contents.
The $entries argument contains meta information required to create new entries. All items may either be of type xs:string, representing the entry name, or element(archive:entry), containing the name as text node and additional, optional attributes:
  • last-modified: timestamp, specified as xs:dateTime (default: current time)
  • compression-level: 0-9, 0 = uncompressed (default: 8)
  • encoding: for textual entries (default: UTF-8)

An example:

  <archive:entry last-modified= '2011-11-11T11:11:11' compression-level= '8' encoding= 'US-ASCII' >hello.txt</archive:entry> 

The actual $contents must be xs:string or xs:base64Binary items.
The $options parameter contains archiving options:

  • format: allowed values are zip and gzip. zip is the default.
  • algorithm: allowed values are deflate and stored (for the zip format). deflate is the default.
- : - : @param $entries value of type item() - : @param $contents value of type item()* - : @return value of type xs:base64Binary - : @error archive:number the number of entries and contents differs. - : @error archive:format the specified option or its value is invalid or not supported. - : @error archive:descriptor entry descriptors contain invalid entry names, timestamps or compression levels. - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if CHECKSTRINGS is turned off. - : @error archive:single the chosen archive format only allows single entries. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:create($entries as item(), $contents as item()*) as xs:base64Binary external; - -(:~ - : Creates a new archive from the specified entries and contents.
The $entries argument contains meta information required to create new entries. All items may either be of type xs:string, representing the entry name, or element(archive:entry), containing the name as text node and additional, optional attributes:
  • last-modified: timestamp, specified as xs:dateTime (default: current time)
  • compression-level: 0-9, 0 = uncompressed (default: 8)
  • encoding: for textual entries (default: UTF-8)

An example:

  <archive:entry last-modified= '2011-11-11T11:11:11' compression-level= '8' encoding= 'US-ASCII' >hello.txt</archive:entry> 

The actual $contents must be xs:string or xs:base64Binary items.
The $options parameter contains archiving options:

  • format: allowed values are zip and gzip. zip is the default.
  • algorithm: allowed values are deflate and stored (for the zip format). deflate is the default.
- : - : @param $entries value of type item() - : @param $contents value of type item()* - : @param $options value of type map(*)? - : @return value of type xs:base64Binary - : @error archive:number the number of entries and contents differs. - : @error archive:format the specified option or its value is invalid or not supported. - : @error archive:descriptor entry descriptors contain invalid entry names, timestamps or compression levels. - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if CHECKSTRINGS is turned off. - : @error archive:single the chosen archive format only allows single entries. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:create($entries as item(), $contents as item()*, $options as map(*)?) as xs:base64Binary external; - -(:~ - : This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is identical to archive:create, but two additional options are available:
  • recursive: parse all files recursively (default: true; ignored if entries are specified via the last argument).
  • root-dir: use name of supplied directory as archive root directory (default: false).
- : - : @param $path value of type xs:string - : @return value of type xs:base64Binary - : @error file:no-dir the specified path does not point to a directory. - : @error file:is-dir one of the specified entries points to a directory. - : @error file:not-found a specified entry does not exist. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:create-from($path as xs:string) as xs:base64Binary external; - -(:~ - : This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is identical to archive:create, but two additional options are available:
  • recursive: parse all files recursively (default: true; ignored if entries are specified via the last argument).
  • root-dir: use name of supplied directory as archive root directory (default: false).
- : - : @param $path value of type xs:string - : @param $options value of type map(*)? - : @return value of type xs:base64Binary - : @error file:no-dir the specified path does not point to a directory. - : @error file:is-dir one of the specified entries points to a directory. - : @error file:not-found a specified entry does not exist. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:create-from($path as xs:string, $options as map(*)?) as xs:base64Binary external; - -(:~ - : This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is identical to archive:create, but two additional options are available:
  • recursive: parse all files recursively (default: true; ignored if entries are specified via the last argument).
  • root-dir: use name of supplied directory as archive root directory (default: false).
- : - : @param $path value of type xs:string - : @param $options value of type map(*)? - : @param $entries value of type item()* - : @return value of type xs:base64Binary - : @error file:no-dir the specified path does not point to a directory. - : @error file:is-dir one of the specified entries points to a directory. - : @error file:not-found a specified entry does not exist. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:create-from($path as xs:string, $options as map(*)?, $entries as item()*) as xs:base64Binary external; - -(:~ - : Returns the entry descriptors of the specified $archive. A descriptor contains the following attributes, provided that they are available in the archive format:
  • size: original file size
  • last-modified: timestamp, formatted as xs:dateTime
  • compressed-size: compressed file size

An example:

  <archive:entry size= "1840" last-modified= "2009-03-20T03:30:32" compressed-size= "672" > doc/index.html </archive:entry> 
- : - : @param $archive value of type xs:base64Binary - : @return value of type element(archive:entry)* - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:entries($archive as xs:base64Binary) as element(archive:entry)* external; - -(:~ - : Returns the options of the specified $archive in the format specified by archive:create. - : - : @param $archive value of type xs:base64Binary - : @return value of type map(*) - : @error archive:format The archive format is not supported. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:options($archive as xs:base64Binary) as map(*) external; - -(:~ - : Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding. - : - : @param $archive value of type xs:base64Binary - : @return value of type xs:string* - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if CHECKSTRINGS is turned off. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:extract-text($archive as xs:base64Binary) as xs:string* external; - -(:~ - : Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding. - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @return value of type xs:string* - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if CHECKSTRINGS is turned off. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:extract-text($archive as xs:base64Binary, $entries as item()*) as xs:string* external; - -(:~ - : Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding. - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @param $encoding value of type xs:string - : @return value of type xs:string* - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if CHECKSTRINGS is turned off. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:extract-text($archive as xs:base64Binary, $entries as item()*, $encoding as xs:string) as xs:string* external; - -(:~ - : Extracts entries of the specified $archive and returns them as binaries.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored). - : - : @param $archive value of type xs:base64Binary - : @return value of type xs:base64Binary* - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:extract-binary($archive as xs:base64Binary) as xs:base64Binary* external; - -(:~ - : Extracts entries of the specified $archive and returns them as binaries.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored). - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @return value of type xs:base64Binary* - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:extract-binary($archive as xs:base64Binary, $entries as item()*) as xs:base64Binary* external; - -(:~ - : This convenience function writes files of an $archive directly to the specified directory $path.
The archive entries to be written can be restricted via $entries. The format of the argument is the same as for archive:create (attributes will be ignored). - : - : @param $path value of type xs:string - : @param $archive value of type xs:base64Binary - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:extract-to($path as xs:string, $archive as xs:base64Binary) as empty-sequence() external; - -(:~ - : This convenience function writes files of an $archive directly to the specified directory $path.
The archive entries to be written can be restricted via $entries. The format of the argument is the same as for archive:create (attributes will be ignored). - : - : @param $path value of type xs:string - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:extract-to($path as xs:string, $archive as xs:base64Binary, $entries as item()*) as empty-sequence() external; - -(:~ - : Creates an updated version of the specified $archive with new or replaced entries.
The format of $entries and $contents is the same as for archive:create. - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @param $contents value of type item()* - : @return value of type xs:base64Binary - : @error archive:number the number of entries and contents differs. - : @error archive:descriptor entry descriptors contain invalid entry names, timestamps, compression levels or encodings. - : @error archive:encode the specified encoding is invalid or not supported, or the string conversion failed. Invalid XML characters will be ignored if CHECKSTRINGS is turned off. - : @error archive:modify the entries of the given archive cannot be modified. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:update($archive as xs:base64Binary, $entries as item()*, $contents as item()*) as xs:base64Binary external; - -(:~ - : Deletes entries from an $archive.
The format of $entries is the same as for archive:create. - : - : @param $archive value of type xs:base64Binary - : @param $entries value of type item()* - : @return value of type xs:base64Binary - : @error archive:modify the entries of the given archive cannot be modified. - : @error archive:error archive creation failed for some other reason. - :) -declare function archive:delete($archive as xs:base64Binary, $entries as item()*) as xs:base64Binary external; diff --git a/packages.src/basex-9.7/array.xqm b/packages.src/basex-9.7/array.xqm deleted file mode 100644 index cf8d912..0000000 --- a/packages.src/basex-9.7/array.xqm +++ /dev/null @@ -1,208 +0,0 @@ -(:~ - : This XQuery Module contains functions for manipulating arrays, which has been introduced with XQuery 3.1. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Array_Module - :) -module namespace array = "http://www.w3.org/2005/xpath-functions/array"; - -(:~ - : Returns the number of members in $array. Note that because an array is an item, the fn:count function when applied to an array always returns 1. - : - : @param $input value of type array(*) - : @return value of type xs:integer - :) -declare function array:size($input as array(*)) as xs:integer external; - -(:~ - : Returns the $array member at the specified $position. - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @return value of type item()* - : @error array:FOAY0001 $position is not in the range 1 to array:size($array) inclusive. - :) -declare function array:get($array as array(*), $position as xs:integer) as item()* external; - -(:~ - : Returns a copy of $array with a new $member attached. - : - : @param $array value of type array(*) - : @param $member value of type item()* - : @return value of type array(*) - :) -declare function array:append($array as array(*), $member as item()*) as array(*) external; - -(:~ - : Constructs a new array with with $length members of $array beginning from the specified $position.
The two-argument version of the function returns the same result as the three-argument version when called with $length equal to the value of array:size($array) - $position + 1. - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @return value of type array(*) - : @error array:FOAY0001 $position is less than one, or if $position + $length is greater than array:size($array) + 1. - : @error array:FOAY0002 $length is less than zero. - :) -declare function array:subarray($array as array(*), $position as xs:integer) as array(*) external; - -(:~ - : Constructs a new array with with $length members of $array beginning from the specified $position.
The two-argument version of the function returns the same result as the three-argument version when called with $length equal to the value of array:size($array) - $position + 1. - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @param $length value of type xs:integer - : @return value of type array(*) - : @error array:FOAY0001 $position is less than one, or if $position + $length is greater than array:size($array) + 1. - : @error array:FOAY0002 $length is less than zero. - :) -declare function array:subarray($array as array(*), $position as xs:integer, $length as xs:integer) as array(*) external; - -(:~ - : Returns a copy of $array with $member replaced at the specified $position. Equivalent to $array => array:remove($position) => array:insert-before($position, $member). - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @param $member value of type item()* - : @return value of type array(*) - : @error array:FOAY0001 $position is not in the range 1 to array:size($array) inclusive. - :) -declare function array:put($array as array(*), $position as xs:integer, $member as item()*) as array(*) external; - -(:~ - : Returns a copy of $array without the member at the specified $positions. - : - : @param $array value of type array(*) - : @param $positions value of type xs:integer* - : @return value of type array(*) - : @error array:FOAY0001 A position is not in the range 1 to array:size($array) inclusive. - :) -declare function array:remove($array as array(*), $positions as xs:integer*) as array(*) external; - -(:~ - : Returns a copy of $array with one new $member at the specified $position. Setting $position to the value array:size($array) + 1 yields the same result as array:append($array, $insert). - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @param $member value of type item()* - : @return value of type array(*) - : @error array:FOAY0001 $position is not in the range 1 to array:size($array) + 1 inclusive. - :) -declare function array:insert-before($array as array(*), $position as xs:integer, $member as item()*) as array(*) external; - -(:~ - : Returns the first member of $array. This function is equivalent to the expression $array(1). - : - : @param $array value of type array(*) - : @return value of type item()* - : @error array:FOAY0001 The array is empty. - :) -declare function array:head($array as array(*)) as item()* external; - -(:~ - : Returns a new array with all members except the first from $array. This function is equivalent to the expression array:remove($array, 1). - : - : @param $array value of type array(*) - : @return value of type array(*) - : @error array:FOAY0001 The array is empty. - :) -declare function array:tail($array as array(*)) as array(*) external; - -(:~ - : Returns a new array with all members of $array in reverse order. - : - : @param $array value of type array(*) - : @return value of type array(*) - :) -declare function array:reverse($array as array(*)) as array(*) external; - -(:~ - : Concatenates the contents of several $arrays into a single array. - : - : @param $arrays value of type array(*)* - : @return value of type array(*) - :) -declare function array:join($arrays as array(*)*) as array(*) external; - -(:~ - : Recursively flattens all arrays that occur in the supplied $items. - : - : @param $items value of type item()* - : @return value of type item()* - :) -declare function array:flatten($items as item()*) as item()* external; - -(:~ - : Returns a new array, in which each member is computed by applying $function to the corresponding member of $array. - : - : @param $array value of type array(*) - : @param $function value of type function(item()* - : @return value of type array(*) - :) -declare function array:for-each($array as array(*), $function as function(item()*) as item()*) as array(*) external; - -(:~ - : Returns a new array with those members of $array for which $function returns true. - : - : @param $array value of type array(*) - : @param $function value of type function(item()* - : @return value of type array(*) - :) -declare function array:filter($array as array(*), $function as function(item()*) as xs:boolean) as array(*) external; - -(:~ - : Evaluates the supplied $function cumulatively on successive members of the supplied $array from left to right and using $zero as first argument. - : - : @param $array value of type array(*) - : @param $zero value of type item()* - : @param $function value of type function(item()* - : @param item()* value of type - : @return value of type item()* - :) -declare function array:fold-left($array as array(*), $zero as item()*, $function as function(item()*, item()*) as item()*) as item()* external; - -(:~ - : Evaluates the supplied $function cumulatively on successive members of the supplied $array from right to left and using $zero as first argument. - : - : @param $array value of type array(*) - : @param $zero value of type item()* - : @param $function value of type function(item()* - : @param item()* value of type - : @return value of type item()* - :) -declare function array:fold-right($array as array(*), $zero as item()*, $function as function(item()*, item()*) as item()*) as item()* external; - -(:~ - : Returns a new array obtained by evaluating the supplied $function for each pair of members at the same position in $array1 and $array2. - : - : @param $array1 value of type array(*) - : @param $array2 value of type array(*) - : @param $function value of type function(item()* - : @return value of type array(*) - :) -declare function array:for-each-pair($array1 as array(*), $array2 as array(*), $function as function(item()*) as item()*) as array(*) external; - -(:~ - : Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression. - : - : @param $array value of type array(*) - : @return value of type array(*) - :) -declare function array:sort($array as array(*)) as array(*) external; - -(:~ - : Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression. - : - : @param $array value of type array(*) - : @param $collation value of type xs:string? - : @return value of type array(*) - :) -declare function array:sort($array as array(*), $collation as xs:string?) as array(*) external; - -(:~ - : Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression. - : - : @param $array value of type array(*) - : @param $collation value of type xs:string? - : @param $key value of type function(item()* - : @return value of type array(*) - :) -declare function array:sort($array as array(*), $collation as xs:string?, $key as function(item()*) as xs:anyAtomicType*) as array(*) external; diff --git a/packages.src/basex-9.7/bin.xqm b/packages.src/basex-9.7/bin.xqm deleted file mode 100644 index 66cf966..0000000 --- a/packages.src/basex-9.7/bin.xqm +++ /dev/null @@ -1,419 +0,0 @@ -(:~ - : This XQuery Module contains functions to process binary data, including extracting subparts, searching, basic binary operations and conversion between binary and structured forms. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Binary_Module - :) -module namespace bin = "http://expath.org/ns/binary"; - -(:~ - : Returns the binary form of the set of octets written as a sequence of (ASCII) hex digits ([0-9A-Fa-f]).
$in will be effectively zero-padded from the left to generate an integral number of octets, i.e. an even number of hexadecimal digits. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:string? - : @return value of type xs:base64Binary? - : @error bin:non-numeric-character the input cannot be parsed as a hexadecimal number. - :) -declare function bin:hex($in as xs:string?) as xs:base64Binary? external; - -(:~ - : Returns the binary form of the set of octets written as a sequence of (8-wise) (ASCII) binary digits ([01]).
$in will be effectively zero-padded from the left to generate an integral number of octets. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:string? - : @return value of type xs:base64Binary? - : @error bin:non-numeric-character the input cannot be parsed as a binary number. - :) -declare function bin:bin($in as xs:string?) as xs:base64Binary? external; - -(:~ - : Returns the binary form of the set of octets written as a sequence of (ASCII) octal digits ([0-7]).
$in will be effectively zero-padded from the left to generate an integral number of octets. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:string? - : @return value of type xs:base64Binary? - : @error bin:non-numeric-character the input cannot be parsed as an octal number. - :) -declare function bin:octal($in as xs:string?) as xs:base64Binary? external; - -(:~ - : Returns binary data as a sequence of octets.
If $in is a zero length binary data then the empty sequence is returned. Octets are returned as integers from 0 to 255. - : - : @param $in value of type xs:base64Binary - : @return value of type xs:integer* - :) -declare function bin:to-octets($in as xs:base64Binary) as xs:integer* external; - -(:~ - : Converts a sequence of octets into binary data.
Octets are integers from 0 to 255. If the value of $in is the empty sequence, the function returns zero-sized binary data. - : - : @param $in value of type xs:integer* - : @return value of type xs:base64Binary - : @error bin:octet-out-of-range one of the octets lies outside the range 0 - 255. - :) -declare function bin:from-octets($in as xs:integer*) as xs:base64Binary external; - -(:~ - : Returns the size of binary data in octets. - : - : @param $in value of type xs:base64Binary - : @return value of type xs:integer - :) -declare function bin:length($in as xs:base64Binary) as xs:integer external; - -(:~ - : Returns a section of binary data starting at the $offset octet.
If $size is specified, the size of the returned binary data is $size octets. If $size is absent, all remaining data from $offset is returned. The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $offset value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - :) -declare function bin:part($in as xs:base64Binary?, $offset as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns a section of binary data starting at the $offset octet.
If $size is specified, the size of the returned binary data is $size octets. If $size is absent, all remaining data from $offset is returned. The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - :) -declare function bin:part($in as xs:base64Binary?, $offset as xs:integer, $size as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by concatenating the items in the sequence $in, in order. If the value of $in is the empty sequence, the function returns a binary item containing no data bytes. - : - : @param $in value of type xs:base64Binary* - : @return value of type xs:base64Binary - :) -declare function bin:join($in as xs:base64Binary*) as xs:base64Binary external; - -(:~ - : Returns binary data consisting sequentially of the data from $in up to and including the $offset - 1 octet, followed by all the data from $extra, and then the remaining data from $in.
The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $offset value of type xs:integer - : @param $extra value of type xs:base64Binary? - : @return value of type xs:base64Binary? - : @error bin:index-out-of-range the specified offset is out of range. - :) -declare function bin:insert-before($in as xs:base64Binary?, $offset as xs:integer, $extra as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by padding the input with $size octets in front of the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $size value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:octet-out-of-range the specified octet lies outside the range 0-255. - :) -declare function bin:pad-left($in as xs:base64Binary?, $size as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by padding the input with $size octets in front of the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $size value of type xs:integer - : @param $octet value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:octet-out-of-range the specified octet lies outside the range 0-255. - :) -declare function bin:pad-left($in as xs:base64Binary?, $size as xs:integer, $octet as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by padding the input with $size octets after the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $size value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:octet-out-of-range the specified octet lies outside the range 0-255. - :) -declare function bin:pad-right($in as xs:base64Binary?, $size as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns an xs:base64Binary created by padding the input with $size octets after the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $size value of type xs:integer - : @param $octet value of type xs:integer - : @return value of type xs:base64Binary? - : @error bin:negative-size the specified size is negative. - : @error bin:octet-out-of-range the specified octet lies outside the range 0-255. - :) -declare function bin:pad-right($in as xs:base64Binary?, $size as xs:integer, $octet as xs:integer) as xs:base64Binary? external; - -(:~ - : Returns the first location of the binary search sequence in the input, or if not found, the empty sequence.
The $offset and the returned location are zero based. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $offset value of type xs:integer - : @param $search value of type xs:base64Binary - : @return value of type xs:integer? - : @error bin:index-out-of-range the specified offset + size is out of range. - :) -declare function bin:find($in as xs:base64Binary?, $offset as xs:integer, $search as xs:base64Binary) as xs:integer? external; - -(:~ - : Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $encoding value of type xs:string - : @return value of type xs:string? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-encoding the specified encoding is unknown. - : @error bin:conversion-error an error or malformed input occurred during decoding the string. - :) -declare function bin:decode-string($in as xs:base64Binary?, $encoding as xs:string) as xs:string? external; - -(:~ - : Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $encoding value of type xs:string - : @param $offset value of type xs:integer - : @return value of type xs:string? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-encoding the specified encoding is unknown. - : @error bin:conversion-error an error or malformed input occurred during decoding the string. - :) -declare function bin:decode-string($in as xs:base64Binary?, $encoding as xs:string, $offset as xs:integer) as xs:string? external; - -(:~ - : Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $encoding value of type xs:string - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:string? - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-encoding the specified encoding is unknown. - : @error bin:conversion-error an error or malformed input occurred during decoding the string. - :) -declare function bin:decode-string($in as xs:base64Binary?, $encoding as xs:string, $offset as xs:integer, $size as xs:integer) as xs:string? external; - -(:~ - : Encodes a string into binary data using a given $encoding.
If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:string? - : @param $encoding value of type xs:string - : @return value of type xs:base64Binary? - : @error bin:unknown-encoding the specified encoding is unknown. - : @error bin:conversion-error an error or malformed input occurred during encoding the string. - :) -declare function bin:encode-string($in as xs:string?, $encoding as xs:string) as xs:base64Binary? external; - -(:~ - : Returns the 8-octet binary representation of a double value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. - : - : @param $in value of type xs:double - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:pack-double($in as xs:double) as xs:base64Binary external; - -(:~ - : Returns the 8-octet binary representation of a double value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. - : - : @param $in value of type xs:double - : @param $octet-order value of type xs:string - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:pack-double($in as xs:double, $octet-order as xs:string) as xs:base64Binary external; - -(:~ - : Returns the 4-octet binary representation of a float value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. - : - : @param $in value of type xs:float - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:pack-float($in as xs:float) as xs:base64Binary external; - -(:~ - : Returns the 4-octet binary representation of a float value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. - : - : @param $in value of type xs:float - : @param $octet-order value of type xs:string - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:pack-float($in as xs:float, $octet-order as xs:string) as xs:base64Binary external; - -(:~ - : Returns the twos-complement binary representation of an integer value treated as $size octets long. Any 'excess' high-order bits are discarded.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. Specifying a $size of zero yields an empty binary data. - : - : @param $in value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - : @error bin:negative-size the specified size is negative. - :) -declare function bin:pack-integer($in as xs:integer, $size as xs:integer) as xs:base64Binary external; - -(:~ - : Returns the twos-complement binary representation of an integer value treated as $size octets long. Any 'excess' high-order bits are discarded.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. Specifying a $size of zero yields an empty binary data. - : - : @param $in value of type xs:integer - : @param $size value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:base64Binary - : @error bin:unknown-significance-order the specified octet order is unknown. - : @error bin:negative-size the specified size is negative. - :) -declare function bin:pack-integer($in as xs:integer, $size as xs:integer, $octet-order as xs:string) as xs:base64Binary external; - -(:~ - : Extracts the double value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @return value of type xs:double - : @error bin:index-out-of-range the specified offset is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-double($in as xs:base64Binary, $offset as xs:integer) as xs:double external; - -(:~ - : Extracts the double value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:double - : @error bin:index-out-of-range the specified offset is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-double($in as xs:base64Binary, $offset as xs:integer, $octet-order as xs:string) as xs:double external; - -(:~ - : Extracts the float value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @return value of type xs:float - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-float($in as xs:base64Binary, $offset as xs:integer) as xs:float external; - -(:~ - : Extracts the float value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:float - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-float($in as xs:base64Binary, $offset as xs:integer, $octet-order as xs:string) as xs:float external; - -(:~ - : Returns a signed integer value represented by the $size octets starting from $offset in the input binary representation. Necessary sign extension is performed (i.e. the result is negative if the high order bit is '1').
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:integer - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-integer($in as xs:base64Binary, $offset as xs:integer, $size as xs:integer) as xs:integer external; - -(:~ - : Returns a signed integer value represented by the $size octets starting from $offset in the input binary representation. Necessary sign extension is performed (i.e. the result is negative if the high order bit is '1').
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:integer - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-integer($in as xs:base64Binary, $offset as xs:integer, $size as xs:integer, $octet-order as xs:string) as xs:integer external; - -(:~ - : Returns an unsigned integer value represented by the $size octets starting from $offset in the input binary representation.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @return value of type xs:integer - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-unsigned-integer($in as xs:base64Binary, $offset as xs:integer, $size as xs:integer) as xs:integer external; - -(:~ - : Returns an unsigned integer value represented by the $size octets starting from $offset in the input binary representation.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0. - : - : @param $in value of type xs:base64Binary - : @param $offset value of type xs:integer - : @param $size value of type xs:integer - : @param $octet-order value of type xs:string - : @return value of type xs:integer - : @error bin:negative-size the specified size is negative. - : @error bin:index-out-of-range the specified offset + size is out of range. - : @error bin:unknown-significance-order the specified octet order is unknown. - :) -declare function bin:unpack-unsigned-integer($in as xs:base64Binary, $offset as xs:integer, $size as xs:integer, $octet-order as xs:string) as xs:integer external; - -(:~ - : Returns the "bitwise or" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned. - : - : @param $a value of type xs:base64Binary? - : @param $b value of type xs:base64Binary? - : @return value of type xs:base64Binary? - : @error bin:differing-length-arguments the input arguments are of differing length. - :) -declare function bin:or($a as xs:base64Binary?, $b as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Returns the "bitwise xor" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned. - : - : @param $a value of type xs:base64Binary? - : @param $b value of type xs:base64Binary? - : @return value of type xs:base64Binary? - : @error bin:differing-length-arguments the input arguments are of differing length. - :) -declare function bin:xor($a as xs:base64Binary?, $b as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Returns the "bitwise and" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned. - : - : @param $a value of type xs:base64Binary? - : @param $b value of type xs:base64Binary? - : @return value of type xs:base64Binary? - : @error bin:differing-length-arguments the input arguments are of differing length. - :) -declare function bin:and($a as xs:base64Binary?, $b as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Returns the "bitwise not" of a binary argument.
If the argument is the empty sequence, an empty sequence is returned. - : - : @param $in value of type xs:base64Binary? - : @return value of type xs:base64Binary? - :) -declare function bin:not($in as xs:base64Binary?) as xs:base64Binary? external; - -(:~ - : Shifts bits in binary data.
If $by is zero, the result is identical to $in. If $by is positive then bits are shifted to the left. Otherwise, bits are shifted to the right. If the absolute value of $by is greater than the bit-length of $in then an all-zeros result is returned. The result always has the same size as $in. The shifting is logical: zeros are placed into discarded bits. If the value of $in is the empty sequence, the function returns an empty sequence. - : - : @param $in value of type xs:base64Binary? - : @param $by value of type xs:integer - : @return value of type xs:base64Binary? - :) -declare function bin:shift($in as xs:base64Binary?, $by as xs:integer) as xs:base64Binary? external; diff --git a/packages.src/basex-9.7/client.xqm b/packages.src/basex-9.7/client.xqm deleted file mode 100644 index 58d6ad3..0000000 --- a/packages.src/basex-9.7/client.xqm +++ /dev/null @@ -1,71 +0,0 @@ -(:~ - : This XQuery Module contains functions to access BaseX server instances from XQuery. With this module, you can execute database commands and evaluate XQuery expressions. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Client_Module - :) -module namespace client = "http://basex.org/modules/client"; - -(:~ - : This function establishes a connection to a remote BaseX server, creates a new client session, and returns a session id. The parameter $host is the name of the database server, $port specifies the server port, and $user and $password represent the login data. - : - : @param $host value of type xs:string - : @param $port value of type xs:integer - : @param $user value of type xs:string - : @param $password value of type xs:string - : @return value of type xs:anyURI - : @error client:connect an error occurs while creating the session (possible reasons: server not available, access denied). - :) -declare function client:connect($host as xs:string, $port as xs:integer, $user as xs:string, $password as xs:string) as xs:anyURI external; - -(:~ - : This function executes a command and returns the result as string. The parameter $id contains the session id returned by client:connect. The $command argument represents a single command, which will be executed by the server. - : - : @param $id value of type xs:anyURI - : @param $command value of type xs:string - : @return value of type xs:string - : @error client:error an I/O error occurs while transferring data from or to the server. - : @error client:command an error occurs while executing a command. - :) -declare function client:execute($id as xs:anyURI, $command as xs:string) as xs:string external; - -(:~ - : This function returns an information string, created by the last call of client:execute. $id specifies the session id. - : - : @param $id value of type xs:anyURI - : @return value of type xs:string - :) -declare function client:info($id as xs:anyURI) as xs:string external; - -(:~ - : Evaluates a query and returns the result as sequence. The parameter $id contains the session id returned by client:connect, and $query represents the query string, which will be evaluated by the server.
Variables and the context item can be declared via $bindings. The specified keys must be QNames or strings:
  • If a key is a QName, it will be directly adopted as variable name.
  • If a key is a string, it may be prefixed with a dollar sign. A namespace can be specified using the Clark Notation. If the specified string is empty, the value will be bound to the context item.
- : - : @param $id value of type xs:anyURI - : @param $query value of type xs:string - : @return value of type item()* - : @error client:error an I/O error occurs while transferring data from or to the server. - : @error client:query an error occurs while evaluating a query, and if the original error cannot be extracted from the returned error string. - : @error client:function function items (including maps and arrays) cannot be returned. - :) -declare function client:query($id as xs:anyURI, $query as xs:string) as item()* external; - -(:~ - : Evaluates a query and returns the result as sequence. The parameter $id contains the session id returned by client:connect, and $query represents the query string, which will be evaluated by the server.
Variables and the context item can be declared via $bindings. The specified keys must be QNames or strings:
  • If a key is a QName, it will be directly adopted as variable name.
  • If a key is a string, it may be prefixed with a dollar sign. A namespace can be specified using the Clark Notation. If the specified string is empty, the value will be bound to the context item.
- : - : @param $id value of type xs:anyURI - : @param $query value of type xs:string - : @param $bindings value of type map(*)? - : @return value of type item()* - : @error client:error an I/O error occurs while transferring data from or to the server. - : @error client:query an error occurs while evaluating a query, and if the original error cannot be extracted from the returned error string. - : @error client:function function items (including maps and arrays) cannot be returned. - :) -declare function client:query($id as xs:anyURI, $query as xs:string, $bindings as map(*)?) as item()* external; - -(:~ - : This function closes a client session. $id specifies the session id.
Opened connections will automatically be closed after the XQuery expression has been evaluated, but it is recommendable to explicitly close them with this function if you open many connections. - : - : @param $id value of type xs:anyURI - : @error client:error an I/O error occurs while transferring data from or to the server. - :) -declare function client:close($id as xs:anyURI) as empty-sequence() external; diff --git a/packages.src/basex-9.7/convert.xqm b/packages.src/basex-9.7/convert.xqm deleted file mode 100644 index 32ec961..0000000 --- a/packages.src/basex-9.7/convert.xqm +++ /dev/null @@ -1,203 +0,0 @@ -(:~ - : This XQuery Module contains functions to convert data between different formats. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Conversion_Module - :) -module namespace convert = "http://basex.org/modules/convert"; - -(:~ - : Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $bytes value of type xs:anyAtomicType - : @return value of type xs:string - : @error convert:string The input is an invalid XML string, or the wrong encoding has been specified. - : @error convert:BXCO0002 The specified encoding is invalid or not supported. - :) -declare function convert:binary-to-string($bytes as xs:anyAtomicType) as xs:string external; - -(:~ - : Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $bytes value of type xs:anyAtomicType - : @param $encoding value of type xs:string - : @return value of type xs:string - : @error convert:string The input is an invalid XML string, or the wrong encoding has been specified. - : @error convert:BXCO0002 The specified encoding is invalid or not supported. - :) -declare function convert:binary-to-string($bytes as xs:anyAtomicType, $encoding as xs:string) as xs:string external; - -(:~ - : Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $bytes value of type xs:anyAtomicType - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @return value of type xs:string - : @error convert:string The input is an invalid XML string, or the wrong encoding has been specified. - : @error convert:BXCO0002 The specified encoding is invalid or not supported. - :) -declare function convert:binary-to-string($bytes as xs:anyAtomicType, $encoding as xs:string, $fallback as xs:boolean) as xs:string external; - -(:~ - : Converts the specified $string to an xs:base64Binary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument. - : - : @param $string value of type xs:string - : @return value of type xs:base64Binary - : @error convert:binary The input cannot be represented in the specified encoding. - : @error convert:encoding The specified encoding is invalid or not supported. - :) -declare function convert:string-to-base64($string as xs:string) as xs:base64Binary external; - -(:~ - : Converts the specified $string to an xs:base64Binary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument. - : - : @param $string value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:base64Binary - : @error convert:binary The input cannot be represented in the specified encoding. - : @error convert:encoding The specified encoding is invalid or not supported. - :) -declare function convert:string-to-base64($string as xs:string, $encoding as xs:string) as xs:base64Binary external; - -(:~ - : Converts the specified $string to an xs:hexBinary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument. - : - : @param $string value of type xs:string - : @return value of type xs:hexBinary - : @error convert:binary The input cannot be represented in the specified encoding. - : @error convert:encoding The specified encoding is invalid or not supported. - :) -declare function convert:string-to-hex($string as xs:string) as xs:hexBinary external; - -(:~ - : Converts the specified $string to an xs:hexBinary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument. - : - : @param $string value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:hexBinary - : @error convert:binary The input cannot be represented in the specified encoding. - : @error convert:encoding The specified encoding is invalid or not supported. - :) -declare function convert:string-to-hex($string as xs:string, $encoding as xs:string) as xs:hexBinary external; - -(:~ - : Converts the specified $integers to an item of type xs:base64Binary:
  • Only the first 8 bits of the supplied integers will be considered.
  • Conversion of byte sequences is very efficient, as items of binary type are internally represented as byte arrays.
- : - : @param $integers value of type xs:integer* - : @return value of type xs:base64Binary - :) -declare function convert:integers-to-base64($integers as xs:integer*) as xs:base64Binary external; - -(:~ - : Converts the specified $integers to an item of type xs:hexBinary:
  • Only the first 8 bits of the supplied integers will be considered.
  • Conversion of byte sequences is very efficient, as items of binary type are internally represented as byte arrays.
- : - : @param $integers value of type xs:integer* - : @return value of type xs:hexBinary - :) -declare function convert:integers-to-hex($integers as xs:integer*) as xs:hexBinary external; - -(:~ - : Returns the specified $binary (xs:base64Binary, xs:hexBinary) as a sequence of unsigned integers (octets). - : - : @param $binary value of type xs:anyAtomicType - : @return value of type xs:integer* - :) -declare function convert:binary-to-integers($binary as xs:anyAtomicType) as xs:integer* external; - -(:~ - : Returns the specified $binary (xs:base64Binary, xs:hexBinary) as a sequence of bytes. The conversion is very cheap and takes no additional memory, as items of binary type are internally represented as byte arrays. - : - : @param $binary value of type xs:anyAtomicType - : @return value of type xs:byte* - :) -declare function convert:binary-to-bytes($binary as xs:anyAtomicType) as xs:byte* external; - -(:~ - : Converts $number to a string, using the specified $base, interpreting it as a 64-bit unsigned integer.
The first base elements of the sequence '0',..,'9','a',..,'z' are used as digits.
Valid bases are 2, .., 36.
- : - : @param $number value of type xs:integer - : @param $base value of type xs:integer - : @return value of type xs:string - : @error convert:base The specified base is not in the range 2-36. - :) -declare function convert:integer-to-base($number as xs:integer, $base as xs:integer) as xs:string external; - -(:~ - : Decodes an integer from $string, using the specified $base.
The first base elements of the sequence '0',..,'9','a',..,'z' are allowed as digits; case does not matter.
Valid bases are 2 - 36.
If the supplied string contains more than 64 bits of information, the result will be truncated. - : - : @param $string value of type xs:string - : @param $base value of type xs:integer - : @return value of type xs:integer - : @error convert:base The specified base is not in the range 2-36. - : @error convert:integer The specified digit is not valid for the given range. - :) -declare function convert:integer-from-base($string as xs:string, $base as xs:integer) as xs:integer external; - -(:~ - : Converts the specified number of $milliseconds since 1 Jan 1970 to an item of type xs:dateTime.
- : - : @param $milliseconds value of type xs:integer - : @return value of type xs:dateTime - :) -declare function convert:integer-to-dateTime($milliseconds as xs:integer) as xs:dateTime external; - -(:~ - : Converts the specified $dateTime item to the number of milliseconds since 1 Jan 1970.
- : - : @param $dateTime value of type xs:dateTime - : @return value of type xs:integer - :) -declare function convert:dateTime-to-integer($dateTime as xs:dateTime) as xs:integer external; - -(:~ - : Converts the specified number of $milliseconds to an item of type xs:dayTimeDuration.
- : - : @param $milliseconds value of type xs:integer - : @return value of type xs:dayTimeDuration - :) -declare function convert:integer-to-dayTime($milliseconds as xs:integer) as xs:dayTimeDuration external; - -(:~ - : Converts the specified $dayTime duration to milliseconds represented by an integer.
- : - : @param $dayTime value of type xs:dayTimeDuration - : @return value of type xs:integer - :) -declare function convert:dayTime-to-integer($dayTime as xs:dayTimeDuration) as xs:integer external; - -(:~ - : Encodes the specified $key (with the optional $lax conversion method) to a valid NCName representation, which can be used to create an element node:
  • An empty string is converted to a single underscore (_).
  • Existing underscores are rewritten to two underscores (__).
  • Characters that are no valid NCName characters are rewritten to an underscore and the character’s four-digit Unicode. For example, the exclamation mark ? is transformed to _003f.
  • If lax conversion is chosen, invalid characters are replaced with underscores or (when invalid as first character of an element name) prefixed with an underscore. The resulting string may be better readable, but it cannot necessarily be converted back to the original form.

This encoding is employed by the direct conversion format in the JSON Module and the CSV Module.

- : - : @param $key value of type xs:string - : @return value of type xs:string - :) -declare function convert:encode-key($key as xs:string) as xs:string external; - -(:~ - : Encodes the specified $key (with the optional $lax conversion method) to a valid NCName representation, which can be used to create an element node:
  • An empty string is converted to a single underscore (_).
  • Existing underscores are rewritten to two underscores (__).
  • Characters that are no valid NCName characters are rewritten to an underscore and the character’s four-digit Unicode. For example, the exclamation mark ? is transformed to _003f.
  • If lax conversion is chosen, invalid characters are replaced with underscores or (when invalid as first character of an element name) prefixed with an underscore. The resulting string may be better readable, but it cannot necessarily be converted back to the original form.

This encoding is employed by the direct conversion format in the JSON Module and the CSV Module.

- : - : @param $key value of type xs:string - : @param $lax value of type xs:boolean - : @return value of type xs:string - :) -declare function convert:encode-key($key as xs:string, $lax as xs:boolean) as xs:string external; - -(:~ - : Decodes the specified $key (with the optional $lax conversion method) to the original string representation.
Keys supplied to this function are usually element names from documents that have been created with the JSON Module or CSV Module. - : - : @param $key value of type xs:string - : @return value of type xs:string - : @error convert:key The specified key cannot be decoded to its original representation. - :) -declare function convert:decode-key($key as xs:string) as xs:string external; - -(:~ - : Decodes the specified $key (with the optional $lax conversion method) to the original string representation.
Keys supplied to this function are usually element names from documents that have been created with the JSON Module or CSV Module. - : - : @param $key value of type xs:string - : @param $lax value of type xs:boolean - : @return value of type xs:string - : @error convert:key The specified key cannot be decoded to its original representation. - :) -declare function convert:decode-key($key as xs:string, $lax as xs:boolean) as xs:string external; diff --git a/packages.src/basex-9.7/crypto.xqm b/packages.src/basex-9.7/crypto.xqm deleted file mode 100644 index 3dd37fc..0000000 --- a/packages.src/basex-9.7/crypto.xqm +++ /dev/null @@ -1,161 +0,0 @@ -(:~ - : This XQuery Module contains functions to perform cryptographic operations in XQuery. The cryptographic module is based on an early draft of the EXPath Cryptographic Module and provides the following functionality: creation of message authentication codes (HMAC), encryption and decryption, and creation and validation of XML Digital Signatures. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Cryptographic_Module - :) -module namespace crypto = "http://expath.org/ns/crypto"; -declare namespace experr = "http://expath.org/ns/error"; - -(:~ - : Creates an authentication code for the specified $data via a cryptographic hash function:
  • $key must not be empty.
  • $algorithm describes the hash algorithm which is used for encryption. Currently supported are md5, sha1, sha256, sha384, sha512. Default is md5.
  • $encoding must either be hex or base64; it specifies the encoding of the returned authentication code. Default is base64.
- : - : @param $data value of type xs:anyAtomicType - : @param $key value of type xs:anyAtomicType - : @param $algorithm value of type xs:string - : @return value of type xs:string - : @error experr:CX0013 the specified hashing algorithm is not supported. - : @error experr:CX0014 the specified encoding method is not supported. - : @error experr:CX0019 the specified secret key is invalid. - :) -declare function crypto:hmac($data as xs:anyAtomicType, $key as xs:anyAtomicType, $algorithm as xs:string) as xs:string external; - -(:~ - : Creates an authentication code for the specified $data via a cryptographic hash function:
  • $key must not be empty.
  • $algorithm describes the hash algorithm which is used for encryption. Currently supported are md5, sha1, sha256, sha384, sha512. Default is md5.
  • $encoding must either be hex or base64; it specifies the encoding of the returned authentication code. Default is base64.
- : - : @param $data value of type xs:anyAtomicType - : @param $key value of type xs:anyAtomicType - : @param $algorithm value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:string - : @error experr:CX0013 the specified hashing algorithm is not supported. - : @error experr:CX0014 the specified encoding method is not supported. - : @error experr:CX0019 the specified secret key is invalid. - :) -declare function crypto:hmac($data as xs:anyAtomicType, $key as xs:anyAtomicType, $algorithm as xs:string, $encoding as xs:string) as xs:string external; - -(:~ - : Encrypts data with the specified key:
  • $data must be a string or binary item.
  • $type must be symmetric.
  • $key is the secret key which is used for both encryption and decryption of input data. It must be a string or binary item. Its length is fixed and depends on the chosen algorithm: 8 bytes for DES, 16 bytes for AES.
  • $algorithm must either be DES or AES. Default is DES.
- : - : @param $data value of type xs:anyAtomicType - : @param $type value of type xs:string - : @param $key value of type xs:anyAtomicType - : @param $algorithm value of type xs:string - : @return value of type xs:base64Binary - : @error experr:CX0016 padding problems arise. - : @error experr:CX0017 padding is incorrect. - : @error experr:CX0018 the encryption type is not supported. - : @error experr:CX0019 the secret key is invalid. - : @error experr:CX0020 the block size is incorrect. - : @error experr:CX0021 the specified encryption algorithm is not supported. - :) -declare function crypto:encrypt($data as xs:anyAtomicType, $type as xs:string, $key as xs:anyAtomicType, $algorithm as xs:string) as xs:base64Binary external; - -(:~ - : Encrypts data with the specified key:
  • $data must be a string or binary item.
  • $type must be symmetric.
  • $key is the secret key which is used for both encryption and decryption of input data. It must be a string or binary item. Its length is fixed and depends on the chosen algorithm: 8 bytes for DES, 16 bytes for AES.
  • $algorithm must either be DES or AES. Default is DES.
- : - : @param $data value of type xs:anyAtomicType - : @param $type value of type xs:string - : @param $key value of type xs:anyAtomicType - : @param $algorithm value of type xs:string - : @return value of type xs:string - : @error experr:CX0016 padding problems arise. - : @error experr:CX0017 padding is incorrect. - : @error experr:CX0018 the encryption type is not supported. - : @error experr:CX0019 the secret key is invalid. - : @error experr:CX0020 the block size is incorrect. - : @error experr:CX0021 the specified encryption algorithm is not supported. - :) -declare function crypto:decrypt($data as xs:anyAtomicType, $type as xs:string, $key as xs:anyAtomicType, $algorithm as xs:string) as xs:string external; - -(:~ - : $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

- : - : @param $input value of type node() - : @param $canonicalization value of type xs:string - : @param $digest value of type xs:string - : @param $signature value of type xs:string - : @param $prefix value of type xs:string - : @param $type value of type xs:string - : @return value of type node() - : @error experr:CX0001 the canonicalization algorithm is not supported. - : @error experr:CX0002 the digest algorithm is not supported. - : @error experr:CX0003 the signature algorithm is not supported. - : @error experr:CX0004 the $xpath-expression is invalid. - : @error experr:CX0005 the root name of $digital-certificate is not 'digital-certificate. - : @error experr:CX0007 the key store is null. - : @error experr:CX0012 the key cannot be found in the specified key store. - : @error experr:CX0023 the certificate alias is invalid. - : @error experr:CX0024 an invalid algorithm is specified. - : @error experr:CX0025 an exception occurs while the signing the document. - : @error experr:CX0026 an exception occurs during key store initialization. - : @error experr:CX0027 an IO exception occurs. - : @error experr:CX0028 the signature type is not supported. - :) -declare function crypto:generate-signature($input as node(), $canonicalization as xs:string, $digest as xs:string, $signature as xs:string, $prefix as xs:string, $type as xs:string) as node() external; - -(:~ - : $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

- : - : @param $input value of type node() - : @param $canonicalization value of type xs:string - : @param $digest value of type xs:string - : @param $signature value of type xs:string - : @param $prefix value of type xs:string - : @param $type value of type xs:string - : @param $xpath value of type xs:string - : @param $certificate value of type node() - : @return value of type node() - : @error experr:CX0001 the canonicalization algorithm is not supported. - : @error experr:CX0002 the digest algorithm is not supported. - : @error experr:CX0003 the signature algorithm is not supported. - : @error experr:CX0004 the $xpath-expression is invalid. - : @error experr:CX0005 the root name of $digital-certificate is not 'digital-certificate. - : @error experr:CX0007 the key store is null. - : @error experr:CX0012 the key cannot be found in the specified key store. - : @error experr:CX0023 the certificate alias is invalid. - : @error experr:CX0024 an invalid algorithm is specified. - : @error experr:CX0025 an exception occurs while the signing the document. - : @error experr:CX0026 an exception occurs during key store initialization. - : @error experr:CX0027 an IO exception occurs. - : @error experr:CX0028 the signature type is not supported. - :) -declare function crypto:generate-signature($input as node(), $canonicalization as xs:string, $digest as xs:string, $signature as xs:string, $prefix as xs:string, $type as xs:string, $xpath as xs:string, $certificate as node()) as node() external; - -(:~ - : $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

- : - : @param $input value of type node() - : @param $canonicalization value of type xs:string - : @param $digest value of type xs:string - : @param $signature value of type xs:string - : @param $prefix value of type xs:string - : @param $type value of type xs:string - : @param $ext value of type item() - : @return value of type node() - : @error experr:CX0001 the canonicalization algorithm is not supported. - : @error experr:CX0002 the digest algorithm is not supported. - : @error experr:CX0003 the signature algorithm is not supported. - : @error experr:CX0004 the $xpath-expression is invalid. - : @error experr:CX0005 the root name of $digital-certificate is not 'digital-certificate. - : @error experr:CX0007 the key store is null. - : @error experr:CX0012 the key cannot be found in the specified key store. - : @error experr:CX0023 the certificate alias is invalid. - : @error experr:CX0024 an invalid algorithm is specified. - : @error experr:CX0025 an exception occurs while the signing the document. - : @error experr:CX0026 an exception occurs during key store initialization. - : @error experr:CX0027 an IO exception occurs. - : @error experr:CX0028 the signature type is not supported. - :) -declare function crypto:generate-signature($input as node(), $canonicalization as xs:string, $digest as xs:string, $signature as xs:string, $prefix as xs:string, $type as xs:string, $ext as item()) as node() external; - -(:~ - : Checks if the given node contains a Signature element and whether the signature is valid. In this case true is returned. If the signature is invalid the function returns false. - : - : @param $input-doc value of type node() - : @return value of type xs:boolean - : @error experr:CX0015 the signature element cannot be found. - : @error experr:CX9994 an unspecified problem occurs during validation. - : @error experr:CX9996 an IO exception occurs during validation. - :) -declare function crypto:validate-signature($input-doc as node()) as xs:boolean external; diff --git a/packages.src/basex-9.7/csv.xqm b/packages.src/basex-9.7/csv.xqm deleted file mode 100644 index 85985d1..0000000 --- a/packages.src/basex-9.7/csv.xqm +++ /dev/null @@ -1,66 +0,0 @@ -(:~ - : This XQuery Module contains a single function to parse CSV input. CSV (comma-separated values) is a popular representation for tabular data, exported e. g. from Excel. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/CSV_Module - :) -module namespace csv = "http://basex.org/modules/csv"; - -(:~ - : Converts the CSV $string to an XQuery value. The $options argument can be used to control the way the input is converted. - : - : @param $string value of type xs:string? - : @return value of type item()? - : @error csv:parse the specified input cannot be parsed as CSV document. - :) -declare function csv:parse($string as xs:string?) as item()? external; - -(:~ - : Converts the CSV $string to an XQuery value. The $options argument can be used to control the way the input is converted. - : - : @param $string value of type xs:string? - : @param $options value of type map(*)? - : @return value of type item()? - : @error csv:parse the specified input cannot be parsed as CSV document. - :) -declare function csv:parse($string as xs:string?, $options as map(*)?) as item()? external; - -(:~ - : Fetches the CSV document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted. - : - : @param $uri value of type xs:string? - : @return value of type item()? - : @error csv:parse the specified input cannot be parsed as CSV document. - : @error csv:options the specified options are conflicting. - :) -declare function csv:doc($uri as xs:string?) as item()? external; - -(:~ - : Fetches the CSV document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted. - : - : @param $uri value of type xs:string? - : @param $options value of type map(*)? - : @return value of type item()? - : @error csv:parse the specified input cannot be parsed as CSV document. - : @error csv:options the specified options are conflicting. - :) -declare function csv:doc($uri as xs:string?, $options as map(*)?) as item()? external; - -(:~ - : Serializes the specified $input as CSV, using the specified $options, and returns the result as string.

Values can also be serialized as CSV with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to csv, and
  • the options presented in this article need to be assigned to the csv parameter.
- : - : @param $input value of type item()? - : @return value of type xs:string - : @error csv:serialize the input cannot be serialized. - :) -declare function csv:serialize($input as item()?) as xs:string external; - -(:~ - : Serializes the specified $input as CSV, using the specified $options, and returns the result as string.

Values can also be serialized as CSV with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to csv, and
  • the options presented in this article need to be assigned to the csv parameter.
- : - : @param $input value of type item()? - : @param $options value of type map(*)? - : @return value of type xs:string - : @error csv:serialize the input cannot be serialized. - :) -declare function csv:serialize($input as item()?, $options as map(*)?) as xs:string external; diff --git a/packages.src/basex-9.7/db.xqm b/packages.src/basex-9.7/db.xqm deleted file mode 100644 index 2a7ee67..0000000 --- a/packages.src/basex-9.7/db.xqm +++ /dev/null @@ -1,627 +0,0 @@ -(:~ - : This XQuery Module contains functions for processing databases from within XQuery. Existing databases can be opened and listed, its contents can be directly accessed, documents can be added to and removed, etc. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Database_Module - :) -module namespace db = "http://basex.org/modules/db"; - -(:~ - : Returns general information on the database system the current values of all global and local Options. The INFO command returns similar output. - : - : @return value of type element(system) - :) -declare function db:system() as element(system) external; - -(:~ - : Returns the current value (string, integer, boolean, map) of a global or local Option with the specified $name. The GET command works similar. - : - : @param $name value of type xs:string - : @return value of type xs:string - : @error db:option the specified option is unknown. - :) -declare function db:option($name as xs:string) as xs:string external; - -(:~ - : Returns meta information on the database $db. The output is similar to the INFO DB command. - : - : @param $db value of type xs:string - : @return value of type element(database) - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:info($db as xs:string) as element(database) external; - -(:~ - : Returns the value (string, boolean, integer) of a property with the specified $name in the database $db. The available properties are the ones returned by db:info. - : - : @param $db value of type xs:string - : @param $name value of type xs:string - : @return value of type xs:anyAtomicType - : @error db:property the specified property is unknown. - :) -declare function db:property($db as xs:string, $name as xs:string) as xs:anyAtomicType external; - -(:~ - : The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
- : - : @return value of type xs:string* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list() as xs:string* external; - -(:~ - : The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
- : - : @param $db value of type xs:string - : @return value of type xs:string* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list($db as xs:string) as xs:string* external; - -(:~ - : The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:string* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list($db as xs:string, $path as xs:string) as xs:string* external; - -(:~ - : Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
- : - : @return value of type element(database)* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list-details() as element(database)* external; - -(:~ - : Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
- : - : @param $db value of type xs:string - : @return value of type element(resource)* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list-details($db as xs:string) as element(resource)* external; - -(:~ - : Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type element(resource)* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:list-details($db as xs:string, $path as xs:string) as element(resource)* external; - -(:~ - : Returns meta data on all directories and resources of the database $db in the specified directory $path. Two types of elements are returned:
  • resource represents a resource. The element value is the directory path; content type, modification date, raw flag (which indicates if the resource is binary or XML), and size of the resource are returned as attributes.
  • dir represents a directory. The element value is the directory path; the modification date is returned as attribute.

Please note that directories are not stored in BaseX. Instead, they result implicitly from the paths of stored resources.

- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type element()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:path the specified path is invalid. - :) -declare function db:dir($db as xs:string, $path as xs:string) as element()* external; - -(:~ - : Opens the database $db and returns all document nodes.
The document nodes to be returned can be filtered with the $path argument. - : - : @param $db value of type xs:string - : @return value of type document-node()* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:open($db as xs:string) as document-node()* external; - -(:~ - : Opens the database $db and returns all document nodes.
The document nodes to be returned can be filtered with the $path argument. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type document-node()* - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:open($db as xs:string, $path as xs:string) as document-node()* external; - -(:~ - : Opens the database $db and returns all distinct nodes with the pre values $pres in document order.
The PRE value provides very fast access to an existing database node, but it will change whenever a node with a smaller pre values is added to or deleted from a database. - : - : @param $db value of type xs:string - : @param $pres value of type xs:integer* - : @return value of type node()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:range the specified pre value does not exist in the database. - :) -declare function db:open-pre($db as xs:string, $pres as xs:integer*) as node()* external; - -(:~ - : Opens the database $db and returns all distinct nodes with the specified $ids in document order.
Each database node has a persistent ID value. Access to the node id can be sped up by turning on the UPDINDEX option. - : - : @param $db value of type xs:string - : @param $ids value of type xs:integer* - : @return value of type node()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:range the specified id value does not exist in the database. - :) -declare function db:open-id($db as xs:string, $ids as xs:integer*) as node()* external; - -(:~ - : Returns the pre values of the specified $nodes, which must all be database nodes.
The PRE value provides very fast access to an existing database node, but it will change whenever a node with a smaller pre values is added to or deleted from a database. - : - : @param $nodes value of type node()* - : @return value of type xs:integer* - : @error db:node $nodes contains a node which is not stored in a database. - :) -declare function db:node-pre($nodes as node()*) as xs:integer* external; - -(:~ - : Returns the id values of the specified $nodes, which must all be database nodes.
Each database node has a persistent ID value. Access to the node id can be sped up by turning on the UPDINDEX option. - : - : @param $nodes value of type node()* - : @return value of type xs:integer* - : @error db:node $nodes contains a node which is not stored in a database. - :) -declare function db:node-id($nodes as node()*) as xs:integer* external; - -(:~ - : Returns a binary resource addressed by the database $db and $path as streamable xs:base64Binary. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:base64Binary - : @error db:open the addressed database does not exist or could not be opened. - : @error db:mainmem the database is not persistent (stored on disk). - :) -declare function db:retrieve($db as xs:string, $path as xs:string) as xs:base64Binary external; - -(:~ - : Exports the specified database $db to the specified file $path. Existing files will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= "div" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { "method" : "xml" , "cdata-section-elements" : "div" , .. . } 
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:export($db as xs:string, $path as xs:string) as empty-sequence() external; - -(:~ - : Exports the specified database $db to the specified file $path. Existing files will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= "div" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { "method" : "xml" , "cdata-section-elements" : "div" , .. . } 
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @param $params value of type item() - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:export($db as xs:string, $path as xs:string, $params as item()) as empty-sequence() external; - -(:~ - : Returns all text nodes of the database $db that have one of the specified $strings as values and that are stored in the text index. - : - : @param $db value of type xs:string - : @param $strings value of type xs:string* - : @return value of type text()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:text($db as xs:string, $strings as xs:string*) as text()* external; - -(:~ - : Returns all text nodes of the database $db whose values are between $min and $max and that are stored in the text index. - : - : @param $db value of type xs:string - : @param $min value of type xs:string - : @param $max value of type xs:string - : @return value of type text()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:text-range($db as xs:string, $min as xs:string, $max as xs:string) as text()* external; - -(:~ - : Returns all attribute nodes of the database $db that have one of the specified $strings as values and that are stored in the attribute index.
If $name is specified, the resulting attribute nodes are filtered by their attribute name. - : - : @param $db value of type xs:string - : @param $strings value of type xs:string* - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:attribute($db as xs:string, $strings as xs:string*) as attribute()* external; - -(:~ - : Returns all attribute nodes of the database $db that have one of the specified $strings as values and that are stored in the attribute index.
If $name is specified, the resulting attribute nodes are filtered by their attribute name. - : - : @param $db value of type xs:string - : @param $strings value of type xs:string* - : @param $name value of type xs:string - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:attribute($db as xs:string, $strings as xs:string*, $name as xs:string) as attribute()* external; - -(:~ - : Returns all attributes of the database $db, the string values of which are larger than or equal to $min and smaller than or equal to $max and that are stored in the attribute index. - : - : @param $db value of type xs:string - : @param $min value of type xs:string - : @param $max value of type xs:string - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:attribute-range($db as xs:string, $min as xs:string, $max as xs:string) as attribute()* external; - -(:~ - : Returns all attributes of the database $db, the string values of which are larger than or equal to $min and smaller than or equal to $max and that are stored in the attribute index. - : - : @param $db value of type xs:string - : @param $min value of type xs:string - : @param $max value of type xs:string - : @param $name value of type xs:string - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:attribute-range($db as xs:string, $min as xs:string, $max as xs:string, $name as xs:string) as attribute()* external; - -(:~ - : Returns all attribute nodes of the database $db the values of which contain one of the specified $tokens.
If $name is specified, the resulting attribute nodes are filtered by their attribute name. - : - : @param $db value of type xs:string - : @param $tokens value of type xs:string* - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:token($db as xs:string, $tokens as xs:string*) as attribute()* external; - -(:~ - : Returns all attribute nodes of the database $db the values of which contain one of the specified $tokens.
If $name is specified, the resulting attribute nodes are filtered by their attribute name. - : - : @param $db value of type xs:string - : @param $tokens value of type xs:string* - : @param $name value of type xs:string - : @return value of type attribute()* - : @error db:open the addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function db:token($db as xs:string, $tokens as xs:string*, $name as xs:string) as attribute()* external; - -(:~ - : Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
- : - : @param $db value of type xs:string - : @error db:lock a database is opened by another process. - : @error db:name the specified name is not a valid database name. - : @error db:conflict the same database was addressed more than once. - : @error db:args the number of specified inputs and paths differs. - :) -declare function db:create($db as xs:string) as empty-sequence() external; - -(:~ - : Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
- : - : @param $db value of type xs:string - : @param $inputs value of type item()* - : @error db:lock a database is opened by another process. - : @error db:name the specified name is not a valid database name. - : @error db:conflict the same database was addressed more than once. - : @error db:args the number of specified inputs and paths differs. - :) -declare function db:create($db as xs:string, $inputs as item()*) as empty-sequence() external; - -(:~ - : Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
- : - : @param $db value of type xs:string - : @param $inputs value of type item()* - : @param $paths value of type xs:string* - : @error db:lock a database is opened by another process. - : @error db:name the specified name is not a valid database name. - : @error db:conflict the same database was addressed more than once. - : @error db:args the number of specified inputs and paths differs. - :) -declare function db:create($db as xs:string, $inputs as item()*, $paths as xs:string*) as empty-sequence() external; - -(:~ - : Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
- : - : @param $db value of type xs:string - : @param $inputs value of type item()* - : @param $paths value of type xs:string* - : @param $options value of type map(*)? - : @error db:lock a database is opened by another process. - : @error db:name the specified name is not a valid database name. - : @error db:conflict the same database was addressed more than once. - : @error db:args the number of specified inputs and paths differs. - :) -declare function db:create($db as xs:string, $inputs as item()*, $paths as xs:string*, $options as map(*)?) as empty-sequence() external; - -(:~ - : Drops the database $db and all connected resources. - : - : @param $db value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:lock a database is opened by another process. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:drop($db as xs:string) as empty-sequence() external; - -(:~ - : Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:replace instead.
  • See db:create for more details on the input and path arguments.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
- : - : @param $db value of type xs:string - : @param $input value of type item() - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:add($db as xs:string, $input as item()) as empty-sequence() external; - -(:~ - : Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:replace instead.
  • See db:create for more details on the input and path arguments.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
- : - : @param $db value of type xs:string - : @param $input value of type item() - : @param $path value of type xs:string? - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:add($db as xs:string, $input as item(), $path as xs:string?) as empty-sequence() external; - -(:~ - : Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:replace instead.
  • See db:create for more details on the input and path arguments.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
- : - : @param $db value of type xs:string - : @param $input value of type item() - : @param $path value of type xs:string? - : @param $options value of type map(*)? - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:add($db as xs:string, $input as item(), $path as xs:string?, $options as map(*)?) as empty-sequence() external; - -(:~ - : Deletes resource(s), specified by $path, from the database $db. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:path the specified path is invalid. - :) -declare function db:delete($db as xs:string, $path as xs:string) as empty-sequence() external; - -(:~ - : Creates a copy of the database $db, which will be called $name. - : - : @param $db value of type xs:string - : @param $name value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:lock a database is opened by another process. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:copy($db as xs:string, $name as xs:string) as empty-sequence() external; - -(:~ - : Renames the database $db to $name. - : - : @param $db value of type xs:string - : @param $name value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:lock a database is opened by another process. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:alter($db as xs:string, $name as xs:string) as empty-sequence() external; - -(:~ - : Optimizes the meta data and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true. - : - : @param $db value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:optimize($db as xs:string) as empty-sequence() external; - -(:~ - : Optimizes the meta data and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true. - : - : @param $db value of type xs:string - : @param $all value of type xs:boolean - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:optimize($db as xs:string, $all as xs:boolean) as empty-sequence() external; - -(:~ - : Optimizes the meta data and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true. - : - : @param $db value of type xs:string - : @param $all value of type xs:boolean - : @param $options value of type map(*)? - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:optimize($db as xs:string, $all as xs:boolean, $options as map(*)?) as empty-sequence() external; - -(:~ - : Moves all resources(s) of database $db, which are found in the supplied $source path, to the supplied $target path. The paths may point to single resources or directories. No updates will take place if a non-existing source path is supplied. - : - : @param $db value of type xs:string - : @param $source value of type xs:string - : @param $target value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:path the specified source or target path, or one of its descendants, is invalid. - :) -declare function db:rename($db as xs:string, $source as xs:string, $target as xs:string) as empty-sequence() external; - -(:~ - : Replaces a resource, specified by $path, in the database $db with the contents of $input, or adds it as a new resource:
  • See db:create for more details on the input argument.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
  • For historical reasons, the order of the 2nd and 3rd argument is different to db:add and db:create
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @param $input value of type item() - : @error db:open the addressed database does not exist or could not be opened. - : @error db:target the path points to a directory. - :) -declare function db:replace($db as xs:string, $path as xs:string, $input as item()) as empty-sequence() external; - -(:~ - : Replaces a resource, specified by $path, in the database $db with the contents of $input, or adds it as a new resource:
  • See db:create for more details on the input argument.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
  • For historical reasons, the order of the 2nd and 3rd argument is different to db:add and db:create
- : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @param $input value of type item() - : @param $options value of type map(*)? - : @error db:open the addressed database does not exist or could not be opened. - : @error db:target the path points to a directory. - :) -declare function db:replace($db as xs:string, $path as xs:string, $input as item(), $options as map(*)?) as empty-sequence() external; - -(:~ - : Replaces a binary resource specified by $input in the database $db and the location specified by $path, or adds it as new resource. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @param $input value of type item() - : @error db:open the addressed database does not exist or could not be opened. - : @error db:mainmem the database is not persistent (stored on disk). - :) -declare function db:store($db as xs:string, $path as xs:string, $input as item()) as empty-sequence() external; - -(:~ - : Explicitly flushes the buffers of the database $db. This command is only useful if AUTOFLUSH has been set to false. - : - : @param $db value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:flush($db as xs:string) as empty-sequence() external; - -(:~ - : Creates a backup of the database $db. If no name is supplied, general data will be backed up. The following $options are available:
  • With comment, a comment string can be attached to the backup.
  • By setting compress to false, the backup will be created faster, but it will take more space on disk.
- : - : @param $db value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:create-backup($db as xs:string) as empty-sequence() external; - -(:~ - : Creates a backup of the database $db. If no name is supplied, general data will be backed up. The following $options are available:
  • With comment, a comment string can be attached to the backup.
  • By setting compress to false, the backup will be created faster, but it will take more space on disk.
- : - : @param $db value of type xs:string - : @param $options value of type map(*) - : @error db:open the addressed database does not exist or could not be opened. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:create-backup($db as xs:string, $options as map(*)) as empty-sequence() external; - -(:~ - : Drops all backups of the database with the specified $name. If the name ends with a timestamp, only the specified backup file will be deleted. If no name is supplied, backups with general data are addressed. - : - : @param $name value of type xs:string - : @error db:backup No backup file found. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:drop-backup($name as xs:string) as empty-sequence() external; - -(:~ - : Renames all backups of the database with the specified $name to $new-name. If the name ends with a date, only the specified backup file will be renamed. - : - : @param $name value of type xs:string - : @param $new-name value of type xs:string - : @error db:backup No backup file found. - : @error db:name invalid database name. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:alter-backup($name as xs:string, $new-name as xs:string) as empty-sequence() external; - -(:~ - : Restores the database with the specified $name. The $name may include the timestamp of the backup file. If no name is supplied, general data will be restored. If general data is restored, it will only be available after BaseX has been restarted. - : - : @param $name value of type xs:string - : @error db:lock a database is opened by another process. - : @error db:name invalid database name. - : @error db:no-backup No backup found. - : @error db:conflict the same database was addressed more than once. - :) -declare function db:restore($name as xs:string) as empty-sequence() external; - -(:~ - : Returns an element sequence containing all available database backups with timestamp, file size and comment.
If a database $db is specified, the sequence will be restricted to the backups matching this database. - : - : @return value of type element(backup)* - :) -declare function db:backups() as element(backup)* external; - -(:~ - : Returns an element sequence containing all available database backups with timestamp, file size and comment.
If a database $db is specified, the sequence will be restricted to the backups matching this database. - : - : @param $db value of type xs:string - : @return value of type element(backup)* - :) -declare function db:backups($db as xs:string) as element(backup)* external; - -(:~ - : Returns the name of the database in which the specified database node $node is stored. - : - : @param $node value of type node() - : @return value of type xs:string - : @error db:node $nodes contains a node which is not stored in a database. - :) -declare function db:name($node as node()) as xs:string external; - -(:~ - : Returns the path of the database document in which the specified database node $node is stored. - : - : @param $node value of type node() - : @return value of type xs:string - : @error db:node $nodes contains a node which is not stored in a database. - :) -declare function db:path($node as node()) as xs:string external; - -(:~ - : Checks if the database $db or the resource specified by $path exists. false is returned if a database directory has been addressed. - : - : @param $db value of type xs:string - : @return value of type xs:boolean - :) -declare function db:exists($db as xs:string) as xs:boolean external; - -(:~ - : Checks if the database $db or the resource specified by $path exists. false is returned if a database directory has been addressed. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function db:exists($db as xs:string, $path as xs:string) as xs:boolean external; - -(:~ - : Checks if the specified resource in the database $db and the path $path exists, and if it is a binary resource. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:boolean - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:is-raw($db as xs:string, $path as xs:string) as xs:boolean external; - -(:~ - : Checks if the specified resource in the database $db and the path $path exists, and if it is an XML document. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:boolean - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:is-xml($db as xs:string, $path as xs:string) as xs:boolean external; - -(:~ - : Retrieves the content type of a resource in the database $db and the path $path.
The file extension is used to recognize the content-type of a resource stored in the database. Content-type application/xml will be returned for any XML document stored in the database, regardless of its file name extension. - : - : @param $db value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:string - : @error db:open the addressed database does not exist or could not be opened. - :) -declare function db:content-type($db as xs:string, $path as xs:string) as xs:string external; diff --git a/packages.src/basex-9.7/fetch.xqm b/packages.src/basex-9.7/fetch.xqm deleted file mode 100644 index e674e46..0000000 --- a/packages.src/basex-9.7/fetch.xqm +++ /dev/null @@ -1,94 +0,0 @@ -(:~ - : This XQuery Module provides simple functions to fetch the content of resources identified by URIs. Resources can be stored locally or remotely and e.g. use the file:// or http:// scheme. If more control over HTTP requests is required, the HTTP Client Module can be used. With the HTML Module, retrieved HTML documents can be converted to XML. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Fetch_Module - :) -module namespace fetch = "http://basex.org/modules/fetch"; - -(:~ - : Fetches the resource referred to by the given URI and returns it as lazy xs:base64Binary item. - : - : @param $uri value of type xs:string - : @return value of type xs:base64Binary - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - :) -declare function fetch:binary($uri as xs:string) as xs:base64Binary external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $uri value of type xs:string - : @return value of type xs:string - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - : @error fetch:encoding the specified encoding is not supported, or unknown. - :) -declare function fetch:text($uri as xs:string) as xs:string external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $uri value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:string - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - : @error fetch:encoding the specified encoding is not supported, or unknown. - :) -declare function fetch:text($uri as xs:string, $encoding as xs:string) as xs:string external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $uri value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @return value of type xs:string - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - : @error fetch:encoding the specified encoding is not supported, or unknown. - :) -declare function fetch:text($uri as xs:string, $encoding as xs:string, $fallback as xs:boolean) as xs:string external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as document node.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case.
The function is different to fn:doc in various aspects:
  • As it is non-deterministic, a new document node will be created by each call of this function.
  • A document created by this function will be garbage-collected as soon as it is not referenced anymore.
  • URIs will not be resolved against existing databases. As a result, it will not trigger any locks (see limitations of database locking for more details).
- : - : @param $uri value of type xs:string - : @return value of type document-node() - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - :) -declare function fetch:xml($uri as xs:string) as document-node() external; - -(:~ - : Fetches the resource referred to by the given $uri and returns it as document node.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case.
The function is different to fn:doc in various aspects:
  • As it is non-deterministic, a new document node will be created by each call of this function.
  • A document created by this function will be garbage-collected as soon as it is not referenced anymore.
  • URIs will not be resolved against existing databases. As a result, it will not trigger any locks (see limitations of database locking for more details).
- : - : @param $uri value of type xs:string - : @param $options value of type map(*)? - : @return value of type document-node() - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - :) -declare function fetch:xml($uri as xs:string, $options as map(*)?) as document-node() external; - -(:~ - : Parses binary $data and returns it as document node.
In contrast to fn:parse-xml, which expects an XQuery string, the input of this function can be arbitrarily encoded. The encoding will be derived from the XML declaration or (in case of UTF16 or UTF32) from the first bytes of the input.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case. - : - : @param $data value of type xs:base64Binary - : @return value of type document-node() - :) -declare function fetch:xml-binary($data as xs:base64Binary) as document-node() external; - -(:~ - : Parses binary $data and returns it as document node.
In contrast to fn:parse-xml, which expects an XQuery string, the input of this function can be arbitrarily encoded. The encoding will be derived from the XML declaration or (in case of UTF16 or UTF32) from the first bytes of the input.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case. - : - : @param $data value of type xs:base64Binary - : @param $options value of type map(*)? - : @return value of type document-node() - :) -declare function fetch:xml-binary($data as xs:base64Binary, $options as map(*)?) as document-node() external; - -(:~ - : Returns the content-type (also called mime-type) of the resource specified by $uri:
  • If a remote resource is addressed, the request header will be evaluated.
  • If the addressed resource is locally stored, the content-type will be guessed based on the file extension.
- : - : @param $uri value of type xs:string - : @return value of type xs:string - : @error fetch:open the URI could not be resolved, or the resource could not be retrieved. - :) -declare function fetch:content-type($uri as xs:string) as xs:string external; diff --git a/packages.src/basex-9.7/file.xqm b/packages.src/basex-9.7/file.xqm deleted file mode 100644 index 4dcdb95..0000000 --- a/packages.src/basex-9.7/file.xqm +++ /dev/null @@ -1,639 +0,0 @@ -(:~ - : This XQuery Module contains functions related to file system operations, such as listing, reading, or writing files. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/File_Module - :) -module namespace file = "http://expath.org/ns/file"; -declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization"; - -(:~ - : Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether sub-directories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
- : - : @param $dir value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:no-dir the specified path does not point to a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:list($dir as xs:string) as xs:string* external; - -(:~ - : Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether sub-directories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
- : - : @param $dir value of type xs:string - : @param $recursive value of type xs:boolean - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:no-dir the specified path does not point to a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:list($dir as xs:string, $recursive as xs:boolean) as xs:string* external; - -(:~ - : Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether sub-directories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
- : - : @param $dir value of type xs:string - : @param $recursive value of type xs:boolean - : @param $pattern value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:no-dir the specified path does not point to a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:list($dir as xs:string, $recursive as xs:boolean, $pattern as xs:string) as xs:string* external; - -(:~ - : Returns the full paths to all files and directories found in the specified $dir.
The inverse function is file:parent. The related function file:list returns relative file paths. - : - : @param $dir value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:no-dir the specified path does not point to a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:children($dir as xs:string) as xs:string* external; - -(:~ - : Returns the full paths to all files and directories found in the specified $dir and its sub-directories.
. The related function file:list returns relative file paths. - : - : @param $dir value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:no-dir the specified path does not point to a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:descendants($dir as xs:string) as xs:string* external; - -(:~ - : Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file. - : - : @param $path value of type xs:string - : @return value of type xs:base64Binary - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset or length is negative, or the chosen values would exceed the file bounds. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-binary($path as xs:string) as xs:base64Binary external; - -(:~ - : Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file. - : - : @param $path value of type xs:string - : @param $offset value of type xs:integer - : @return value of type xs:base64Binary - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset or length is negative, or the chosen values would exceed the file bounds. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-binary($path as xs:string, $offset as xs:integer) as xs:base64Binary external; - -(:~ - : Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file. - : - : @param $path value of type xs:string - : @param $offset value of type xs:integer - : @param $length value of type xs:integer - : @return value of type xs:base64Binary - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset or length is negative, or the chosen values would exceed the file bounds. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-binary($path as xs:string, $offset as xs:integer, $length as xs:integer) as xs:base64Binary external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $path value of type xs:string - : @return value of type xs:string - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text($path as xs:string) as xs:string external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:string - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text($path as xs:string, $encoding as xs:string) as xs:string external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @return value of type xs:string - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text($path as xs:string, $encoding as xs:string, $fallback as xs:boolean) as xs:string external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string) as xs:string* external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string, $encoding as xs:string) as xs:string* external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string, $encoding as xs:string, $fallback as xs:boolean) as xs:string* external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @param $offset value of type xs:integer - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string, $encoding as xs:string, $fallback as xs:boolean, $offset as xs:integer) as xs:string* external; - -(:~ - : Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

- : - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @param $fallback value of type xs:boolean - : @param $offset value of type xs:integer - : @param $length value of type xs:integer - : @return value of type xs:string* - : @error file:not-found the specified file does not exist. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:read-text-lines($path as xs:string, $encoding as xs:string, $fallback as xs:boolean, $offset as xs:integer, $length as xs:integer) as xs:string* external; - -(:~ - : Creates the directory specified by $dir if it does not already exist. Non-existing parent directories will be created as well.
- : - : @param $dir value of type xs:string - : @error file:exists the specified target exists, but is no directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:create-dir($dir as xs:string) as empty-sequence() external; - -(:~ - : Creates a new temporary directory that did not exist before this function was called, and returns its full file path. The directory name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the directory will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories. - : - : @param $prefix value of type xs:string - : @param $suffix value of type xs:string - : @return value of type xs:string - : @error file:no-dir the specified directory points to a file. - : @error file:io-error the directory could not be created. - :) -declare function file:create-temp-dir($prefix as xs:string, $suffix as xs:string) as xs:string external; - -(:~ - : Creates a new temporary directory that did not exist before this function was called, and returns its full file path. The directory name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the directory will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories. - : - : @param $prefix value of type xs:string - : @param $suffix value of type xs:string - : @param $dir value of type xs:string - : @return value of type xs:string - : @error file:no-dir the specified directory points to a file. - : @error file:io-error the directory could not be created. - :) -declare function file:create-temp-dir($prefix as xs:string, $suffix as xs:string, $dir as xs:string) as xs:string external; - -(:~ - : Creates a new temporary file that did not exist before this function was called, and returns its full file path. The file name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the file will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories. - : - : @param $prefix value of type xs:string - : @param $suffix value of type xs:string - : @return value of type xs:string - : @error file:no-dir the specified directory points to a file. - : @error file:io-error the directory could not be created. - :) -declare function file:create-temp-file($prefix as xs:string, $suffix as xs:string) as xs:string external; - -(:~ - : Creates a new temporary file that did not exist before this function was called, and returns its full file path. The file name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the file will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories. - : - : @param $prefix value of type xs:string - : @param $suffix value of type xs:string - : @param $dir value of type xs:string - : @return value of type xs:string - : @error file:no-dir the specified directory points to a file. - : @error file:io-error the directory could not be created. - :) -declare function file:create-temp-file($prefix as xs:string, $suffix as xs:string, $dir as xs:string) as xs:string external; - -(:~ - : Recursively deletes a file or directory specified by $path.
The optional parameter $recursive specifies whether sub-directories will be deleted, too.
- : - : @param $path value of type xs:string - : @error file:not-found the specified path does not exist. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:delete($path as xs:string) as empty-sequence() external; - -(:~ - : Recursively deletes a file or directory specified by $path.
The optional parameter $recursive specifies whether sub-directories will be deleted, too.
- : - : @param $path value of type xs:string - : @param $recursive value of type xs:boolean - : @error file:not-found the specified path does not exist. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:delete($path as xs:string, $recursive as xs:boolean) as empty-sequence() external; - -(:~ - : Writes a serialized sequence of items to the specified file. If the file already exists, it will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= "div" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { "method" : "xml" , "cdata-section-elements" : "div" , .. . } 
- : - : @param $path value of type xs:string - : @param $items value of type item()* - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write($path as xs:string, $items as item()*) as empty-sequence() external; - -(:~ - : Writes a serialized sequence of items to the specified file. If the file already exists, it will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= "div" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { "method" : "xml" , "cdata-section-elements" : "div" , .. . } 
- : - : @param $path value of type xs:string - : @param $items value of type item()* - : @param $params value of type item() - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write($path as xs:string, $items as item()*, $params as item()) as empty-sequence() external; - -(:~ - : Writes a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file already exists, it will be overwritten.
If $offset is specified, data will be written at this file position. An existing file may be resized by that operation. - : - : @param $path value of type xs:string - : @param $value value of type xs:anyAtomicType - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset is negative, or it exceeds the current file size. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-binary($path as xs:string, $value as xs:anyAtomicType) as empty-sequence() external; - -(:~ - : Writes a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file already exists, it will be overwritten.
If $offset is specified, data will be written at this file position. An existing file may be resized by that operation. - : - : @param $path value of type xs:string - : @param $value value of type xs:anyAtomicType - : @param $offset value of type xs:integer - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:out-of-range the offset is negative, or it exceeds the current file size. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-binary($path as xs:string, $value as xs:anyAtomicType, $offset as xs:integer) as empty-sequence() external; - -(:~ - : Writes a string to the specified file. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $value value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-text($path as xs:string, $value as xs:string) as empty-sequence() external; - -(:~ - : Writes a string to the specified file. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $value value of type xs:string - : @param $encoding value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-text($path as xs:string, $value as xs:string, $encoding as xs:string) as empty-sequence() external; - -(:~ - : Writes a sequence of strings to the specified file, each followed by the system specific newline character. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $values value of type xs:string* - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-text-lines($path as xs:string, $values as xs:string*) as empty-sequence() external; - -(:~ - : Writes a sequence of strings to the specified file, each followed by the system specific newline character. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $values value of type xs:string* - : @param $encoding value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:write-text-lines($path as xs:string, $values as xs:string*, $encoding as xs:string) as empty-sequence() external; - -(:~ - : Appends a serialized sequence of items to the specified file. If the file does not exists, a new file is created.
- : - : @param $path value of type xs:string - : @param $items value of type item()* - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append($path as xs:string, $items as item()*) as empty-sequence() external; - -(:~ - : Appends a serialized sequence of items to the specified file. If the file does not exists, a new file is created.
- : - : @param $path value of type xs:string - : @param $items value of type item()* - : @param $params value of type item() - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append($path as xs:string, $items as item()*, $params as item()) as empty-sequence() external; - -(:~ - : Appends a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file does not exists, a new one is created.
- : - : @param $path value of type xs:string - : @param $value value of type xs:anyAtomicType - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-binary($path as xs:string, $value as xs:anyAtomicType) as empty-sequence() external; - -(:~ - : Appends a string to a file specified by $path. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $value value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-text($path as xs:string, $value as xs:string) as empty-sequence() external; - -(:~ - : Appends a string to a file specified by $path. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $value value of type xs:string - : @param $encoding value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-text($path as xs:string, $value as xs:string, $encoding as xs:string) as empty-sequence() external; - -(:~ - : Appends a sequence of strings to the specified file, each followed by the system specific newline character. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $values value of type xs:string* - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-text-lines($path as xs:string, $values as xs:string*) as empty-sequence() external; - -(:~ - : Appends a sequence of strings to the specified file, each followed by the system specific newline character. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
- : - : @param $path value of type xs:string - : @param $values value of type xs:string* - : @param $encoding value of type xs:string - : @error file:no-dir the parent of specified path is no directory. - : @error file:is-dir the specified path is a directory. - : @error file:unknown-encoding the specified encoding is not supported, or unknown. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:append-text-lines($path as xs:string, $values as xs:string*, $encoding as xs:string) as empty-sequence() external; - -(:~ - : Copies a file or directory specified by $source to the file or directory specified by $target. If the target file already exists, it will be overwritten. No operation will be performed if the source and target path are equal.
- : - : @param $source value of type xs:string - : @param $target value of type xs:string - : @error file:not-found the specified source does not exist. - : @error file:exists the specified source is a directory and the target is a file. - : @error file:no-dir the parent of the specified target is no directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:copy($source as xs:string, $target as xs:string) as empty-sequence() external; - -(:~ - : Moves or renames the file or directory specified by $source to the path specified by $target. If the target file already exists, it will be overwritten. No operation will be performed if the source and target path are equal.
- : - : @param $source value of type xs:string - : @param $target value of type xs:string - : @error file:not-found the specified source does not exist. - : @error file:exists the specified source is a directory and the target is a file. - : @error file:no-dir the parent of the specified target is no directory. - : @error file:io-error the operation fails for some other reason. - :) -declare function file:move($source as xs:string, $target as xs:string) as empty-sequence() external; - -(:~ - : Returns an xs:boolean indicating whether a file or directory specified by $path exists in the file system.
- : - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function file:exists($path as xs:string) as xs:boolean external; - -(:~ - : Returns an xs:boolean indicating whether the argument $path points to an existing directory.
- : - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function file:is-dir($path as xs:string) as xs:boolean external; - -(:~ - : Returns an xs:boolean indicating whether the argument $path is absolute.
The behavior of this function depends on the operating system: On Windows, an absolute path starts with the drive letter and a colon, whereas on Linux it starts with a slash. - : - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function file:is-absolute($path as xs:string) as xs:boolean external; - -(:~ - : Returns an xs:boolean indicating whether the argument $path points to an existing file.
- : - : @param $path value of type xs:string - : @return value of type xs:boolean - :) -declare function file:is-file($path as xs:string) as xs:boolean external; - -(:~ - : Retrieves the timestamp of the last modification of the file or directory specified by $path.
- : - : @param $path value of type xs:string - : @return value of type xs:dateTime - : @error file:not-found the specified path does not exist. - :) -declare function file:last-modified($path as xs:string) as xs:dateTime external; - -(:~ - : Returns the size, in bytes, of the file specified by $path, or 0 for directories.
- : - : @param $path value of type xs:string - : @return value of type xs:integer - : @error file:not-found the specified file does not exist. - :) -declare function file:size($path as xs:string) as xs:integer external; - -(:~ - : Returns the name of a file or directory specified by $path. An empty string is returned if the path points to the root directory. - : - : @param $path value of type xs:string - : @return value of type xs:string - :) -declare function file:name($path as xs:string) as xs:string external; - -(:~ - : Returns the absolute path to the parent directory of a file or directory specified by $path. An empty sequence is returned if the path points to a root directory.
The inverse function is file:children.
- : - : @param $path value of type xs:string - : @return value of type xs:string? - :) -declare function file:parent($path as xs:string) as xs:string? external; - -(:~ - : Transforms the $path argument to its native representation on the operating system.
- : - : @param $path value of type xs:string - : @return value of type xs:string - : @error file:not-found the specified file does not exist. - : @error file:io-error the specified path cannot be transformed to its native representation. - :) -declare function file:path-to-native($path as xs:string) as xs:string external; - -(:~ - : Transforms the $path argument to an absolute operating system path.
If the path is relative, and if an absolute $base path is specified, it will be resolved against this path. - : - : @param $path value of type xs:string - : @return value of type xs:string - : @error file:is-relative the specified base path is relative. - :) -declare function file:resolve-path($path as xs:string) as xs:string external; - -(:~ - : Transforms the $path argument to an absolute operating system path.
If the path is relative, and if an absolute $base path is specified, it will be resolved against this path. - : - : @param $path value of type xs:string - : @param $base value of type xs:string - : @return value of type xs:string - : @error file:is-relative the specified base path is relative. - :) -declare function file:resolve-path($path as xs:string, $base as xs:string) as xs:string external; - -(:~ - : Transforms the path specified by $path into a URI with the file:// scheme.
- : - : @param $path value of type xs:string - : @return value of type xs:string - :) -declare function file:path-to-uri($path as xs:string) as xs:string external; - -(:~ - : Returns the directory separator used by the operating system, such as / or \.
- : - : @return value of type xs:string - :) -declare function file:dir-separator() as xs:string external; - -(:~ - : Returns the path separator used by the operating system, such as ; or :.
- : - : @return value of type xs:string - :) -declare function file:path-separator() as xs:string external; - -(:~ - : Returns the line separator used by the operating system, such as &#10;, &#13;&#10; or &#13;.
- : - : @return value of type xs:string - :) -declare function file:line-separator() as xs:string external; - -(:~ - : Returns the system’s default temporary-file directory.
- : - : @return value of type xs:string - :) -declare function file:temp-dir() as xs:string external; - -(:~ - : Returns the current working directory. This function returns the same result as the function call file:resolve-path(""). - : - : @return value of type xs:string - :) -declare function file:current-dir() as xs:string external; - -(:~ - : Returns the parent directory of the static base URI. If the Base URI property is undefined, the empty sequence is returned. - If a static base URI exists, and if points to a local file path, this function returns the same result as the expression file:parent(static-base-uri()). - : - : @return value of type xs:string? - :) -declare function file:base-dir() as xs:string? external; diff --git a/packages.src/basex-9.7/ft.xqm b/packages.src/basex-9.7/ft.xqm deleted file mode 100644 index bf5410a..0000000 --- a/packages.src/basex-9.7/ft.xqm +++ /dev/null @@ -1,168 +0,0 @@ -(:~ - : This XQuery Module extends the Full-Text features of BaseX: The index can be directly accessed, full-text results can be marked with additional elements, or the relevant parts can be extracted. Moreover, the score value, which is generated by the contains text expression, can be explicitly requested from items. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Full-Text_Module - :) -module namespace ft = "http://basex.org/modules/ft"; - -(:~ - : Returns all text nodes from the full-text index of the database $db that contain the specified $terms.
The options used for tokenizing the input and building the full-text will also be applied to the search terms. As an example, if the index terms have been stemmed, the search string will be stemmed as well.

The $options argument can be used to control full-text processing. The following options are supported (the introduction on Full-Text processing gives you equivalent expressions in the XQuery Full-Text notation):

  • mode: determines the mode how tokens are searched. Allowed values are any, any word, all, all words, and phrase. any is the default search mode.
  • fuzzy: turns fuzzy querying on or off. Allowed values are true and false. By default, fuzzy querying is turned off.
  • wildcards: turns wildcard querying on or off. Allowed values are true and false. By default, wildcard querying is turned off.
  • ordered: requires that all tokens occur in the order in which they are specified. Allowed values are true and false. The default is false.
  • content: specifies that the matched tokens need to occur at the beginning or end of a searched string, or need to cover the entire string. Allowed values are start, end, and entire. By default, the option is turned off.
  • scope: defines the scope in which tokens must be located. The option has following sub options:
    • same: can be set to true or false. It specifies if tokens need to occur in the same or different units.
    • unit: can be sentence or paragraph. It specifies the unit for finding tokens.
  • window: sets up a window in which all tokens must be located. By default, the option is turned off. It has following sub options:
    • size: specifies the size of the window in terms of units.
    • unit: can be sentences, sentences or paragraphs. The default is words.
  • distance: specifies the distance in which tokens must occur. By default, the option is turned off. It has following sub options:
    • min: specifies the minimum distance in terms of units. The default is 0.
    • max: specifies the maximum distance in terms of units. The default is ∞.
    • unit: can be words, sentences or paragraphs. The default is words.
- : - : @param $db value of type xs:string - : @param $terms value of type item()* - : @return value of type text()* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - : @error ft:options the fuzzy and wildcard option cannot be both specified. - :) -declare function ft:search($db as xs:string, $terms as item()*) as text()* external; - -(:~ - : Returns all text nodes from the full-text index of the database $db that contain the specified $terms.
The options used for tokenizing the input and building the full-text will also be applied to the search terms. As an example, if the index terms have been stemmed, the search string will be stemmed as well.

The $options argument can be used to control full-text processing. The following options are supported (the introduction on Full-Text processing gives you equivalent expressions in the XQuery Full-Text notation):

  • mode: determines the mode how tokens are searched. Allowed values are any, any word, all, all words, and phrase. any is the default search mode.
  • fuzzy: turns fuzzy querying on or off. Allowed values are true and false. By default, fuzzy querying is turned off.
  • wildcards: turns wildcard querying on or off. Allowed values are true and false. By default, wildcard querying is turned off.
  • ordered: requires that all tokens occur in the order in which they are specified. Allowed values are true and false. The default is false.
  • content: specifies that the matched tokens need to occur at the beginning or end of a searched string, or need to cover the entire string. Allowed values are start, end, and entire. By default, the option is turned off.
  • scope: defines the scope in which tokens must be located. The option has following sub options:
    • same: can be set to true or false. It specifies if tokens need to occur in the same or different units.
    • unit: can be sentence or paragraph. It specifies the unit for finding tokens.
  • window: sets up a window in which all tokens must be located. By default, the option is turned off. It has following sub options:
    • size: specifies the size of the window in terms of units.
    • unit: can be sentences, sentences or paragraphs. The default is words.
  • distance: specifies the distance in which tokens must occur. By default, the option is turned off. It has following sub options:
    • min: specifies the minimum distance in terms of units. The default is 0.
    • max: specifies the maximum distance in terms of units. The default is ∞.
    • unit: can be words, sentences or paragraphs. The default is words.
- : - : @param $db value of type xs:string - : @param $terms value of type item()* - : @param $options value of type map(*)? - : @return value of type text()* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - : @error ft:options the fuzzy and wildcard option cannot be both specified. - :) -declare function ft:search($db as xs:string, $terms as item()*, $options as map(*)?) as text()* external; - -(:~ - : Checks if the specified $input items contain the specified $terms.
The function does the same as the Full-Text expression contains text, but options can be specified more dynamically. The $options are the same as for ft:search, and the following ones in addition:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.
- : - : @param $input value of type item()* - : @param $terms value of type item()* - : @return value of type xs:boolean - : @error ft:options specified options are conflicting. - :) -declare function ft:contains($input as item()*, $terms as item()*) as xs:boolean external; - -(:~ - : Checks if the specified $input items contain the specified $terms.
The function does the same as the Full-Text expression contains text, but options can be specified more dynamically. The $options are the same as for ft:search, and the following ones in addition:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.
- : - : @param $input value of type item()* - : @param $terms value of type item()* - : @param $options value of type map(*)? - : @return value of type xs:boolean - : @error ft:options specified options are conflicting. - :) -declare function ft:contains($input as item()*, $terms as item()*, $options as map(*)?) as xs:boolean external; - -(:~ - : Puts a marker element around the resulting $nodes of a full-text request.
The default name of the marker element is mark. An alternative name can be chosen via the optional $name argument.
Please note that:
  • The full-text expression that computes the token positions must be specified as argument of the ft:mark() function, as all position information is lost in subsequent processing steps. You may need to specify more than one full-text expression if you want to use the function in a FLWOR expression, as shown in Example 2.
  • The supplied node must be a Database Node. As shown in Example 3, update or transform can be utilized to convert a fragment to the required internal representation.
- : - : @param $nodes value of type node()* - : @return value of type node()* - :) -declare function ft:mark($nodes as node()*) as node()* external; - -(:~ - : Puts a marker element around the resulting $nodes of a full-text request.
The default name of the marker element is mark. An alternative name can be chosen via the optional $name argument.
Please note that:
  • The full-text expression that computes the token positions must be specified as argument of the ft:mark() function, as all position information is lost in subsequent processing steps. You may need to specify more than one full-text expression if you want to use the function in a FLWOR expression, as shown in Example 2.
  • The supplied node must be a Database Node. As shown in Example 3, update or transform can be utilized to convert a fragment to the required internal representation.
- : - : @param $nodes value of type node()* - : @param $name value of type xs:string - : @return value of type node()* - :) -declare function ft:mark($nodes as node()*, $name as xs:string) as node()* external; - -(:~ - : Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark. - : - : @param $nodes value of type node()* - : @return value of type node()* - :) -declare function ft:extract($nodes as node()*) as node()* external; - -(:~ - : Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark. - : - : @param $nodes value of type node()* - : @param $name value of type xs:string - : @return value of type node()* - :) -declare function ft:extract($nodes as node()*, $name as xs:string) as node()* external; - -(:~ - : Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark. - : - : @param $nodes value of type node()* - : @param $name value of type xs:string - : @param $length value of type xs:integer - : @return value of type node()* - :) -declare function ft:extract($nodes as node()*, $name as xs:string, $length as xs:integer) as node()* external; - -(:~ - : Returns the number of occurrences of the search terms specified in a full-text expression. - : - : @param $nodes value of type node()* - : @return value of type xs:integer - :) -declare function ft:count($nodes as node()*) as xs:integer external; - -(:~ - : Returns the score values (0.0 - 1.0) that have been attached to the specified items. 0 is returned a value if no score was attached. - : - : @param $item value of type item()* - : @return value of type xs:double* - :) -declare function ft:score($item as item()*) as xs:double* external; - -(:~ - : Returns all full-text tokens stored in the index of the database $db, along with their numbers of occurrences.
If $prefix is specified, the returned nodes will be refined to the strings starting with that prefix. The prefix will be tokenized according to the full-text used for creating the index. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the full-text index is not available. - :) -declare function ft:tokens($db as xs:string) as element(value)* external; - -(:~ - : Returns all full-text tokens stored in the index of the database $db, along with their numbers of occurrences.
If $prefix is specified, the returned nodes will be refined to the strings starting with that prefix. The prefix will be tokenized according to the full-text used for creating the index. - : - : @param $db value of type xs:string - : @param $prefix value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the full-text index is not available. - :) -declare function ft:tokens($db as xs:string, $prefix as xs:string) as element(value)* external; - -(:~ - : Tokenizes the given $string, using the current default full-text options or the $options specified as second argument, and returns a sequence with the tokenized string. The following options are available:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.

The $options argument can be used to control full-text processing.

- : - : @param $string value of type xs:string? - : @return value of type xs:string* - :) -declare function ft:tokenize($string as xs:string?) as xs:string* external; - -(:~ - : Tokenizes the given $string, using the current default full-text options or the $options specified as second argument, and returns a sequence with the tokenized string. The following options are available:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.

The $options argument can be used to control full-text processing.

- : - : @param $string value of type xs:string? - : @param $options value of type map(*)? - : @return value of type xs:string* - :) -declare function ft:tokenize($string as xs:string?, $options as map(*)?) as xs:string* external; - -(:~ - : Normalizes the given $string, using the current default full-text options or the $options specified as second argument. The function expects the same arguments as ft:tokenize. - : - : @param $string value of type xs:string? - : @return value of type xs:string - :) -declare function ft:normalize($string as xs:string?) as xs:string external; - -(:~ - : Normalizes the given $string, using the current default full-text options or the $options specified as second argument. The function expects the same arguments as ft:tokenize. - : - : @param $string value of type xs:string? - : @param $options value of type map(*)? - : @return value of type xs:string - :) -declare function ft:normalize($string as xs:string?, $options as map(*)?) as xs:string external; diff --git a/packages.src/basex-9.7/geo.xqm b/packages.src/basex-9.7/geo.xqm deleted file mode 100644 index 708a3d0..0000000 --- a/packages.src/basex-9.7/geo.xqm +++ /dev/null @@ -1,471 +0,0 @@ -(:~ - : This XQuery Module contains functions that may be applied to geometry data conforming to the Open Geospatial Consortium (OGC) Simple Feature (SF) data model. It is based on the EXPath Geo Module and uses the JTS library. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Geo_Module - :) -module namespace geo = "http://expath.org/ns/geo"; -declare namespace experr = "http://expath.org/ns/error"; - -(:~ - : Returns the dimension of the given geometry $geometry. - : - : @param $geometry value of type element(*) - : @return value of type xs:integer - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:dimension($geometry as element(*)) as xs:integer external; - -(:~ - : Returns the name of the geometry type of given geometry $geometry, if the geometry is not recognized with an error massage. - : - : @param $geometry value of type element(*) - : @return value of type xs:QName - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:geometry-type($geometry as element(*)) as xs:QName external; - -(:~ - : Returns the ID of the Spatial Reference System used by the given geometry $geometry. Spatial Reference System information is supported in the simple way defined in the SFS. A Spatial Reference System ID (SRID) is present in each Geometry object. Geometry provides basic accessor operations for this field, but no others. The SRID is represented as an integer (based on the OpenGIS Simple Features Specifications For SQL).
Here is a difference between the EXPath Geo Module and the implementation in BaseX, since the specification return the URI. - : - : @param $geometry value of type element(*) - : @return value of type xs:integer - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:srid($geometry as element(*)) as xs:integer external; - -(:~ - : Returns the gml:Envelope of the given geometry $geometry. The envelope is the minimum bounding box of this geometry. If this Geometry is the empty geometry, returns an empty Point. If the Geometry is a point, returns a non-empty Point. Otherwise, returns a Polygon whose points are (minx, miny), (maxx, miny), (maxx, maxy), (minx, maxy), (minx, miny). - : - : @param $geometry value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:envelope($geometry as element(*)) as element(*) external; - -(:~ - : Returns the WKT (Well-known Text) representation of the given geometry $geometry. The envelope is the minimum bounding box of this geometry - : - : @param $geometry value of type element(*) - : @return value of type xs:string - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:as-text($geometry as element(*)) as xs:string external; - -(:~ - : Returns the WKB (Well-known Binary) representation of the given geometry $geometry. - : - : @param $geometry value of type element(*) - : @return value of type xs:base64Binary - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:as-binary($geometry as element(*)) as xs:base64Binary external; - -(:~ - : Returns whether the given geometry is simple $geometry and does not have has no anomalous geometric points (ie. the geometry does not self-intersect and does not pass through the same point more than once (may be a ring)). - : - : @param $geometry value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:is-simple($geometry as element(*)) as xs:boolean external; - -(:~ - : Returns the boundary of the given geometry $geometry, in GML 2. The return value is a sequence of either gml:Point or gml:LinearRing elements as a GeometryCollection object. For a Point or MultiPoint, the boundary is the empty geometry, nothing is returned. - : - : @param $geometry value of type element(*) - : @return value of type element(*)? - : @error experr:GEO0001 the given element is not recognized as a valid geometry. - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:boundary($geometry as element(*)) as element(*)? external; - -(:~ - : Returns the number of geometry in a geometry-collection $geometry, in GML. For the geometries which are not a collection, it returns the instant value 1.
This function is implemented wider than the specification and accepts all types of geometries, while the specification limits it to the collection types (MultiPoint, MultiPolygon, ...). - : - : @param $geometry value of type element(*) - : @return value of type xs:integer - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:num-geometries($geometry as element(*)) as xs:integer external; - -(:~ - : Returns the Nth geometry in geometry-collection $geometry, in GML. For the geometries which are not a collection, it returns the geometry if geoNumber $geoNumber is 1.
This function is implemented wider than the specification and accepts all types of geometries, while the specification limits it to the collection types (MultiPoint, MultiPolygon, ...). - : - : @param $geometry value of type element(*) - : @param $geoNumber value of type xs:integer - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0004 the the input index of geometry is out of range. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:geometry-n($geometry as element(*), $geoNumber as xs:integer) as element(*) external; - -(:~ - : Returns the length of the geometry $geometry. If the geometry is a point, zero value will be returned. - : - : @param $geometry value of type element(*) - : @return value of type xs:double - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:length($geometry as element(*)) as xs:double external; - -(:~ - : Returns integer value of number of the points in the given geometry$geometry. It can be used not only for Lines, also any other geometry types, like MultiPolygon. For Point geometry it will return 1.
This is an implementation different from the EXPath geo specification, as it limits the input geometry type only to lines. - : - : @param $geometry value of type element(*) - : @return value of type xs:integer - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:num-points($geometry as element(*)) as xs:integer external; - -(:~ - : Returns the area of the given geometry $geometry. For points and line the return value will be zero. - : - : @param $geometry value of type element(*) - : @return value of type xs:double - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:area($geometry as element(*)) as xs:double external; - -(:~ - : Returns the mathematical centroid of the given geometry $geometry, as a gml:Point. Based on the definition, this point is not always on the surface of the geometry $geometry. - : - : @param $geometry value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:centroid($geometry as element(*)) as element(*) external; - -(:~ - : Returns an interior point on the given geometry $geometry, as a gml:Point. It is guaranteed to be on surface. Otherwise, the point may lie on the boundary of the geometry. - : - : @param $geometry value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:point-on-surface($geometry as element(*)) as element(*) external; - -(:~ - : Returns whether geometry1 $geometry1 is spatially equal to $geometry2 $geometry2. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:equals($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether geometry1 $geometry1 is spatially disjoint from $geometry2 $geometry2 (they have no point in common, they do not intersect each other, and the DE-9IM Intersection Matrix for the two geometries is FF*FF****). - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:disjoint($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether geometry1 $geometry1 is spatially intersects $geometry2 $geometry2. This is true if disjoint function of the two geometries returns false. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:intersects($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether geometry1 $geometry1 is spatially touches $geometry2 $geometry2. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:touches($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether geometry1 $geometry1 is spatially crosses $geometry2 $geometry2. It means, if the geometries have some but not all interior points in common. Returns true if the DE-9IM intersection matrix for the two geometries is:

T*T****** (for P/L, P/A, and L/A situations)
T*****T** (for L/P, A/P, and A/L situations)
0******** (for L/L situations).

- : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:crosses($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether geometry1 $geometry1 is spatially within $geometry2 $geometry2. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:within($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether geometry1 $geometry1 spatially contains $geometry2 $geometry2. Returns true if within function of these two geometries also returns true. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:contains($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether geometry1 $geometry1 is spatially overlaps $geometry2 $geometry2. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:overlaps($geometry1 as element(*), $geometry2 as element(*)) as xs:boolean external; - -(:~ - : Returns whether relationships between the boundaries, interiors and exteriors of geometry1 $geometry1 and geometry2 $geometry2 match the pattern specified in intersectionMatrix $geometry2, which should have the length of 9 charachters.
The values in the DE-9IM can be T, F, *, 0, 1, 2 .

- T means the intersection gives a non-empty result.
- F means the intersection gives an empty result.
- * means any result.
- 0, 1, 2 gives the expected dimension of the result (point, curve, surface)

- : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @param $intersectionMatrix value of type xs:string - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0006 the given matrix is invalid. - :) -declare function geo:relate($geometry1 as element(*), $geometry2 as element(*), $intersectionMatrix as xs:string) as xs:boolean external; - -(:~ - : Returns the shortest distance, in the units of the spatial reference system of geometry1 $geometry1, between the geometries, where that distance is the distance between a point on each of the geometries. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type xs:double - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:distance($geometry1 as element(*), $geometry2 as element(*)) as xs:double external; - -(:~ - : Returns polygonal geometry representing the buffer by distance $distance of geometry $geometry a buffer area around this geometry having the given width, in the spatial reference system of geometry. The buffer of a Geometry is the Minkowski sum or difference of the geometry with a disc of radius abs(distance). The buffer is constructed using 8 segments per quadrant to represent curves. - : - : @param $geometry value of type element(*) - : @param $distance value of type xs:double - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:buffer($geometry as element(*), $distance as xs:double) as element(*) external; - -(:~ - : Returns the convex hull geometry of the given geometry $geometry in GML, or the empty sequence. Actually returns the object of smallest dimension possible. - : - : @param $geometry value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:convex-hull($geometry as element(*)) as element(*) external; - -(:~ - : Returns the intersection geometry of geometry1 $geometry1 with geometry2 $geometry2, in GML or empty sequence if there is no intersection of these geometries. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type element(*)? - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:intersection($geometry1 as element(*), $geometry2 as element(*)) as element(*)? external; - -(:~ - : Returns the union geometry of geometry1 $geometry1 with geometry2 $geometry2, in GML. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:union($geometry1 as element(*), $geometry2 as element(*)) as element(*) external; - -(:~ - : Returns the difference geometry of geometry1 $geometry1 with geometry2 $geometry2, in GML, or empty sequence if the difference is empty, as a set of point in geometry1 $geometry1 and not included in geometry2 $geometry2. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type element(*)? - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:difference($geometry1 as element(*), $geometry2 as element(*)) as element(*)? external; - -(:~ - : Returns the symmetric difference geometry of geometry1 $geometry1 with geometry2 $geometry2, in GML, or empty sequence if the difference is empty, as a set of point in one of the geometries and not included in the other. - : - : @param $geometry1 value of type element(*) - : @param $geometry2 value of type element(*) - : @return value of type element(*)? - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:sym-difference($geometry1 as element(*), $geometry2 as element(*)) as element(*)? external; - -(:~ - : Returns the x coordinate of point $point. A point has to have an x coordinate. - : - : @param $point value of type element(*) - : @return value of type xs:double - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:x($point as element(*)) as xs:double external; - -(:~ - : Returns the y coordinate of point $point. If the point does not have the y coordinate, 0 will be returned. - : - : @param $point value of type element(*) - : @return value of type xs:double? - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:y($point as element(*)) as xs:double? external; - -(:~ - : Returns the z coordinate of point $point. If the point does not have the y coordinate, 0 will be returned. - : - : @param $point value of type element(*) - : @return value of type xs:double? - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - :) -declare function geo:z($point as element(*)) as xs:double? external; - -(:~ - : Returns the starting point of the given line $line. $line has to be a single line, LineString or LinearRing. - : - : @param $line value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a line. Other geometries are not accepted. - :) -declare function geo:start-point($line as element(*)) as element(*) external; - -(:~ - : Returns the ending point of the given line $line. $line has to be a single line, LineString or LinearRing. - : - : @param $line value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a line. Other geometries are not accepted. - :) -declare function geo:end-point($line as element(*)) as element(*) external; - -(:~ - : Returns a boolean value that shows the line $line is a closed loop (start point and end point are the same) or not. $line has to be a line, as a geometry, LineString or LinearRing, and MultiLineString. - : - : @param $line value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a line. Other geometries are not accepted. - :) -declare function geo:is-closed($line as element(*)) as xs:boolean external; - -(:~ - : Returns a boolean value that shows the line $line is a ring (closed loop and single) or not. $line has to be a single line, as a geometry, LineString or LinearRing. - : - : @param $line value of type element(*) - : @return value of type xs:boolean - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a line. Other geometries are not accepted. - :) -declare function geo:is-ring($line as element(*)) as xs:boolean external; - -(:~ - : Returns the Nth point in the given line $geometry. $line has to be a single line, as a geometry, LineString or LinearRing. - : - : @param $line value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a line. Other geometries are not accepted. - : @error experr:GEO0004 the the input index of geometry is out of range. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:point-n($line as element(*)) as element(*) external; - -(:~ - : Returns the outer ring of the given polygon $geometry, as a gml:LineString. - : - : @param $polygon value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a polygon. Other geometries are not accepted. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:exterior-ring($polygon as element(*)) as element(*) external; - -(:~ - : Returns the number of interior rings in the given polygon $geometry. - : - : @param $polygon value of type element(*) - : @return value of type xs:integer - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a polygon. Other geometries are not accepted. - :) -declare function geo:num-interior-ring($polygon as element(*)) as xs:integer external; - -(:~ - : Returns the outer ring of the given polygon $geometry, as a gml:LineString. - : - : @param $polygon value of type element(*) - : @return value of type element(*) - : @error experr:GEO0001 the given element(s) is not recognized as a valid geometry (QName). - : @error experr:GEO0002 the given element cannot be read by reader for some reason. - : @error experr:GEO0003 the given element has to be a polygon. Other geometries are not accepted. - : @error experr:GEO0004 the the input index of geometry is out of range. - : @error experr:GEO0005 the output object cannot be written as an element by writer for some reason. - :) -declare function geo:interior-ring-n($polygon as element(*)) as element(*) external; diff --git a/packages.src/basex-9.7/hash.xqm b/packages.src/basex-9.7/hash.xqm deleted file mode 100644 index e0b1483..0000000 --- a/packages.src/basex-9.7/hash.xqm +++ /dev/null @@ -1,41 +0,0 @@ -(:~ - : This XQuery Module provides functions that perform different hash operations. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Hashing_Module - :) -module namespace hash = "http://basex.org/modules/hash"; - -(:~ - : Computes the MD5 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary. - : - : @param $value value of type xs:anyAtomicType - : @return value of type xs:base64Binary - :) -declare function hash:md5($value as xs:anyAtomicType) as xs:base64Binary external; - -(:~ - : Computes the SHA-1 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary. - : - : @param $value value of type xs:anyAtomicType - : @return value of type xs:base64Binary - :) -declare function hash:sha1($value as xs:anyAtomicType) as xs:base64Binary external; - -(:~ - : Computes the SHA-256 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary. - : - : @param $value value of type xs:anyAtomicType - : @return value of type xs:base64Binary - :) -declare function hash:sha256($value as xs:anyAtomicType) as xs:base64Binary external; - -(:~ - : Computes the hash of the given $value, using the specified $algorithm. The specified values may be of type xs:string, xs:base64Binary, or xs:hexBinary.
The following three algorihms are supported: MD5, SHA-1, and SHA-256. - : - : @param $value value of type xs:anyAtomicType - : @param $algorithm value of type xs:string - : @return value of type xs:base64Binary - : @error hash:algorithm the specified hashing algorithm is unknown. - :) -declare function hash:hash($value as xs:anyAtomicType, $algorithm as xs:string) as xs:base64Binary external; diff --git a/packages.src/basex-9.7/hof.xqm b/packages.src/basex-9.7/hof.xqm deleted file mode 100644 index 8cbc6eb..0000000 --- a/packages.src/basex-9.7/hof.xqm +++ /dev/null @@ -1,90 +0,0 @@ -(:~ - : - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Higher-Order_Functions_Module - :) -module namespace hof = "http://basex.org/modules/hof"; - -(:~ - : Works the same as fn:fold-left, but does not need a seed, because the sequence must be non-empty. - : - : @param $seq value of type item()+ - : @param $f value of type function(item()* - : @param item() value of type - : @return value of type item()* - :) -declare function hof:fold-left1($seq as item()+, $f as function(item()*, item()) as item()*) as item()* external; - -(:~ - : Applies the predicate function $pred to $start. If the result is false, $f is invoked with the start value – or, subsequently, with the result of this function – until the predicate function returns true(). - : - : @param $pred value of type function(item()* - : @return value of type item()* - :) -declare function hof:until($pred as function(item()*) as xs:boolean, $f as function(item()*) as item()*, $start as item()*) as item()* external; - -(:~ - : This function is similar to fn:fold-left, but it returns a list of successive reduced values from the left. It is equivalent to:
  declare function hof:scan-left ( $ seq , $ acc , $ f ) { if ( empty ( $ seq )) then $ acc else ( $ acc , hof:scan-left ( tail ( $ seq ), $ f ( $ acc , head ( $ seq )), $ f ) ) }; 
- : - : @param $seq value of type item()* - : @param $start value of type item()* - : @param $f value of type function(item()* - : @param item() value of type - : @return value of type item()* - :) -declare function hof:scan-left($seq as item()*, $start as item()*, $f as function(item()*, item()) as item()*) as item()* external; - -(:~ - : The function returns items of $seq as long as the predicate $pred is satisfied. It is equivalent to:
  declare function hof:take-while ( $ seq , $ pred ) { if ( empty ( $ seq ) or not ( $ pred ( head( $ seq )))) then () else ( head ( $ seq ), hof:take-while ( tail ( $ seq ), $ pred ) ) }; 
- : - : @param $seq value of type item()* - : @param $pred value of type function(item() - : @return value of type item()* - :) -declare function hof:take-while($seq as item()*, $pred as function(item()) as xs:boolean) as item()* external; - -(:~ - : The function skips all items of $seq until the predicate $pred is not satisfied anymore. It is equivalent to:
  declare function hof:drop-while ( $ seq , $ pred ) { if ( $ pred ( head( $ seq ))) then ( hof:drop-while ( tail ( $ seq ), $ pred ) ) else ( $ seq ) }; 
- : - : @param $seq value of type item()* - : @param $pred value of type function(item() - : @return value of type item()* - :) -declare function hof:drop-while($seq as item()*, $pred as function(item()) as xs:boolean) as item()* external; - -(:~ - : Returns the $k items in $seq that are greatest when sorted by the result of $f applied to the item. The function is a much more efficient implementation of the following scheme:
  ( for $ x in $ seq order by $ sort-key ( $ x ) descending return $ x )[ position () <= $ k ] 
- : - : @param $seq value of type item()* - : @param $sort-key value of type function(item() - : @return value of type item()* - :) -declare function hof:top-k-by($seq as item()*, $sort-key as function(item()) as item(), $k as xs:integer) as item()* external; - -(:~ - : Returns the $k items in $seq that are greatest when sorted in the order of the less-than predicate $lt. The function is a general version of hof:top-k-by($seq, $sort-key, $k). - : - : @param $seq value of type item()* - : @param $lt value of type function(item() - : @param item() value of type - : @return value of type item()* - :) -declare function hof:top-k-with($seq as item()*, $lt as function(item(), item()) as xs:boolean, $k as xs:integer) as item()* external; - -(:~ - : Returns its argument unchanged. This function isn’t useful on its own, but can be used as argument to other higher-order functions. - : - : @param $expr value of type item()* - : @return value of type item()* - :) -declare function hof:id($expr as item()*) as item()* external; - -(:~ - : Returns its first argument unchanged and ignores the second. This function isn’t useful on its own, but can be used as argument to other higher-order functions, e.g. when a function combining two values is expected and one only wants to retain the left one. - : - : @param $expr value of type item()* - : @param $ignored value of type item()* - : @return value of type item()* - :) -declare function hof:const($expr as item()*, $ignored as item()*) as item()* external; diff --git a/packages.src/basex-9.7/html.xqm b/packages.src/basex-9.7/html.xqm deleted file mode 100644 index 2d659c3..0000000 --- a/packages.src/basex-9.7/html.xqm +++ /dev/null @@ -1,52 +0,0 @@ -(:~ - : This XQuery Module provides functions for converting HTML to XML. Conversion will only take place if TagSoup is included in the classpath (see HTML Parsing for more details). - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/HTML_Module - :) -module namespace html = "http://basex.org/modules/html"; - -(:~ - : Returns the name of the applied HTML parser (currently: TagSoup). If an empty string is returned, TagSoup was not found in the classpath, and the input will be treated as well-formed XML.
- : - : @return value of type xs:string - :) -declare function html:parser() as xs:string external; - -(:~ - : Converts the HTML document specified by $input to XML and returns a document node:
  • The input may either be a string or a binary item (xs:hexBinary, xs:base64Binary).
  • If the input is passed on in its binary representation, the HTML parser will try to automatically choose the correct encoding.

The $options argument can be used to set TagSoup Options.

- : - : @param $input value of type xs:anyAtomicType - : @return value of type document-node() - : @error html:parse the input cannot be converted to XML. - :) -declare function html:parse($input as xs:anyAtomicType) as document-node() external; - -(:~ - : Converts the HTML document specified by $input to XML and returns a document node:
  • The input may either be a string or a binary item (xs:hexBinary, xs:base64Binary).
  • If the input is passed on in its binary representation, the HTML parser will try to automatically choose the correct encoding.

The $options argument can be used to set TagSoup Options.

- : - : @param $input value of type xs:anyAtomicType - : @param $options value of type map(*)? - : @return value of type document-node() - : @error html:parse the input cannot be converted to XML. - :) -declare function html:parse($input as xs:anyAtomicType, $options as map(*)?) as document-node() external; - -(:~ - : Fetches the HTML document referred to by the given $uri, converts it to XML and returns a document node. The $options argument can be used to set TagSoup Options. - : - : @param $uri value of type xs:string? - : @return value of type document-node()? - : @error html:parse the input cannot be converted to XML. - :) -declare function html:doc($uri as xs:string?) as document-node()? external; - -(:~ - : Fetches the HTML document referred to by the given $uri, converts it to XML and returns a document node. The $options argument can be used to set TagSoup Options. - : - : @param $uri value of type xs:string? - : @param $options value of type map(*)? - : @return value of type document-node()? - : @error html:parse the input cannot be converted to XML. - :) -declare function html:doc($uri as xs:string?, $options as map(*)?) as document-node()? external; diff --git a/packages.src/basex-9.7/http.xqm b/packages.src/basex-9.7/http.xqm deleted file mode 100644 index 23d5617..0000000 --- a/packages.src/basex-9.7/http.xqm +++ /dev/null @@ -1,53 +0,0 @@ -(:~ - : This XQuery Module contains a single function to send HTTP requests and handle HTTP responses. The function send-request is based on the EXPath HTTP Client Module. It gives full control over the available request and response parameters. For simple GET requests, the Fetch Module may be sufficient. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/HTTP_Client_Module - :) -module namespace http = "http://expath.org/ns/http-client"; -declare namespace experr = "http://expath.org/ns/error"; - -(:~ - : Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.
  • Certificate verification can be globally disabled via the IGNORECERT option.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
- : - : @param $request value of type element(http:request) - : @return value of type item()+ - : @error experr:HC0001 an HTTP error occurred. - : @error experr:HC0002 error parsing the entity content as XML or HTML. - : @error experr:HC0003 with a multipart response, the override-media-type must be either a multipart media type or application/octet-stream. - : @error experr:HC0004 the src attribute on the body element is mutually exclusive with all other attribute (except the media-type). - : @error experr:HC0005 the request element is not valid. - : @error experr:HC0006 a timeout occurred waiting for the response. - :) -declare function http:send-request($request as element(http:request)) as item()+ external; - -(:~ - : Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.
  • Certificate verification can be globally disabled via the IGNORECERT option.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
- : - : @param $request value of type element(http:request)? - : @param $href value of type xs:string? - : @return value of type item()+ - : @error experr:HC0001 an HTTP error occurred. - : @error experr:HC0002 error parsing the entity content as XML or HTML. - : @error experr:HC0003 with a multipart response, the override-media-type must be either a multipart media type or application/octet-stream. - : @error experr:HC0004 the src attribute on the body element is mutually exclusive with all other attribute (except the media-type). - : @error experr:HC0005 the request element is not valid. - : @error experr:HC0006 a timeout occurred waiting for the response. - :) -declare function http:send-request($request as element(http:request)?, $href as xs:string?) as item()+ external; - -(:~ - : Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.
  • Certificate verification can be globally disabled via the IGNORECERT option.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
- : - : @param $request value of type element(http:request)? - : @param $href value of type xs:string? - : @param $bodies value of type item()* - : @return value of type item()+ - : @error experr:HC0001 an HTTP error occurred. - : @error experr:HC0002 error parsing the entity content as XML or HTML. - : @error experr:HC0003 with a multipart response, the override-media-type must be either a multipart media type or application/octet-stream. - : @error experr:HC0004 the src attribute on the body element is mutually exclusive with all other attribute (except the media-type). - : @error experr:HC0005 the request element is not valid. - : @error experr:HC0006 a timeout occurred waiting for the response. - :) -declare function http:send-request($request as element(http:request)?, $href as xs:string?, $bodies as item()*) as item()+ external; diff --git a/packages.src/basex-9.7/index.xqm b/packages.src/basex-9.7/index.xqm deleted file mode 100644 index 1fb1ce6..0000000 --- a/packages.src/basex-9.7/index.xqm +++ /dev/null @@ -1,120 +0,0 @@ -(:~ - : This XQuery Module provides functions for displaying information stored in the database index structures. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Index_Module - :) -module namespace index = "http://basex.org/modules/index"; - -(:~ - : Returns information about all facets and facet values of the database $db in document structure format.
If $type is specified as flat, the function returns this information in a flat summarized version. The returned data is derived from the Path Index. - : - : @param $db value of type xs:string - : @return value of type xs:string - : @error db:open The addressed database does not exist or could not be opened. - :) -declare function index:facets($db as xs:string) as xs:string external; - -(:~ - : Returns information about all facets and facet values of the database $db in document structure format.
If $type is specified as flat, the function returns this information in a flat summarized version. The returned data is derived from the Path Index. - : - : @param $db value of type xs:string - : @param $type value of type xs:string - : @return value of type xs:string - : @error db:open The addressed database does not exist or could not be opened. - :) -declare function index:facets($db as xs:string, $type as xs:string) as xs:string external; - -(:~ - : Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:texts($db as xs:string) as element(value)* external; - -(:~ - : Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @param $prefix value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:texts($db as xs:string, $prefix as xs:string) as element(value)* external; - -(:~ - : Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @param $start value of type xs:string - : @param $ascending value of type xs:boolean - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:texts($db as xs:string, $start as xs:string, $ascending as xs:boolean) as element(value)* external; - -(:~ - : Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:attributes($db as xs:string) as element(value)* external; - -(:~ - : Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @param $prefix value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:attributes($db as xs:string, $prefix as xs:string) as element(value)* external; - -(:~ - : Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry. - : - : @param $db value of type xs:string - : @param $start value of type xs:string - : @param $ascending value of type xs:boolean - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:attributes($db as xs:string, $start as xs:string, $ascending as xs:boolean) as element(value)* external; - -(:~ - : Returns all strings stored in the Token Index of the database $db, along with their number of occurrences. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - : @error db:no-index the index is not available. - :) -declare function index:tokens($db as xs:string) as element(value)* external; - -(:~ - : Returns all element names stored in the Name Index of the database $db, along with their number of occurrences. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - :) -declare function index:element-names($db as xs:string) as element(value)* external; - -(:~ - : Returns all attribute names stored in the Name Index of the database $db, along with their number of occurrences. - : - : @param $db value of type xs:string - : @return value of type element(value)* - : @error db:open The addressed database does not exist or could not be opened. - :) -declare function index:attribute-names($db as xs:string) as element(value)* external; diff --git a/packages.src/basex-9.7/inspect.xqm b/packages.src/basex-9.7/inspect.xqm deleted file mode 100644 index cf49076..0000000 --- a/packages.src/basex-9.7/inspect.xqm +++ /dev/null @@ -1,93 +0,0 @@ -(:~ - : This XQuery Module contains functions for extracting internal information about modules and functions and generating documentation. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Inspection_Module - :) -module namespace inspect = "http://basex.org/modules/inspect"; -declare namespace xqdoc = "http://www.xqdoc.org/1.0"; - -(:~ - : Returns function items for all user-defined functions (both public and private) that are known in the current query context. If a $uri is specified, the specified resource will be retrieved as string and compiled, and its functions will be added to the query context and returned to the user. A relative URI will be resolved against the static base URI of the query. - : - : @return value of type function(*)* - : @error inspect:parse Error while parsing a module. - :) -declare function inspect:functions() as function(*)* external; - -(:~ - : Returns function items for all user-defined functions (both public and private) that are known in the current query context. If a $uri is specified, the specified resource will be retrieved as string and compiled, and its functions will be added to the query context and returned to the user. A relative URI will be resolved against the static base URI of the query. - : - : @param $uri value of type xs:string - : @return value of type function(*)* - : @error inspect:parse Error while parsing a module. - :) -declare function inspect:functions($uri as xs:string) as function(*)* external; - -(:~ - : Returns the annotations of the specified $function in a map. - : - : @param $function value of type function(*)? - : @return value of type map(xs:QName, xs:anyAtomicType*) - :) -declare function inspect:function-annotations($function as function(*)?) as map(xs:QName, xs:anyAtomicType*) external; - -(:~ - : Returns a component of the static context of a $function with the specified $name. If no function is supplied, the current static context is considered.
The following components can be requested:
  • base-uri: Static base URI.
  • namespaces: Prefix/URI map with all statically known namespaces.
  • element-namespace: Default element/type namespace URI, or an empty sequence if it is absent.
  • function-namespace: Default function namespace URI, or an empty sequence if it is absent.
  • collation: URI of the default collation.
  • ordering: Ordering mode (ordered/unordered)
  • construction: Construction mode (preserve/strip)
  • default-order-empty: Default order for empty sequences (greatest/least)
  • boundary-space: Boundary-space policy (preserve/strip)
  • copy-namespaces: Copy-namespaces mode (inherit/no-inherit, preserve/no-preserve)
  • decimal-formats: Nested map with all statically known decimal formats
- : - : @param $function value of type function(*)? - : @param $name value of type xs:string - : @return value of type item()* - : @error inspect:unknown The specified component does not exist. - :) -declare function inspect:static-context($function as function(*)?, $name as xs:string) as item()* external; - -(:~ - : Returns a string representation of the type of a $value:
  • The string includes the occurrence indicator.
  • The type of functions and nodes may be stricter than the returned type.
  • For type checking, the standard expressions typeswitch and instance of should be used instead.

The following $options are available:

  • item: If enabled, only the item type is returned and the occurrence indicator is omitted. The default is false().
  • mode: If value is specified, the assigned type of the result value is returned. With expression the type of the input expression is returned (please note that the original expression may already have been rewritten at compile-time). With computed, the exact value is computed at runtime, based on the expression and the result value. The default is computed.
- : - : @param $value value of type item()* - : @return value of type xs:string - :) -declare function inspect:type($value as item()*) as xs:string external; - -(:~ - : Returns a string representation of the type of a $value:
  • The string includes the occurrence indicator.
  • The type of functions and nodes may be stricter than the returned type.
  • For type checking, the standard expressions typeswitch and instance of should be used instead.

The following $options are available:

  • item: If enabled, only the item type is returned and the occurrence indicator is omitted. The default is false().
  • mode: If value is specified, the assigned type of the result value is returned. With expression the type of the input expression is returned (please note that the original expression may already have been rewritten at compile-time). With computed, the exact value is computed at runtime, based on the expression and the result value. The default is computed.
- : - : @param $value value of type item()* - : @param $options value of type map(*) - : @return value of type xs:string - :) -declare function inspect:type($value as item()*, $options as map(*)) as xs:string external; - -(:~ - : Inspects the specified $function and returns an element that describes its structure. The output of this function is similar to eXist-db’s inspect:inspect-function function. - : - : @param $function value of type function(*) - : @return value of type element(function) - :) -declare function inspect:function($function as function(*)) as element(function) external; - -(:~ - : Generates an element that describes all variables and functions in the current query context. - : - : @return value of type element(context) - :) -declare function inspect:context() as element(context) external; - -(:~ - : Retrieves the resource located at the specified $uri, parses it as XQuery module, and generates an element that describes the module's structure. A relative URI will be resolved against the static base URI of the query. - : - : @param $uri value of type xs:string - : @return value of type element(module) - : @error inspect:parse Error while parsing a module. - :) -declare function inspect:module($uri as xs:string) as element(module) external; - -(:~ - : Retrieves the resource located at the specified $uri, parses it as XQuery module, and generates an xqDoc element. A relative URI will be resolved against the static base URI of the query.
xqDoc provides a simple vendor-neutral solution for generating documentation from XQuery modules. The documentation conventions have been inspired by the JavaDoc standard. Documentation comments begin with (:~ and end with :), and tags start with @. xqDoc comments can be specified for main and library modules and variable and function declarations.

We have slightly extended the xqDoc conventions to do justice to more recent versions of XQuery (Schema: xqdoc-1.1.30052013.xsd):

  • an <xqdoc:annotations/> node is added to each variable or function that uses annotations. The xqdoc:annotation child nodes may have additional xqdoc:literal elements with type attributes (xs:string, xs:integer, xs:decimal, xs:double) and values.
  • a single <xqdoc:namespaces/> node is added to the root element, which summarizes all prefixes and namespace URIs used or declared in the module.
  • name and type elements are added to variables.
- : - : @param $uri value of type xs:string - : @return value of type element(xqdoc:xqdoc) - : @error inspect:parse Error while parsing a module. - :) -declare function inspect:xqdoc($uri as xs:string) as element(xqdoc:xqdoc) external; diff --git a/packages.src/basex-9.7/jobs.xqm b/packages.src/basex-9.7/jobs.xqm deleted file mode 100644 index 430d085..0000000 --- a/packages.src/basex-9.7/jobs.xqm +++ /dev/null @@ -1,122 +0,0 @@ -(:~ - : This XQuery Module provides functions for organizing scheduled, queued, running and cached jobs. Jobs can be commands, queries, client or HTTP requests. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Jobs_Module - :) -module namespace jobs = "http://basex.org/modules/jobs"; - -(:~ - : Schedules the evaluation of the supplied $query (xs:string, or of type xs:anyURI, pointing to a resource), and returns a query id. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and the context value can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via jobs:result, or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time, dateTime or integer can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples for valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
    • If a time is specified, the query will be executed at this time of the day. Examples for valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • An integer will be interpreted as minutes. If the specified number is greater than the elapsed minutes of the current hour, the query will be executed one hour later.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same id is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service. Registered services must have no variable bindings.
  • log: writes the specified string to the database logs. Two log entries are stored, one at the beginning and another one after the execution of the job.
- : - : @param $query value of type xs:anyAtomicItem - : @return value of type xs:string - : @error jobs:overflow Query execution is rejected, because too many jobs are queued or being executed. CACHETIMEOUT can be decreased if the default setting is too restrictive. - : @error jobs:range A specified time or duration is out of range. - : @error jobs:id The specified id is invalid or has already been assigned. - : @error jobs:options The specified options are conflicting. - :) -declare function jobs:eval($query as xs:anyAtomicItem) as xs:string external; - -(:~ - : Schedules the evaluation of the supplied $query (xs:string, or of type xs:anyURI, pointing to a resource), and returns a query id. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and the context value can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via jobs:result, or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time, dateTime or integer can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples for valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
    • If a time is specified, the query will be executed at this time of the day. Examples for valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • An integer will be interpreted as minutes. If the specified number is greater than the elapsed minutes of the current hour, the query will be executed one hour later.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same id is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service. Registered services must have no variable bindings.
  • log: writes the specified string to the database logs. Two log entries are stored, one at the beginning and another one after the execution of the job.
- : - : @param $query value of type xs:anyAtomicItem - : @param $bindings value of type map(*)? - : @return value of type xs:string - : @error jobs:overflow Query execution is rejected, because too many jobs are queued or being executed. CACHETIMEOUT can be decreased if the default setting is too restrictive. - : @error jobs:range A specified time or duration is out of range. - : @error jobs:id The specified id is invalid or has already been assigned. - : @error jobs:options The specified options are conflicting. - :) -declare function jobs:eval($query as xs:anyAtomicItem, $bindings as map(*)?) as xs:string external; - -(:~ - : Schedules the evaluation of the supplied $query (xs:string, or of type xs:anyURI, pointing to a resource), and returns a query id. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and the context value can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via jobs:result, or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time, dateTime or integer can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples for valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
    • If a time is specified, the query will be executed at this time of the day. Examples for valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • An integer will be interpreted as minutes. If the specified number is greater than the elapsed minutes of the current hour, the query will be executed one hour later.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same id is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service. Registered services must have no variable bindings.
  • log: writes the specified string to the database logs. Two log entries are stored, one at the beginning and another one after the execution of the job.
- : - : @param $query value of type xs:anyAtomicItem - : @param $bindings value of type map(*)? - : @param $options value of type map(*)? - : @return value of type xs:string - : @error jobs:overflow Query execution is rejected, because too many jobs are queued or being executed. CACHETIMEOUT can be decreased if the default setting is too restrictive. - : @error jobs:range A specified time or duration is out of range. - : @error jobs:id The specified id is invalid or has already been assigned. - : @error jobs:options The specified options are conflicting. - :) -declare function jobs:eval($query as xs:anyAtomicItem, $bindings as map(*)?, $options as map(*)?) as xs:string external; - -(:~ - : Returns the cached result of a job with the specified job $id:
  • If the original job has raised an error, the cached error will be raised instead.
  • Results can only be retrieved once. After retrieval, the cached result will be dropped.
  • If the result has already been retrieved, or if it has not been cached, an empty sequence is returned.
- : - : @param $id value of type xs:string - : @return value of type item()* - :) -declare function jobs:result($id as xs:string) as item()* external; - -(:~ - : Triggers the cancelation of a job with the specified $id, drops the cached result of a query, or cancels a scheduled job. Unknown ids are ignored. All jobs are gracefully stopped; it is up to the process to decide when it is safe to shut down. The following $options can be supplied:
  • service: additionally removes the job from the job services list.
- : - : @param $id value of type xs:string - :) -declare function jobs:stop($id as xs:string) as empty-sequence() external; - -(:~ - : Waits for the completion of a job with the specified $id:
  • The function will terminate immediately if the job id is unknown. This is the case if a future job has not been queued yet, or if the id has already been discarded after job evaluation.
  • If the function is called with the id of a queued job, or repeatedly executed job, it may stall and never terminate.
- : - : @param $id value of type xs:string - : @error jobs:self The current job is addressed. - :) -declare function jobs:wait($id as xs:string) as empty-sequence() external; - -(:~ - : Returns the id of the current job. - : - : @return value of type xs:string - :) -declare function jobs:current() as xs:string external; - -(:~ - : Returns the ids of all jobs that are currently registered. The list includes scheduled, queued, running, stopped, and finished jobs with cached results. - : - : @return value of type xs:string* - :) -declare function jobs:list() as xs:string* external; - -(:~ - : Returns information on all jobs that are currently registered, or on a job with the specified $id (or an empty sequence if this job is not found). The list includes scheduled, queued, running jobs, and cached jobs. A string representation of the job, or its URI, will be returned as value. The returned elements have additional attributes:
  • id: job id
  • type: type of the job (command, query, REST, RESTXQ, etc.)
  • state: current state of the job: scheduled, queued, running, cached
  • user: user who started the job
  • duration: evaluation time (included if a job is running or if the result was cached)
  • start: next start of job (included if a job will be executed repeatedly)
  • time: time when job was registered
- : - : @return value of type element(job)* - :) -declare function jobs:list-details() as element(job)* external; - -(:~ - : Returns information on all jobs that are currently registered, or on a job with the specified $id (or an empty sequence if this job is not found). The list includes scheduled, queued, running jobs, and cached jobs. A string representation of the job, or its URI, will be returned as value. The returned elements have additional attributes:
  • id: job id
  • type: type of the job (command, query, REST, RESTXQ, etc.)
  • state: current state of the job: scheduled, queued, running, cached
  • user: user who started the job
  • duration: evaluation time (included if a job is running or if the result was cached)
  • start: next start of job (included if a job will be executed repeatedly)
  • time: time when job was registered
- : - : @param $id value of type xs:string - : @return value of type element(job)* - :) -declare function jobs:list-details($id as xs:string) as element(job)* external; - -(:~ - : Returns the variable bindings of an existing job with the specified $id. If no variables have been bound to this job, an empty map is returned. - : - : @param $id value of type xs:string - : @return value of type map(*) - :) -declare function jobs:bindings($id as xs:string) as map(*) external; - -(:~ - : Indicates if the evaluation of an already running job with the specified $id has finished. As the ids of finished jobs will usually be discarded, unless caching is enabled, the function will also return true for unknown jobs.
  • false indicates that the job id is scheduled, queued, or currently running.
  • true will be returned if the job has either finished, or if the id is unknown (because the ids of all finished jobs will not be cached).
- : - : @param $id value of type xs:string - : @return value of type xs:boolean - :) -declare function jobs:finished($id as xs:string) as xs:boolean external; - -(:~ - : Returns a list of all jobs that have been persistently registered as Services. - : - : @return value of type element(job)* - : @error jobs:services Registered services cannot be parsed. - :) -declare function jobs:services() as element(job)* external; diff --git a/packages.src/basex-9.7/json.xqm b/packages.src/basex-9.7/json.xqm deleted file mode 100644 index 94cce1a..0000000 --- a/packages.src/basex-9.7/json.xqm +++ /dev/null @@ -1,68 +0,0 @@ -(:~ - : This XQuery Module contains functions to parse and serialize JSON data JSON (JavaScript Object Notation) is a popular data exchange format for applications written in JavaScript. As there are notable differences between JSON and XML, or XQuery data types, no mapping exists that guarantees a lossless, bidirectional conversion between JSON and XML. For this reason, we offer various mappings, all of which are suited to different use cases. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/JSON_Module - :) -module namespace json = "http://basex.org/modules/json"; - -(:~ - : Converts the JSON $string to an XQuery value. If the input can be successfully parsed, it can be serialized back to the original JSON representation. The $options argument can be used to control the way the input is converted. - : - : @param $string value of type xs:string? - : @return value of type item()? - : @error json:parse the specified input cannot be parsed as JSON document. - : @error json:options the specified options are conflicting. - :) -declare function json:parse($string as xs:string?) as item()? external; - -(:~ - : Converts the JSON $string to an XQuery value. If the input can be successfully parsed, it can be serialized back to the original JSON representation. The $options argument can be used to control the way the input is converted. - : - : @param $string value of type xs:string? - : @param $options value of type map(*)? - : @return value of type item()? - : @error json:parse the specified input cannot be parsed as JSON document. - : @error json:options the specified options are conflicting. - :) -declare function json:parse($string as xs:string?, $options as map(*)?) as item()? external; - -(:~ - : Fetches the JSON document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted. - : - : @param $uri value of type xs:string - : @return value of type item()? - : @error json:parse the specified input cannot be parsed as JSON document. - : @error json:options the specified options are conflicting. - :) -declare function json:doc($uri as xs:string) as item()? external; - -(:~ - : Fetches the JSON document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted. - : - : @param $uri value of type xs:string - : @param $options value of type map(*)? - : @return value of type item()? - : @error json:parse the specified input cannot be parsed as JSON document. - : @error json:options the specified options are conflicting. - :) -declare function json:doc($uri as xs:string, $options as map(*)?) as item()? external; - -(:~ - : Serializes the specified $input as JSON, using the specified $options, and returns the result as string:
  • The input is expected to conform to the results that are created by json:parse().
  • Non-conforming items will be serialized as specified in the json output method of the official recommendation.

Values can also be serialized as JSON with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to json, and
  • the options presented in this article need to be assigned to the json parameter.
- : - : @param $input value of type item()? - : @return value of type xs:string - : @error json:serialize the specified node cannot be serialized as JSON document. - :) -declare function json:serialize($input as item()?) as xs:string external; - -(:~ - : Serializes the specified $input as JSON, using the specified $options, and returns the result as string:
  • The input is expected to conform to the results that are created by json:parse().
  • Non-conforming items will be serialized as specified in the json output method of the official recommendation.

Values can also be serialized as JSON with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to json, and
  • the options presented in this article need to be assigned to the json parameter.
- : - : @param $input value of type item()? - : @param $options value of type map(*)? - : @return value of type xs:string - : @error json:serialize the specified node cannot be serialized as JSON document. - :) -declare function json:serialize($input as item()?, $options as map(*)?) as xs:string external; diff --git a/packages.src/basex-9.7/lazy.xqm b/packages.src/basex-9.7/lazy.xqm deleted file mode 100644 index 5430def..0000000 --- a/packages.src/basex-9.7/lazy.xqm +++ /dev/null @@ -1,40 +0,0 @@ -(:~ - : - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Lazy_Module - :) -module namespace lazy = "http://basex.org/modules/lazy"; - -(:~ - : Caches the data of lazy $items in a sequence:
  • data of lazy items will be retrieved and cached inside the item.
  • non-lazy items, or lazy items with cached data, will simply be passed through.
  • If $lazy is set to true(), caching will be deferred until the data is eventually requested. Streaming will be disabled: Data will always be cached before a stream is returned.

Caching is advisable if an item will be processed more than once, or if the data may not be available anymore at a later stage.

- : - : @param $items value of type item()* - : @return value of type item()* - :) -declare function lazy:cache($items as item()*) as item()* external; - -(:~ - : Caches the data of lazy $items in a sequence:
  • data of lazy items will be retrieved and cached inside the item.
  • non-lazy items, or lazy items with cached data, will simply be passed through.
  • If $lazy is set to true(), caching will be deferred until the data is eventually requested. Streaming will be disabled: Data will always be cached before a stream is returned.

Caching is advisable if an item will be processed more than once, or if the data may not be available anymore at a later stage.

- : - : @param $items value of type item()* - : @param $lazy value of type xs:boolean - : @return value of type item()* - :) -declare function lazy:cache($items as item()*, $lazy as xs:boolean) as item()* external; - -(:~ - : Checks whether the specified $item is lazy. - : - : @param $item value of type item() - : @return value of type xs:boolean - :) -declare function lazy:is-lazy($item as item()) as xs:boolean external; - -(:~ - : Checks whether the contents of the specified $item are cached. The function will always return true for non-lazy items. - : - : @param $item value of type item() - : @return value of type xs:boolean - :) -declare function lazy:is-cached($item as item()) as xs:boolean external; diff --git a/packages.src/basex-9.7/map.xqm b/packages.src/basex-9.7/map.xqm deleted file mode 100644 index b3a9cee..0000000 --- a/packages.src/basex-9.7/map.xqm +++ /dev/null @@ -1,105 +0,0 @@ -(:~ - : This XQuery Module contains functions for manipulating maps. Maps have been introduced with XQuery 3.1. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Map_Module - :) -module namespace map = "http://www.w3.org/2005/xpath-functions/map"; - -(:~ - : Returns true if the supplied $map contains an entry with a key equal to the supplied value of $key; otherwise it returns false. No error is raised if the map contains keys that are not comparable with the supplied $key.

If the supplied key is xs:untypedAtomic, it is compared as an instance of xs:string. If the supplied key is the xs:float or xs:double value NaN, the function returns true if there is an entry whose key is NaN, or false otherwise.

- : - : @param $map value of type map(*) - : @param $key value of type xs:anyAtomicType - : @return value of type xs:boolean - :) -declare function map:contains($map as map(*), $key as xs:anyAtomicType) as xs:boolean external; - -(:~ - : Creates a new map containing a single entry. The key of the entry in the new map is $key, and its associated value is $value.

The function map:entry is intended primarily for use in conjunction with the function map:merge . For example, a map containing seven entries may be constructed like this:

  map:merge (( map:entry ( "Sun" , "Sunday" ), map:entry ( "Mon" , "Monday" ), map:entry ( "Tue" , "Tuesday" ), map:entry ( "Wed" , "Wednesday" ), map:entry ( "Thu" , "Thursday" ), map:entry ( "Fri" , "Friday" ), map:entry ( "Sat" , "Saturday" ) )) 

Unlike the map { ... } expression, this technique can be used to construct a map with a variable number of entries, for example:

  map:merge ( for $ b in // book return map:entry ( $ b / isbn , $ b )) 
- : - : @param $key value of type xs:anyAtomicType - : @param $value value of type item()* - : @return value of type map(*) - :) -declare function map:entry($key as xs:anyAtomicType, $value as item()*) as map(*) external; - -(:~ - : Returns all values of maps in the supplied $input with the specified $key. The found values will be returned in an array. Arbitrary input will be processed recursively as follows:
  • In a sequence, each item will be processed in order.
  • In an array, all array members will be processed as sequence.
  • In a map, all entries whose keys match the specified key. Moreover, all values of the map will be processed as sequence.
- : - : @param $input value of type item()* - : @param $key value of type xs:anyAtomicType - : @return value of type array(*) - :) -declare function map:find($input as item()*, $key as xs:anyAtomicType) as array(*) external; - -(:~ - : Applies the specified $function to every key/value pair of the supplied $map and returns the results as a sequence. - : - : @param $map value of type map(*) - : @param $function value of type function(xs:anyAtomicType - : @param item()* value of type - : @return value of type item()* - :) -declare function map:for-each($map as map(*), $function as function(xs:anyAtomicType, item()*) as item()*) as item()* external; - -(:~ - : Returns the value associated with a supplied key in a given map. This function attempts to find an entry within the $map that has a key equal to the supplied value of $key. If there is such an entry, the function returns the associated value; otherwise it returns an empty sequence. No error is raised if the map contains keys that are not comparable with the supplied $key. If the supplied key is xs:untypedAtomic, it is converted to xs:string.

A return value of () from map:get could indicate that the key is present in the map with an associated value of (), or it could indicate that the key is not present in the map. The two cases can be distinguished by calling map:contains. Invoking the map as a function item has the same effect as calling get: that is, when $map is a map, the expression $map($K) is equivalent to get($map, $K). Similarly, the expression get(get(get($map, 'employee'), 'name'), 'first') can be written as $map('employee')('name')('first').

- : - : @param $map value of type map(*) - : @param $key value of type xs:anyAtomicType - : @return value of type item()* - :) -declare function map:get($map as map(*), $key as xs:anyAtomicType) as item()* external; - -(:~ - : Returns a sequence containing all the key values present in a map. The function takes the supplied $map and returns the keys that are present in the map as a sequence of atomic values. The order may differ from the order in which entries were inserted in the map. - : - : @param $map value of type map(*) - : @return value of type xs:anyAtomicType* - :) -declare function map:keys($map as map(*)) as xs:anyAtomicType* external; - -(:~ - : Constructs and returns a new map. The map is formed by combining the contents of the supplied $maps. The maps are combined as follows:
  1. There is one entry in the new map for each distinct key present in the union of the input maps.
  2. The $options argument defines how duplicate keys are handled. Currently, a single option duplicates exists, and its allowed values are use-first, use-last, combine and reject (default: use-first).
- : - : @param $maps value of type map(*)* - : @return value of type map(*) - :) -declare function map:merge($maps as map(*)*) as map(*) external; - -(:~ - : Constructs and returns a new map. The map is formed by combining the contents of the supplied $maps. The maps are combined as follows:
  1. There is one entry in the new map for each distinct key present in the union of the input maps.
  2. The $options argument defines how duplicate keys are handled. Currently, a single option duplicates exists, and its allowed values are use-first, use-last, combine and reject (default: use-first).
- : - : @param $maps value of type map(*)* - : @param $options value of type map(*) - : @return value of type map(*) - :) -declare function map:merge($maps as map(*)*, $options as map(*)) as map(*) external; - -(:~ - : Creates a new map, containing the entries of the supplied $map and a new entry composed by $key and $value. The semantics of this function are equivalent to map:merge((map { $key, $value }, $map)) - : - : @param $map value of type map(*) - : @param $key value of type xs:anyAtomicType - : @param $value value of type item()* - : @return value of type map(*) - :) -declare function map:put($map as map(*), $key as xs:anyAtomicType, $value as item()*) as map(*) external; - -(:~ - : Constructs a new map by removing entries from an existing map. The entries in the new map correspond to the entries of $map, excluding entries supplied via $keys.

No failure occurs if the input map contains no entry with the supplied keys; the input map is returned unchanged.

- : - : @param $map value of type map(*) - : @param $keys value of type xs:anyAtomicType* - : @return value of type map(*) - :) -declare function map:remove($map as map(*), $keys as xs:anyAtomicType*) as map(*) external; - -(:~ - : Returns a the number of entries in the supplied map. The function takes the supplied $map and returns the number of entries that are present in the map. - : - : @param $map value of type map(*) - : @return value of type xs:integer - :) -declare function map:size($map as map(*)) as xs:integer external; diff --git a/packages.src/basex-9.7/math.xqm b/packages.src/basex-9.7/math.xqm deleted file mode 100644 index e0b534f..0000000 --- a/packages.src/basex-9.7/math.xqm +++ /dev/null @@ -1,151 +0,0 @@ -(:~ - : The math XQuery Module defines functions to perform mathematical operations, such as pi, asin and acos. Most functions are specified in the Functions and Operators Specification of the upcoming XQuery 3.0 Recommendation, and some additional ones have been added in this module. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Math_Module - :) -module namespace math = "http://www.w3.org/2005/xpath-functions/math"; - -(:~ - : Returns the xs:double value of the mathematical constant π whose lexical representation is 3.141592653589793. - : - : @return value of type xs:double - :) -declare function math:pi() as xs:double external; - -(:~ - : Returns the square root of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the xs:double value of the mathematical square root of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:sqrt($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the sine of the $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the sine of $arg, treated as an angle in radians. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:sin($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the cosine of $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the cosine of $arg, treated as an angle in radians. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:cos($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the tangent of $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the tangent of $arg, treated as an angle in radians. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:tan($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the arc sine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc sine of $arg, returned as an angle in radians in the range -Ï€/2 to +Ï€/2. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:asin($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the arc cosine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc cosine of $arg, returned as an angle in radians in the range 0 to +Ï€. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:acos($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the arc tangent of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc tangent of $arg, returned as an angle in radians in the range -Ï€/2 to +Ï€/2. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:atan($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the arc tangent of $arg1 divided by $arg2, the result being in the range -Ï€/2 to +Ï€/2 radians.
If $arg1 is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc tangent of $arg1 divided by $arg2, returned as an angle in radians in the range -Ï€ to +Ï€. - : - : @param $arg1 value of type xs:double? - : @param $arg2 value of type xs:double - : @return value of type xs:double? - :) -declare function math:atan2($arg1 as xs:double?, $arg2 as xs:double) as xs:double? external; - -(:~ - : Returns $arg1 raised to the power of $arg2.
If $arg1 is the empty sequence, the empty sequence is returned.
Otherwise the result is the $arg1 raised to the power of $arg2. - : - : @param $arg1 value of type xs:double? - : @param $arg2 value of type xs:double - : @return value of type xs:double? - :) -declare function math:pow($arg1 as xs:double?, $arg2 as xs:double) as xs:double? external; - -(:~ - : Returns e raised to the power of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the value of e raised to the power of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:exp($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the natural logarithm of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the natural logarithm (base e) of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:log($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the base 10 logarithm of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the base 10 logarithm of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:log10($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the xs:double value of the mathematical constant e whose lexical representation is 2.718281828459045. - : - : @return value of type xs:double - :) -declare function math:e() as xs:double external; - -(:~ - : Returns the hyperbolic sine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic sine of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:sinh($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the hyperbolic cosine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic cosine of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:cosh($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the hyperbolic tangent of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic tangent of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:tanh($arg as xs:double?) as xs:double? external; - -(:~ - : Calculates the CRC32 check sum of the given $string.
If an empty sequence is supplied, the empty sequence is returned. - : - : @param $string value of type xs:string? - : @return value of type xs:hexBinary? - :) -declare function math:crc32($string as xs:string?) as xs:hexBinary? external; diff --git a/packages.src/basex-9.7/out.xqm b/packages.src/basex-9.7/out.xqm deleted file mode 100644 index d93a3a3..0000000 --- a/packages.src/basex-9.7/out.xqm +++ /dev/null @@ -1,41 +0,0 @@ -(:~ - : - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Output_Module - :) -module namespace out = "http://basex.org/modules/out"; - -(:~ - : Returns a single carriage return character (&#13;). - : - : @param value of type xs:string - : @return value of type xs:string - :) -declare function out:cr() as xs:string external; - -(:~ - : Returns a single newline character (&#10;). - : - : @param value of type xs:string - : @return value of type xs:string - :) -declare function out:nl() as xs:string external; - -(:~ - : Returns a single tabulator character (&#9;). - : - : @param value of type xs:string - : @return value of type xs:string - :) -declare function out:tab() as xs:string external; - -(:~ - : Returns a formatted string. The remaining arguments specified by $items are applied to the $format string, according to Java’s printf syntax. - : - : @param $format value of type xs:string - : @param $items value of type item( - : @return value of type xs:string - : @error out:format The specified format is not valid. - :) -declare function out:format($format as xs:string, $items as item() ) as xs:string external; diff --git a/packages.src/basex-9.7/proc.xqm b/packages.src/basex-9.7/proc.xqm deleted file mode 100644 index 55342ff..0000000 --- a/packages.src/basex-9.7/proc.xqm +++ /dev/null @@ -1,127 +0,0 @@ -(:~ - : This XQuery Module provides functions for executing system commands from XQuery. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Process_Module - :) -module namespace proc = "http://basex.org/modules/proc"; - -(:~ - : Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
- : - : @param $cmd value of type xs:string - : @return value of type xs:string - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - : @error proc:error the command could not be executed, or an I/O exception was raised. - : @error proc:code.... If the commands returns an exit code different to 0, an error will be raised. Its code will consist of the letters code and four digits with the exit code. - :) -declare function proc:system($cmd as xs:string) as xs:string external; - -(:~ - : Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
- : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @return value of type xs:string - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - : @error proc:error the command could not be executed, or an I/O exception was raised. - : @error proc:code.... If the commands returns an exit code different to 0, an error will be raised. Its code will consist of the letters code and four digits with the exit code. - :) -declare function proc:system($cmd as xs:string, $args as xs:string*) as xs:string external; - -(:~ - : Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
- : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @param $options value of type map(xs:string - : @param xs:string) value of type - : @return value of type xs:string - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - : @error proc:error the command could not be executed, or an I/O exception was raised. - : @error proc:code.... If the commands returns an exit code different to 0, an error will be raised. Its code will consist of the letters code and four digits with the exit code. - :) -declare function proc:system($cmd as xs:string, $args as xs:string*, $options as map(xs:string, xs:string)) as xs:string external; - -(:~ - : Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system.
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

  <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
- : - : @param $cmd value of type xs:string - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - :) -declare function proc:execute($cmd as xs:string) as element(result) external; - -(:~ - : Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system.
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

  <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
- : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - :) -declare function proc:execute($cmd as xs:string, $args as xs:string*) as element(result) external; - -(:~ - : Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system.
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

  <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
- : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @param $options value of type map(xs:string - : @param xs:string) value of type - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - : @error proc:timeout the specified timeout was exceeded. - :) -declare function proc:execute($cmd as xs:string, $args as xs:string*, $options as map(xs:string, xs:string)) as element(result) external; - -(:~ - : Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored). - : - : @param $cmd value of type xs:string - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - :) -declare function proc:fork($cmd as xs:string) as element(result) external; - -(:~ - : Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored). - : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - :) -declare function proc:fork($cmd as xs:string, $args as xs:string*) as element(result) external; - -(:~ - : Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored). - : - : @param $cmd value of type xs:string - : @param $args value of type xs:string* - : @param $options value of type map(xs:string - : @param xs:string) value of type - : @return value of type element(result) - : @error proc:encoding the specified encoding does not exist or is not supported. - :) -declare function proc:fork($cmd as xs:string, $args as xs:string*, $options as map(xs:string, xs:string)) as element(result) external; - -(:~ - : Returns the system property, specified by $name, or a context parameter of the web.xml file with that name (see Web Applications). An empty sequence is returned if the property does not exist. For environment variables of the operating system, please use fn:environment-variable. - : - : @param $name value of type xs:string - : @return value of type xs:string? - :) -declare function proc:property($name as xs:string) as xs:string? external; - -(:~ - : Returns the names of all Java system properties and context parameters of the web.xml file (see Web Applications). For environment variables of the operating system, please use fn:available-environment-variables. - : - : @return value of type xs:string* - :) -declare function proc:property-names() as xs:string* external; diff --git a/packages.src/basex-9.7/prof.xqm b/packages.src/basex-9.7/prof.xqm deleted file mode 100644 index 0b8fc46..0000000 --- a/packages.src/basex-9.7/prof.xqm +++ /dev/null @@ -1,142 +0,0 @@ -(:~ - : This XQuery Module contains various functions to test and profile code, and to dump information to standard output. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Profiling_Module - :) -module namespace prof = "http://basex.org/modules/prof"; - -(:~ - : Measures the execution time and memory consumption required for evaluating the specified $expression and returns a map with the results. The following $options are available:
  • time: Include execution time in result as xs:decimal (unit: milliseconds; default: true).
  • memory: Include memory consumption in result as xs:integer (unit: bytes; default: false).
  • value: Include value in result (default: true).

Helpful notes:

  • If you are not interested in some of the returned results, you should disable them to save time and memory.
  • Profiling might change the execution behavior of your code: An expression that might be executed iteratively will be cached by the profiling function.
  • If a value has a compact internal representation, memory consumption will be very low, even if the serialized result may consume much more memory.
  • Please note that memory profiling is only approximative, so it can be quite misleading. If the memory option is enabled, main-memory will be garbage-collected before and after evaluation to improve the quality of the measurement.
- : - : @param $expression value of type item() - : @return value of type item()* - :) -declare function prof:track($expression as item()) as item()* external; - -(:~ - : Measures the execution time and memory consumption required for evaluating the specified $expression and returns a map with the results. The following $options are available:
  • time: Include execution time in result as xs:decimal (unit: milliseconds; default: true).
  • memory: Include memory consumption in result as xs:integer (unit: bytes; default: false).
  • value: Include value in result (default: true).

Helpful notes:

  • If you are not interested in some of the returned results, you should disable them to save time and memory.
  • Profiling might change the execution behavior of your code: An expression that might be executed iteratively will be cached by the profiling function.
  • If a value has a compact internal representation, memory consumption will be very low, even if the serialized result may consume much more memory.
  • Please note that memory profiling is only approximative, so it can be quite misleading. If the memory option is enabled, main-memory will be garbage-collected before and after evaluation to improve the quality of the measurement.
- : - : @param $expression value of type item() - : @param $options value of type map(*)? - : @return value of type item()* - :) -declare function prof:track($expression as item(), $options as map(*)?) as item()* external; - -(:~ - : Measures the time needed to evaluate $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes. - : - : @param $expr value of type item() - : @return value of type item()* - :) -declare function prof:time($expr as item()) as item()* external; - -(:~ - : Measures the time needed to evaluate $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes. - : - : @param $expr value of type item() - : @param $label value of type xs:string - : @return value of type item()* - :) -declare function prof:time($expr as item(), $label as xs:string) as item()* external; - -(:~ - : Measures the memory allocated by evaluating $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes. - : - : @param $expr value of type item() - : @return value of type item()* - :) -declare function prof:memory($expr as item()) as item()* external; - -(:~ - : Measures the memory allocated by evaluating $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes. - : - : @param $expr value of type item() - : @param $label value of type xs:string - : @return value of type item()* - :) -declare function prof:memory($expr as item(), $label as xs:string) as item()* external; - -(:~ - : Returns the number of milliseconds passed since 1970/01/01 UTC. The granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds. - : - : @return value of type xs:integer - :) -declare function prof:current-ms() as xs:integer external; - -(:~ - : Returns the current value of the most precise available system timer in nanoseconds. - : - : @return value of type xs:integer - :) -declare function prof:current-ns() as xs:integer external; - -(:~ - : Dumps a serialized representation of $expr to STDERR, optionally prefixed with $label, and returns an empty sequence. If the GUI is used, the dumped result is shown in the Info View. - : - : @param $expr value of type item()* - :) -declare function prof:dump($expr as item()*) as empty-sequence() external; - -(:~ - : Dumps a serialized representation of $expr to STDERR, optionally prefixed with $label, and returns an empty sequence. If the GUI is used, the dumped result is shown in the Info View. - : - : @param $expr value of type item()* - : @param $label value of type xs:string - :) -declare function prof:dump($expr as item()*, $label as xs:string) as empty-sequence() external; - -(:~ - : Prints a list of all current local and global variable assignments to standard error or, if the GUI is used, to the Info View.
As every query is optimized before being evaluated, not all of the original variables may be visible in the output. Moreover, many variables of function calls will disappear because functions are inlined. Function inlining can be turned off by setting INLINELIMIT to 0. - :) -declare function prof:variables() as empty-sequence() external; - -(:~ - : Similar to fn:trace($expr, $msg), but instead of a user-defined message, it emits the compile-time type and estimated result size of its argument. - : - : @param $expr value of type item()* - : @return value of type item()* - :) -declare function prof:type($expr as item()*) as item()* external; - -(:~ - : Enforces Java garbage collection. If no $count is supplied, garbage will be collected once. Please note that this function should only be used for debugging purposes; in productive code, it is best to trust the garbage collecting strategies of Java. - :) -declare function prof:gc() as empty-sequence() external; - -(:~ - : Enforces Java garbage collection. If no $count is supplied, garbage will be collected once. Please note that this function should only be used for debugging purposes; in productive code, it is best to trust the garbage collecting strategies of Java. - : - : @param $count value of type xs:integer - :) -declare function prof:gc($count as xs:integer) as empty-sequence() external; - -(:~ - : Returns the value of the specified runtime $option. The following options exist:
  • max: Maximum memory that the Java virtual machine will attempt to use.
  • total: Total memory in the Java virtual machine (varies over time).
  • used: Currently used memory (varies over time, will shrink after garbage collection).
  • processors: number of processors available to the Java virtual machine.
- : - : @param $name of xs:string value of type - : @return value of type xs:integer - :) -declare function prof:runtime($name as xs:string) as xs:integer external; - -(:~ - : Swallows all items of the specified $value and returns an empty sequence. This function is helpful if some code needs to be evaluated and if the actual result is irrelevant. - : - : @param $value value of type item()* - :) -declare function prof:void($value as item()*) as empty-sequence() external; - -(:~ - : Sleeps for the specified number of milliseconds. - : - : @param $ms value of type xs:integer - :) -declare function prof:sleep($ms as xs:integer) as empty-sequence() external; - -(:~ - : Returns a human-readable representation of the specified $number. - : - : @param $number value of type xs:integer - : @return value of type xs:string - :) -declare function prof:human($number as xs:integer) as xs:string external; diff --git a/packages.src/basex-9.7/random.xqm b/packages.src/basex-9.7/random.xqm deleted file mode 100644 index bdb7b0e..0000000 --- a/packages.src/basex-9.7/random.xqm +++ /dev/null @@ -1,87 +0,0 @@ -(:~ - : This XQuery Module contains functions for computing random values. All functions except for random:seeded-double and random:seeded-integer are non-deterministic, i. e., they return different values for each call. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Random_Module - :) -module namespace random = "http://basex.org/modules/random"; - -(:~ - : Returns a double value between 0.0 (inclusive) and 1.0 (exclusive).
- : - : @return value of type xs:double - :) -declare function random:double() as xs:double external; - -(:~ - : Returns an integer value, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive)
- : - : @return value of type xs:integer - : @error random:bounds the maximum value is out of bounds. - :) -declare function random:integer() as xs:integer external; - -(:~ - : Returns an integer value, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive)
- : - : @param $max value of type xs:integer - : @return value of type xs:integer - : @error random:bounds the maximum value is out of bounds. - :) -declare function random:integer($max as xs:integer) as xs:integer external; - -(:~ - : Returns a sequence with $num double values between 0.0 (inclusive) and 1.0 (exclusive). The random values are created using the initial seed given in $seed.
- : - : @param $seed value of type xs:integer - : @param $num value of type xs:integer - : @return value of type xs:double* - :) -declare function random:seeded-double($seed as xs:integer, $num as xs:integer) as xs:double* external; - -(:~ - : Returns a sequence with $num integer values, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive). The random values are created using the initial seed given in $seed.
- : - : @param $seed value of type xs:integer - : @param $num value of type xs:integer - : @return value of type xs:integer* - : @error random:bounds the maximum value is out of bounds. - : @error random:negative the number of values to be returned is negative. - :) -declare function random:seeded-integer($seed as xs:integer, $num as xs:integer) as xs:integer* external; - -(:~ - : Returns a sequence with $num integer values, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive). The random values are created using the initial seed given in $seed.
- : - : @param $seed value of type xs:integer - : @param $num value of type xs:integer - : @param $max value of type xs:integer - : @return value of type xs:integer* - : @error random:bounds the maximum value is out of bounds. - : @error random:negative the number of values to be returned is negative. - :) -declare function random:seeded-integer($seed as xs:integer, $num as xs:integer, $max as xs:integer) as xs:integer* external; - -(:~ - : Returns a sequence with $num double values. The random values are Gaussian (i.e. normally) distributed with the mean 0.0. and the derivation 1.0.
- : - : @param $num value of type xs:integer - : @return value of type xs:double* - :) -declare function random:gaussian($num as xs:integer) as xs:double* external; - -(:~ - : Returns a random permutation of the specified $items. The random order is created using the initial seed given in $seed.
- : - : @param $seed value of type xs:integer - : @param $items value of type item()* - : @return value of type item()* - :) -declare function random:seeded-permutation($seed as xs:integer, $items as item()*) as item()* external; - -(:~ - : Creates a random universally unique identifier (UUID), represented as 128-bit value. - : - : @return value of type xs:string - :) -declare function random:uuid() as xs:string external; diff --git a/packages.src/basex-9.7/repo.xqm b/packages.src/basex-9.7/repo.xqm deleted file mode 100644 index 860eaf5..0000000 --- a/packages.src/basex-9.7/repo.xqm +++ /dev/null @@ -1,35 +0,0 @@ -(:~ - : This XQuery Module contains functions for installing, listing and deleting modules contained in the Repository. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Repository_Module - :) -module namespace repo = "http://basex.org/modules/repo"; - -(:~ - : Installs a package or replaces an existing package. The parameter $path indicates the path to the package.
- : - : @param $path value of type xs:string - : @error repo:not-found a package does not exist. - : @error repo:descriptor the package descriptor is invalid. - : @error repo:installed the module contained in the package to be installed is already installed as part of another package. - : @error repo:parse an error occurred while parsing the package. - : @error repo:version the package version is not supported. - :) -declare function repo:install($path as xs:string) as empty-sequence() external; - -(:~ - : Deletes a package. The parameter $pkg indicates the package name, optionally suffixed with a dash and the package version.
- : - : @param $pkg value of type xs:string - : @error repo:not-found a package does not exist. - : @error repo:delete the package cannot be deleted. - :) -declare function repo:delete($pkg as xs:string) as empty-sequence() external; - -(:~ - : Lists the names and versions of all currently installed packages.
- : - : @return value of type element(package)* - :) -declare function repo:list() as element(package)* external; diff --git a/packages.src/basex-9.7/request.xqm b/packages.src/basex-9.7/request.xqm deleted file mode 100644 index 4d98d25..0000000 --- a/packages.src/basex-9.7/request.xqm +++ /dev/null @@ -1,198 +0,0 @@ -(:~ - : This XQuery Module contains functions for retrieving information on an HTTP request that has triggered the query. It is mostly useful when building Web Applications. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Request_Module - :) -module namespace request = "http://exquery.org/ns/request"; - -(:~ - : Returns the Method of the HTTP request. - : - : @return value of type xs:string - :) -declare function request:method() as xs:string external; - -(:~ - : Returns the Scheme component of the URI of an HTTP request. - : - : @return value of type xs:string - :) -declare function request:scheme() as xs:string external; - -(:~ - : Returns the Hostname component of the URI of an HTTP request. - : - : @return value of type xs:string - :) -declare function request:hostname() as xs:string external; - -(:~ - : Returns the Port component of the URI of an HTTP request, or a default port if it has not been explicitly specified in the URI. - : - : @return value of type xs:integer - :) -declare function request:port() as xs:integer external; - -(:~ - : Returns the Path component of the URI of an HTTP request. - : - : @return value of type xs:string - :) -declare function request:path() as xs:string external; - -(:~ - : Returns the Query component of the URI of an HTTP request. If no query component exists, an empty sequence is returned. - : - : @return value of type xs:string? - :) -declare function request:query() as xs:string? external; - -(:~ - : Returns the complete URI of an HTTP request as it has been specified by the client. - : - : @return value of type xs:anyURI - :) -declare function request:uri() as xs:anyURI external; - -(:~ - : Returns the context of the request. For servlets in the default (root) context, this method returns an empty string. - : - : @return value of type xs:string - :) -declare function request:context-path() as xs:string external; - -(:~ - : Returns the IP address of the server. - : - : @return value of type xs:string - :) -declare function request:address() as xs:string external; - -(:~ - : Returns the fully qualified hostname of the client that sent the request. - : - : @return value of type xs:string - :) -declare function request:remote-hostname() as xs:string external; - -(:~ - : Returns the IP address of the client that sent the request. - : - : @return value of type xs:string - :) -declare function request:remote-address() as xs:string external; - -(:~ - : Returns the TCP port of the client socket that triggered the request. - : - : @return value of type xs:string - :) -declare function request:remote-port() as xs:string external; - -(:~ - : Returns the names of all query and form field parameters available from the HTTP request. With RESTXQ, this function can be used to access parameters that have not been statically bound by %rest:query-param. - : - : @return value of type xs:string* - : @error request:parameter the request has invalid parameters. - :) -declare function request:parameter-names() as xs:string* external; - -(:~ - : Returns the value of the named query or form field parameter in an HTTP request. If the parameter does not exist, an empty sequence or the optionally specified default value is returned instead. If both query and form field parameters with the same name exist, the form field values will be attached to the query values. - : - : @param $name value of type xs:string - : @return value of type xs:string* - : @error request:parameter the request has invalid parameters. - :) -declare function request:parameter($name as xs:string) as xs:string* external; - -(:~ - : Returns the value of the named query or form field parameter in an HTTP request. If the parameter does not exist, an empty sequence or the optionally specified default value is returned instead. If both query and form field parameters with the same name exist, the form field values will be attached to the query values. - : - : @param $name value of type xs:string - : @param $default value of type xs:string - : @return value of type xs:string* - : @error request:parameter the request has invalid parameters. - :) -declare function request:parameter($name as xs:string, $default as xs:string) as xs:string* external; - -(:~ - : Returns the names of all headers available from the HTTP request. If RESTXQ is used, this function can be used to access headers that have not been statically bound by %rest:header-param. - : - : @return value of type xs:string* - :) -declare function request:header-names() as xs:string* external; - -(:~ - : Returns the value of the named header in an HTTP request. If the header does not exist, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @return value of type xs:string? - :) -declare function request:header($name as xs:string) as xs:string? external; - -(:~ - : Returns the value of the named header in an HTTP request. If the header does not exist, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @param $default value of type xs:string - : @return value of type xs:string - :) -declare function request:header($name as xs:string, $default as xs:string) as xs:string external; - -(:~ - : Returns the names of all cookies in the HTTP headers available from the HTTP request. If RESTXQ is used, this function can be used to access cookies that have not been statically bound by %rest:cookie-param. - : - : @return value of type xs:string* - :) -declare function request:cookie-names() as xs:string* external; - -(:~ - : Returns the value of the named Cookie in an HTTP request. If there is no such cookie, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @return value of type xs:string? - :) -declare function request:cookie($name as xs:string) as xs:string? external; - -(:~ - : Returns the value of the named Cookie in an HTTP request. If there is no such cookie, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @param $default value of type xs:string - : @return value of type xs:string - :) -declare function request:cookie($name as xs:string, $default as xs:string) as xs:string external; - -(:~ - : Returns the names of all HTTP request attributes. - : - : @return value of type xs:string* - :) -declare function request:attribute-names() as xs:string* external; - -(:~ - : Returns the value of an attribute of the HTTP request. If the attribute does not exist, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @return value of type item()* - :) -declare function request:attribute($name as xs:string) as item()* external; - -(:~ - : Returns the value of an attribute of the HTTP request. If the attribute does not exist, an empty sequence or the optionally specified default value is returned instead. - : - : @param $name value of type xs:string - : @param $default value of type item()* - : @return value of type item()* - :) -declare function request:attribute($name as xs:string, $default as item()*) as item()* external; - -(:~ - : Binds the specified $value to the request attribute with the specified $name. - : - : @param $name value of type xs:string - : @param $value value of type item()* - :) -declare function request:set-attribute($name as xs:string, $value as item()*) as empty-sequence() external; diff --git a/packages.src/basex-9.7/rest.xqm b/packages.src/basex-9.7/rest.xqm deleted file mode 100644 index 2b41505..0000000 --- a/packages.src/basex-9.7/rest.xqm +++ /dev/null @@ -1,41 +0,0 @@ -(:~ - : This XQuery Module contains helper functions for the RESTXQ API, some of which are defined in the RESTXQ Draft. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/RESTXQ_Module - :) -module namespace rest = "http://exquery.org/ns/restxq"; -declare namespace wadl = "http://wadl.dev.java.net/2009/02"; - -(:~ - : Returns the implementation-defined base URI of the resource function. - : - : @return value of type xs:anyURI - :) -declare function rest:base-uri() as xs:anyURI external; - -(:~ - : Returns the complete URI that addresses the Resource Function. This is the result of rest:base-uri appended with the path from the path annotation of the resource function. - : - : @return value of type xs:anyURI - :) -declare function rest:uri() as xs:anyURI external; - -(:~ - : Returns a WADL description of all available REST services. - : - : @return value of type element(wadl:application) - :) -declare function rest:wadl() as element(wadl:application) external; - -(:~ - : Initializes the RESTXQ module cache:
  • By default, the cache will be discarded, and all modules will be parsed and cached again.
  • If $update is enabled, the background caching behavior is simulated (see PARSERESTXQ ): Only updated modules will be parsed.
  • This function should be called if new RESTXQ code is deployed at runtime.
- :) -declare function rest:init() as empty-sequence() external; - -(:~ - : Initializes the RESTXQ module cache:
  • By default, the cache will be discarded, and all modules will be parsed and cached again.
  • If $update is enabled, the background caching behavior is simulated (see PARSERESTXQ ): Only updated modules will be parsed.
  • This function should be called if new RESTXQ code is deployed at runtime.
- : - : @param $update value of type xs:boolean - :) -declare function rest:init($update as xs:boolean) as empty-sequence() external; diff --git a/packages.src/basex-9.7/session.xqm b/packages.src/basex-9.7/session.xqm deleted file mode 100644 index 201868b..0000000 --- a/packages.src/basex-9.7/session.xqm +++ /dev/null @@ -1,76 +0,0 @@ -(:~ - : - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Session_Module - :) -module namespace session = "http://basex.org/modules/session"; - -(:~ - : Returns the session ID of a servlet request. - : - : @return value of type xs:string - : @error session:not-found No session is available for the current client. - :) -declare function session:id() as xs:string external; - -(:~ - : Returns the creation time of a session. - : - : @return value of type xs:dateTime - : @error session:not-found No session is available for the current client. - :) -declare function session:created() as xs:dateTime external; - -(:~ - : Returns the last access time of a session. - : - : @return value of type xs:dateTime - : @error session:not-found No session is available for the current client. - :) -declare function session:accessed() as xs:dateTime external; - -(:~ - : Returns the names of all attributes bound to the current session. - : - : @return value of type xs:string* - :) -declare function session:names() as xs:string* external; - -(:~ - : Returns the value of a session attribute with the specified $name. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $name value of type xs:string - : @return value of type item()* - :) -declare function session:get($name as xs:string) as item()* external; - -(:~ - : Returns the value of a session attribute with the specified $name. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $name value of type xs:string - : @param $default value of type item()* - : @return value of type item()* - :) -declare function session:get($name as xs:string, $default as item()*) as item()* external; - -(:~ - : Binds the specified $value to the session attribute with the specified $name. - : - : @param $name value of type xs:string - : @param $value value of type item()* - : @error session:not-found No session is available for the current client. - :) -declare function session:set($name as xs:string, $value as item()*) as empty-sequence() external; - -(:~ - : Deletes a session attribute with the specified $name. - : - : @param $name value of type xs:string - :) -declare function session:delete($name as xs:string) as empty-sequence() external; - -(:~ - : Unregisters a session and all data associated with it. - :) -declare function session:close() as empty-sequence() external; diff --git a/packages.src/basex-9.7/sessions.xqm b/packages.src/basex-9.7/sessions.xqm deleted file mode 100644 index 49d5a73..0000000 --- a/packages.src/basex-9.7/sessions.xqm +++ /dev/null @@ -1,81 +0,0 @@ -(:~ - : This XQuery Module can only be called from users with Admin permissions. It contains functions for accessing and modifying all registered server-side sessions. This module is mainly useful in the context of Web Applications. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Sessions_Module - :) -module namespace sessions = "http://basex.org/modules/sessions"; - -(:~ - : Returns the IDs of all registered sessions. - : - : @return value of type xs:string* - :) -declare function sessions:ids() as xs:string* external; - -(:~ - : Returns the creation time of the session specified by $id. - : - : @param $id value of type xs:string - : @return value of type xs:dateTime - :) -declare function sessions:created($id as xs:string) as xs:dateTime external; - -(:~ - : Returns the last access time of the session specified by $id. - : - : @param $id value of type xs:string - : @return value of type xs:dateTime - :) -declare function sessions:accessed($id as xs:string) as xs:dateTime external; - -(:~ - : Returns the names of all attributes bound to the session specified by $id. - : - : @param $id value of type xs:string - : @return value of type xs:string* - :) -declare function sessions:names($id as xs:string) as xs:string* external; - -(:~ - : Returns the value of an attribute with the specified $name from the session with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @return value of type item()* - :) -declare function sessions:get($id as xs:string, $name as xs:string) as item()* external; - -(:~ - : Returns the value of an attribute with the specified $name from the session with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @param $default value of type item()* - : @return value of type item()* - :) -declare function sessions:get($id as xs:string, $name as xs:string, $default as item()*) as item()* external; - -(:~ - : Returns the specified value to the attribute with the specified $name from the session with the specified $id. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @param $value value of type item()* - :) -declare function sessions:set($id as xs:string, $name as xs:string, $value as item()*) as empty-sequence() external; - -(:~ - : Deletes an attribute with the specified $name from the session with the specified $id. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - :) -declare function sessions:delete($id as xs:string, $name as xs:string) as empty-sequence() external; - -(:~ - : Unregisters the session specified by $id. - : - : @param $id value of type xs:string - :) -declare function sessions:close($id as xs:string) as empty-sequence() external; diff --git a/packages.src/basex-9.7/sql.xqm b/packages.src/basex-9.7/sql.xqm deleted file mode 100644 index ab23671..0000000 --- a/packages.src/basex-9.7/sql.xqm +++ /dev/null @@ -1,141 +0,0 @@ -(:~ - : This XQuery Module contains functions to access relational databases from XQuery using SQL. With this module, you can execute query, update and prepared statements, and the result sets are returned as sequences of XML elements representing tuples. Each element has children representing the columns returned by the SQL statement. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/SQL_Module - :) -module namespace sql = "http://basex.org/modules/sql"; - -(:~ - : This function initializes a JDBC driver specified via $class. This step might be superfluous if the SQL database is not embedded.
- : - : @param $class value of type xs:string - : @error sql:init the specified driver is not found. - :) -declare function sql:init($class as xs:string) as empty-sequence() external; - -(:~ - : This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:<server> [/<database>]. If the parameters $user and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options. - : - : @param $url value of type xs:string - : @return value of type xs:anyURI - : @error sql:error an SQL exception occurred when connecting to the database. - :) -declare function sql:connect($url as xs:string) as xs:anyURI external; - -(:~ - : This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:<server> [/<database>]. If the parameters $user and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options. - : - : @param $url value of type xs:string - : @param $user value of type xs:string - : @param $password value of type xs:string - : @return value of type xs:anyURI - : @error sql:error an SQL exception occurred when connecting to the database. - :) -declare function sql:connect($url as xs:string, $user as xs:string, $password as xs:string) as xs:anyURI external; - -(:~ - : This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:<server> [/<database>]. If the parameters $user and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options. - : - : @param $url value of type xs:string - : @param $user value of type xs:string - : @param $password value of type xs:string - : @param $options value of type map(*)? - : @return value of type xs:anyURI - : @error sql:error an SQL exception occurred when connecting to the database. - :) -declare function sql:connect($url as xs:string, $user as xs:string, $password as xs:string, $options as map(*)?) as xs:anyURI external; - -(:~ - : This function executes an SQL $statement, using the connection with the specified $id. The returned result depends on the kind of statement:
  • If an update statement was executed, the number of updated rows will be returned as integer.
  • Otherwise, an XML representation of all results will be returned.

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
- : - : @param $id value of type xs:anyURI - : @param $statement value of type xs:string - : @return value of type item()* - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - : @error sql:timeout query execution exceeded timeout. - :) -declare function sql:execute($id as xs:anyURI, $statement as xs:string) as item()* external; - -(:~ - : This function executes an SQL $statement, using the connection with the specified $id. The returned result depends on the kind of statement:
  • If an update statement was executed, the number of updated rows will be returned as integer.
  • Otherwise, an XML representation of all results will be returned.

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
- : - : @param $id value of type xs:anyURI - : @param $statement value of type xs:string - : @param $options value of type map(*)? - : @return value of type item()* - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - : @error sql:timeout query execution exceeded timeout. - :) -declare function sql:execute($id as xs:anyURI, $statement as xs:string, $options as map(*)?) as item()* external; - -(:~ - : This function executes a prepared statement with the specified $id. The output format is identical to sql:execute. The optional parameter $params is an element <sql:parameters/> representing the parameters for a prepared statement along with their types and values. The following schema shall be used:
  element sql:parameters { element sql:parameter { attribute type { "bigdecimal" | "boolean" | "byte" | "date" | "double" | "float" | "int" | "long" | "short" | "sqlxml" | "string" | "time" | "timestamp" }, attribute null { "true" | "false" }?, text } + } ? 

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
- : - : @param $id value of type xs:anyURI - : @param $params value of type element(sql:parameters) - : @return value of type item()* - : @error sql:attribute an attribute different from type and null is set for a <sql:parameter/> element. - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - : @error sql:parameters no parameter type specified. - : @error sql:timeout query execution exceeded timeout. - : @error sql:type the value of a parameter cannot be converted to the specified format. - :) -declare function sql:execute-prepared($id as xs:anyURI, $params as element(sql:parameters)) as item()* external; - -(:~ - : This function executes a prepared statement with the specified $id. The output format is identical to sql:execute. The optional parameter $params is an element <sql:parameters/> representing the parameters for a prepared statement along with their types and values. The following schema shall be used:
  element sql:parameters { element sql:parameter { attribute type { "bigdecimal" | "boolean" | "byte" | "date" | "double" | "float" | "int" | "long" | "short" | "sqlxml" | "string" | "time" | "timestamp" }, attribute null { "true" | "false" }?, text } + } ? 

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
- : - : @param $id value of type xs:anyURI - : @param $params value of type element(sql:parameters) - : @param $options value of type map(*)? - : @return value of type item()* - : @error sql:attribute an attribute different from type and null is set for a <sql:parameter/> element. - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - : @error sql:parameters no parameter type specified. - : @error sql:timeout query execution exceeded timeout. - : @error sql:type the value of a parameter cannot be converted to the specified format. - :) -declare function sql:execute-prepared($id as xs:anyURI, $params as element(sql:parameters), $options as map(*)?) as item()* external; - -(:~ - : This function prepares an SQL $statement, using the specified connection $id, and returns the id reference to this statement. The statement is a string with one or more '?' placeholders. If the value of a field has to be set to NULL, then the attribute null of the <sql:parameter/> element must be true. - : - : @param $id value of type xs:anyURI - : @param $statement value of type xs:string - : @return value of type xs:anyURI - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - :) -declare function sql:prepare($id as xs:anyURI, $statement as xs:string) as xs:anyURI external; - -(:~ - : This function commits the changes made to a relational database, using the specified connection $id. - : - : @param $id value of type xs:anyURI - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - :) -declare function sql:commit($id as xs:anyURI) as empty-sequence() external; - -(:~ - : This function rolls back the changes made to a relational database, using the specified connection $id. - : - : @param $id value of type xs:anyURI - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - :) -declare function sql:rollback($id as xs:anyURI) as empty-sequence() external; - -(:~ - : This function closes a database connection with the specified $id.
Opened connections will automatically be closed after the XQuery expression has been evaluated, but in order to save memory, it is always recommendable to close connections that are not used anymore. - : - : @param $id value of type xs:anyURI - : @error sql:error an error occurred while executing SQL. - : @error sql:id the specified connection does not exist. - :) -declare function sql:close($id as xs:anyURI) as empty-sequence() external; diff --git a/packages.src/basex-9.7/store.xqm b/packages.src/basex-9.7/store.xqm deleted file mode 100644 index f4c4a69..0000000 --- a/packages.src/basex-9.7/store.xqm +++ /dev/null @@ -1,103 +0,0 @@ -(:~ - : This XQuery Module provides functions to organize values in a main-memory key-value store. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Store_Module - :) -module namespace store = "http://basex.org/modules/store"; - -(:~ - : Retrieves an entry from the store with the given $key. If the addressed entry does not exist, an empty sequence is returned. - : - : @param $key value of type xs:string - : @return value of type item()* - :) -declare function store:get($key as xs:string) as item()* external; - -(:~ - : Stores an entry with the given $key and $value in the store:
  • If the value is an empty sequence, the entry is removed.
  • If a value refers to an opened database or is a lazy item, its contents are materialized in main memory.
  • Values with function items are rejected.
- : - : @param $key value of type xs:string - : @param $value value of type item()* - :) -declare function store:put($key as xs:string, $value as item()*) as empty-sequence() external; - -(:~ - : Retrieves an entry from the store with the given $key. The $put function will only be invoked if the entry does not exist, and its result will be stored and returned instead. - : - : @param $key value of type xs:string - : @param $put value of type function( - : @return value of type item()* - :) -declare function store:get-or-put($key as xs:string, $put as function() as item()*) as item()* external; - -(:~ - : Removes an entry with the given $key from the store. No error will be raised if an addressed entry does not exist. - : - : @param $key value of type xs:string - :) -declare function store:remove($key as xs:string) as empty-sequence() external; - -(:~ - : Lists the names of all keys. - : - : @return value of type xs:string* - :) -declare function store:keys() as xs:string* external; - -(:~ - : Resets the store by removing all its entries. - :) -declare function store:clear() as empty-sequence() external; - -(:~ - : Retrieves the standard store from disk, or a custom store if a $name is supplied. - : - : @error store:io The store could not be read. - : @error store:name The specified name is invalid. - : @error store:not-found A store with the specified name does not exist. - :) -declare function store:read() as empty-sequence() external; - -(:~ - : Retrieves the standard store from disk, or a custom store if a $name is supplied. - : - : @param $name value of type xs:string - : @error store:io The store could not be read. - : @error store:name The specified name is invalid. - : @error store:not-found A store with the specified name does not exist. - :) -declare function store:read($name as xs:string) as empty-sequence() external; - -(:~ - : Writes the standard store to disk, or to a custom store file if a $name is supplied. If the standard store is empty, the store file will be deleted. - : - : @error store:io The store could not be written. - : @error store:name The specified name is invalid. - :) -declare function store:write() as empty-sequence() external; - -(:~ - : Writes the standard store to disk, or to a custom store file if a $name is supplied. If the standard store is empty, the store file will be deleted. - : - : @param $name value of type xs:string - : @error store:io The store could not be written. - : @error store:name The specified name is invalid. - :) -declare function store:write($name as xs:string) as empty-sequence() external; - -(:~ - : Lists the names of all custom stores. - : - : @return value of type xs:string* - :) -declare function store:list() as xs:string* external; - -(:~ - : Deletes a custom store from disk. - : - : @param $name value of type xs:string - : @error store:name The specified name is invalid. - : @error store:not-found A store with the specified name does not exist. - :) -declare function store:delete($name as xs:string) as empty-sequence() external; diff --git a/packages.src/basex-9.7/strings.xqm b/packages.src/basex-9.7/strings.xqm deleted file mode 100644 index 594596f..0000000 --- a/packages.src/basex-9.7/strings.xqm +++ /dev/null @@ -1,32 +0,0 @@ -(:~ - : - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Strings_Module - :) -module namespace strings = "http://basex.org/modules/strings"; - -(:~ - : Computes the Damerau-Levenshtein Distance for two strings and returns a double value (0.0 - 1.0). The returned value is computed as follows:
  • 1.0 – distance / max(length of strings)
  • 1.0 is returned if the strings are equal; 0.0 is returned if the strings are too different.
- : - : @param $string1 value of type xs:string - : @param $string2 value of type xs:string - : @return value of type xs:double - :) -declare function strings:levenshtein($string1 as xs:string, $string2 as xs:string) as xs:double external; - -(:~ - : Computes the Soundex value for the specified string. The algorithm can be used to find and index English words with similar pronouncation. - : - : @param $string value of type xs:string - : @return value of type xs:string - :) -declare function strings:soundex($string as xs:string) as xs:string external; - -(:~ - : Computes the Kölner Phonetik value for the specified string. Similar to Soundex, the algorithm is used to find similarly pronounced words, but for the German language. As the first returned digit can be 0, the value is returned as string. - : - : @param $string value of type xs:string - : @return value of type xs:string - :) -declare function strings:cologne-phonetic($string as xs:string) as xs:string external; diff --git a/packages.src/basex-9.7/unit.xqm b/packages.src/basex-9.7/unit.xqm deleted file mode 100644 index 47e4c49..0000000 --- a/packages.src/basex-9.7/unit.xqm +++ /dev/null @@ -1,58 +0,0 @@ -(:~ - : This XQuery Module contains annotations and functions for performing XQUnit tests. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Unit_Module - :) -module namespace unit = "http://basex.org/modules/unit"; - -(:~ - : Asserts that the effective boolean value of the specified $test is true and returns an empty sequence. Otherwise, raises an error. The effective boolean value of an expression can be explicitly computed by using the fn:boolean function.
The default failure message can be overridden with the $info argument. - : - : @param $test value of type item()* - : @error unit:fail the assertion failed, or an error was raised. - :) -declare function unit:assert($test as item()*) as empty-sequence() external; - -(:~ - : Asserts that the effective boolean value of the specified $test is true and returns an empty sequence. Otherwise, raises an error. The effective boolean value of an expression can be explicitly computed by using the fn:boolean function.
The default failure message can be overridden with the $info argument. - : - : @param $test value of type item()* - : @param $info value of type item() - : @error unit:fail the assertion failed, or an error was raised. - :) -declare function unit:assert($test as item()*, $info as item()) as empty-sequence() external; - -(:~ - : Asserts that the specified arguments are equal according to the rules of the fn:deep-equal function. Otherwise, raises an error.
The default failure message can be overridden with the $info argument. - : - : @param $returned value of type item()* - : @param $expected value of type item()* - : @error unit:fail the assertion failed, or an error was raised. - :) -declare function unit:assert-equals($returned as item()*, $expected as item()*) as empty-sequence() external; - -(:~ - : Asserts that the specified arguments are equal according to the rules of the fn:deep-equal function. Otherwise, raises an error.
The default failure message can be overridden with the $info argument. - : - : @param $returned value of type item()* - : @param $expected value of type item()* - : @param $info value of type item() - : @error unit:fail the assertion failed, or an error was raised. - :) -declare function unit:assert-equals($returned as item()*, $expected as item()*, $info as item()) as empty-sequence() external; - -(:~ - : Raises a unit error. The default failure message can be overridden with the $info argument. - : - : @error unit:fail default error raised by this function. - :) -declare function unit:fail() as empty-sequence() external; - -(:~ - : Raises a unit error. The default failure message can be overridden with the $info argument. - : - : @param $info value of type item() - : @error unit:fail default error raised by this function. - :) -declare function unit:fail($info as item()) as empty-sequence() external; diff --git a/packages.src/basex-9.7/update.xqm b/packages.src/basex-9.7/update.xqm deleted file mode 100644 index d9b3f67..0000000 --- a/packages.src/basex-9.7/update.xqm +++ /dev/null @@ -1,63 +0,0 @@ -(:~ - : This XQuery Module provides additional functions for performing updates and returning results in updating expressions. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Update_Module - :) -module namespace update = "http://basex.org/modules/update"; - -(:~ - : The updating variant of fn:apply applies the specified updating $function to the specified $arguments. - : - : @param $function value of type function(*) - : @param $arguments value of type array(*) - :) -declare function update:apply($function as function(*), $arguments as array(*)) as empty-sequence() external; - -(:~ - : The updating variant of fn:for-each applies the specified updating $function to every item of $seq. - : - : @param $seq value of type item()* - : @param $function value of type function(item() - :) -declare function update:for-each($seq as item()*, $function as function(item()) as item()*) as empty-sequence() external; - -(:~ - : The updating variant of fn:for-each-pair applies the specified updating $function to the successive pairs of items of $seq1 and $seq2. Evaluation is stopped if one sequence yields no more items. - : - : @param $seq1 value of type item()* - : @param $function value of type function(item() - :) -declare function update:for-each-pair($seq1 as item()*, $function as function(item()) as item()*) as empty-sequence() external; - -(:~ - : The updating variant of map:for-each applies the specified $function to every key/value pair of the supplied $map and returns the results as a sequence. - : - : @param $map value of type map(*) - : @param $function value of type function(xs:anyAtomicType - : @param item()* value of type - : @return value of type item()* - :) -declare function update:map-for-each($map as map(*), $function as function(xs:anyAtomicType, item()*) as item()*) as item()* external; - -(:~ - : This function can be used if MIXUPDATES is not enabled, and if values need to returned within an updating expression: The supplied $items will be cached and returned at the very end, i.e., after all updates on the pending update list have been processed. If one of the supplied items is affected by an update, a copy will be created and cached instead. - : - : @param $items value of type item()* - :) -declare function update:output($items as item()*) as empty-sequence() external; - -(:~ - : Returns the items that have been cached by update:output. The output cache can optionally be $reset. The function can be used to check which items will eventually be returned as result of an updating function.
This function is non-deterministic: It will return different results before and after items have been cached. It is e. g. useful when writing unit tests. - : - : @return value of type item()* - :) -declare function update:cache() as item()* external; - -(:~ - : Returns the items that have been cached by update:output. The output cache can optionally be $reset. The function can be used to check which items will eventually be returned as result of an updating function.
This function is non-deterministic: It will return different results before and after items have been cached. It is e. g. useful when writing unit tests. - : - : @param $reset value of type xs:boolean - : @return value of type item()* - :) -declare function update:cache($reset as xs:boolean) as item()* external; diff --git a/packages.src/basex-9.7/user.xqm b/packages.src/basex-9.7/user.xqm deleted file mode 100644 index 4907ab3..0000000 --- a/packages.src/basex-9.7/user.xqm +++ /dev/null @@ -1,233 +0,0 @@ -(:~ - : This XQuery Module contains functions for creating and administering database users. The User Management article gives more information on database users and permissions. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/User_Module - :) -module namespace user = "http://basex.org/modules/user"; - -(:~ - : Returns the name of the currently logged in user. - : - : @return value of type xs:string - :) -declare function user:current() as xs:string external; - -(:~ - : Returns the names of all registered users that are visible to the current user. - : - : @return value of type xs:string* - :) -declare function user:list() as xs:string* external; - -(:~ - : Returns an element sequence, containing all registered users that are visible to the current user.
In addition to the SHOW USERS command, encoded password strings and database permissions will be output. A user $name can be specified to filter the results in advance. - : - : @return value of type element(user)* - : @error user:unknown The specified user name is unknown. - :) -declare function user:list-details() as element(user)* external; - -(:~ - : Returns an element sequence, containing all registered users that are visible to the current user.
In addition to the SHOW USERS command, encoded password strings and database permissions will be output. A user $name can be specified to filter the results in advance. - : - : @param $name value of type xs:string - : @return value of type element(user)* - : @error user:unknown The specified user name is unknown. - :) -declare function user:list-details($name as xs:string) as element(user)* external; - -(:~ - : Checks if a user with the specified $name exists. - : - : @param $name value of type xs:string - : @return value of type xs:boolean - : @error user:name The specified user name is invalid. - :) -declare function user:exists($name as xs:string) as xs:boolean external; - -(:~ - : Checks if the specified user and password is correct. Raises errors otherwise. - : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @error user:name The specified user name is invalid. - : @error user:unknown The specified user does not exist. - : @error user:password The specified password is wrong. - :) -declare function user:check($name as xs:string, $password as xs:string) as empty-sequence() external; - -(:~ - : Returns an info element, which may contain application-specific data. If a user $name is supplied, a user-specific element is returned. By default, the returned element has no contents. It can be modified via user:update-info. - : - : @return value of type element(info) - :) -declare function user:info() as element(info) external; - -(:~ - : Returns an info element, which may contain application-specific data. If a user $name is supplied, a user-specific element is returned. By default, the returned element has no contents. It can be modified via user:update-info. - : - : @param $name value of type xs:string - : @return value of type element(info) - :) -declare function user:info($name as xs:string) as element(info) external; - -(:~ - : Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
- : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @error user:name The specified user name is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:create($name as xs:string, $password as xs:string) as empty-sequence() external; - -(:~ - : Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
- : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @param $permissions value of type xs:string* - : @error user:name The specified user name is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:create($name as xs:string, $password as xs:string, $permissions as xs:string*) as empty-sequence() external; - -(:~ - : Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
- : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @param $permissions value of type xs:string* - : @param $patterns value of type xs:string* - : @error user:name The specified user name is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:create($name as xs:string, $password as xs:string, $permissions as xs:string*, $patterns as xs:string*) as empty-sequence() external; - -(:~ - : Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
- : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @param $permissions value of type xs:string* - : @param $patterns value of type xs:string* - : @param $info value of type element(info) - : @error user:name The specified user name is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:create($name as xs:string, $password as xs:string, $permissions as xs:string*, $patterns as xs:string*, $info as element(info)) as empty-sequence() external; - -(:~ - : Grants global or local $permissions to a user with the specified $name. Local permissions are granted with non-empty glob $patterns. - : - : @param $name value of type xs:string - : @param $permissions value of type xs:string* - : @error user:unknown The specified user name is unknown. - : @error user:name The specified user name is invalid. - : @error user:pattern The specified database pattern is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:local A local permission can only be 'none', 'read' or 'write'. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:grant($name as xs:string, $permissions as xs:string*) as empty-sequence() external; - -(:~ - : Grants global or local $permissions to a user with the specified $name. Local permissions are granted with non-empty glob $patterns. - : - : @param $name value of type xs:string - : @param $permissions value of type xs:string* - : @param $patterns value of type xs:string* - : @error user:unknown The specified user name is unknown. - : @error user:name The specified user name is invalid. - : @error user:pattern The specified database pattern is invalid. - : @error user:permission The specified permission is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:local A local permission can only be 'none', 'read' or 'write'. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:grant($name as xs:string, $permissions as xs:string*, $patterns as xs:string*) as empty-sequence() external; - -(:~ - : Drops a user with the specified $name. If non-empty glob $patterns are specified, only the database patterns will be removed. - : - : @param $name value of type xs:string - : @error user:unknown The specified user name is unknown. - : @error user:name The specified user name is invalid. - : @error user:pattern The specified database pattern is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - : @error user:conflict A user cannot be both altered and dropped. - :) -declare function user:drop($name as xs:string) as empty-sequence() external; - -(:~ - : Drops a user with the specified $name. If non-empty glob $patterns are specified, only the database patterns will be removed. - : - : @param $name value of type xs:string - : @param $patterns value of type xs:string* - : @error user:unknown The specified user name is unknown. - : @error user:name The specified user name is invalid. - : @error user:pattern The specified database pattern is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - : @error user:conflict A user cannot be both altered and dropped. - :) -declare function user:drop($name as xs:string, $patterns as xs:string*) as empty-sequence() external; - -(:~ - : Renames a user with the specified $name to $newname. - : - : @param $name value of type xs:string - : @param $newname value of type xs:string - : @error user:unknown The specified user name is unknown. - : @error user:name The specified user name is invalid. - : @error user:admin The "admin" user cannot be modified. - : @error user:logged-in The specified user is currently logged in. - : @error user:update The operation can only be performed once per user or database pattern. - : @error user:conflict A user cannot be both altered and dropped. - :) -declare function user:alter($name as xs:string, $newname as xs:string) as empty-sequence() external; - -(:~ - : Changes the password of a user with the specified $name. - : - : @param $name value of type xs:string - : @param $password value of type xs:string - : @error user:unknown The specified user name is unknown. - : @error user:name The specified user name is invalid. - : @error user:update The operation can only be performed once per user or database pattern. - :) -declare function user:password($name as xs:string, $password as xs:string) as empty-sequence() external; - -(:~ - : Assigns the specified $info element to the user management or, if $name is supplied, to a specific user. This function can be used to manage application-specific data (groups, enhanced user info, etc.). - : - : @param $info value of type element(info) - :) -declare function user:update-info($info as element(info)) as empty-sequence() external; - -(:~ - : Assigns the specified $info element to the user management or, if $name is supplied, to a specific user. This function can be used to manage application-specific data (groups, enhanced user info, etc.). - : - : @param $info value of type element(info) - : @param $name value of type xs:string - :) -declare function user:update-info($info as element(info), $name as xs:string) as empty-sequence() external; diff --git a/packages.src/basex-9.7/util.xqm b/packages.src/basex-9.7/util.xqm deleted file mode 100644 index f772dda..0000000 --- a/packages.src/basex-9.7/util.xqm +++ /dev/null @@ -1,209 +0,0 @@ -(:~ - : This XQuery Module contains various utility and helper functions. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Utility_Module - :) -module namespace util = "http://basex.org/modules/util"; - -(:~ - : Alternative writing for the if/then/else expression:
  • If the effective boolean value of $condition is true, the $then branch will be evaluated.
  • Otherwise, $else will be evaluated. If no third argument is supplied, an empty sequence will be returned.
- : - : @param $condition value of type item()* - : @param $then value of type item()* - : @return value of type item()* - :) -declare function util:if($condition as item()*, $then as item()*) as item()* external; - -(:~ - : Alternative writing for the if/then/else expression:
  • If the effective boolean value of $condition is true, the $then branch will be evaluated.
  • Otherwise, $else will be evaluated. If no third argument is supplied, an empty sequence will be returned.
- : - : @param $condition value of type item()* - : @param $then value of type item()* - : @param $else value of type item()* - : @return value of type item()* - :) -declare function util:if($condition as item()*, $then as item()*, $else as item()*) as item()* external; - -(:~ - : Returns $items if it is a non-empty sequence. Otherwise, returns $default. Equivalent to the following expressions:
  if ( exists ( $ items )) then $ items else $ default , (: Elvis operator :) $ items ?: $ default 
- : - : @param $items value of type item()* - : @param $default value of type item()* - : @return value of type item()* - :) -declare function util:or($items as item()*, $default as item()*) as item()* external; - -(:~ - : Checks if the specified $sequence has at least $min and, optionally, at most $max items. Equivalent to:
  let $ count := count ( $ sequence ) return $ count >= $ min and $ count <= $ max 
- : - : @param $sequence value of type item()* - : @param $min value of type xs:integer - : @return value of type xs:boolean - :) -declare function util:count-within($sequence as item()*, $min as xs:integer) as xs:boolean external; - -(:~ - : Checks if the specified $sequence has at least $min and, optionally, at most $max items. Equivalent to:
  let $ count := count ( $ sequence ) return $ count >= $ min and $ count <= $ max 
- : - : @param $sequence value of type item()* - : @param $min value of type xs:integer - : @param $max value of type xs:integer - : @return value of type xs:boolean - :) -declare function util:count-within($sequence as item()*, $min as xs:integer, $max as xs:integer) as xs:boolean external; - -(:~ - : Returns the item from $sequence at the specified $position. Equivalent to:
  $ sequence [ $ position ] 
- : - : @param $sequence value of type item()* - : @param $position value of type xs:double - : @return value of type item()? - :) -declare function util:item($sequence as item()*, $position as xs:double) as item()? external; - -(:~ - : Returns items from $sequence, starting at position $first and ending at $last. Equivalent to:
  subsequence ( $ sequence , $ first , $ last - $ first + 1 ) 
- : - : @param $sequence value of type item()* - : @param $first value of type xs:double - : @param $last value of type xs:double - : @return value of type item()* - :) -declare function util:range($sequence as item()*, $first as xs:double, $last as xs:double) as item()* external; - -(:~ - : Returns last item of a $sequence. Equivalent to:
  $ sequence [ last ()] 
- : - : @param $sequence value of type item()* - : @return value of type item()? - :) -declare function util:last($sequence as item()*) as item()? external; - -(:~ - : Returns all items of a $sequence except for the last one. Equivalent to:
  $ sequence [ position () < last ()] 
- : - : @param $sequence value of type item()* - : @return value of type item()* - :) -declare function util:init($sequence as item()*) as item()* external; - -(:~ - : Returns nodes in distinct document order: duplicate nodes will be removed, and the remaining nodes will be returned in document order. As results of path expressions are brought distinct document order before they are returned, the function is equivalent to:
  $ nodes / self :: node () 
- : - : @param $nodes value of type node()* - : @return value of type node()* - :) -declare function util:ddo($nodes as node()*) as node()* external; - -(:~ - : Returns the document nodes of the specified $nodes. The path expression /abc is internally represented as util:root(.)/abc</code. Equivalent to:
   $ nodes ! /  
- : - : @param $nodes value of type node()* - : @return value of type document-node()* - :) -declare function util:root($nodes as node()*) as document-node()* external; - -(:~ - : Removes namespaces with the specified $prefixes from the supplied $node. An empty string can be supplied to remove the default namespace. If no prefixes are specified, all namespaces will be removed. - : - : @param $node value of type node() - : @return value of type node() - :) -declare function util:strip-namespaces($node as node()) as node() external; - -(:~ - : Removes namespaces with the specified $prefixes from the supplied $node. An empty string can be supplied to remove the default namespace. If no prefixes are specified, all namespaces will be removed. - : - : @param $node value of type node() - : @param $prefixes value of type xs:string* - : @return value of type node() - :) -declare function util:strip-namespaces($node as node(), $prefixes as xs:string*) as node() external; - -(:~ - : Returns each member of an $array as a new array. Equivalent to:
  for $ a in 1 to array:size ( $ array ) return [ $ array ( $ a ) ] 
- : - : @param $array value of type array(*) - : @return value of type array(*)* - :) -declare function util:array-members($array as array(*)) as array(*)* external; - -(:~ - : Returns all members of an $array as a sequence. Equivalent to:
  $ array ? * 
- : - : @param $array value of type array(*) - : @return value of type item()* - :) -declare function util:array-values($array as array(*)) as item()* external; - -(:~ - : Returns each entry of a $map as a new map, each with a key and value entry. Equivalent to:
  map:for-each ( $ map , function ( $ key , $ value ) { map { "key" : $ key , "value" : $ value } }) 
- : - : @param $map value of type map(*) - : @return value of type map(xs:string, item()*)* - :) -declare function util:map-entries($map as map(*)) as map(xs:string, item()*)* external; - -(:~ - : Returns all values of a $map as a sequence. Equivalent to:
  $ map ? * 
- : - : @param $map value of type map(*) - : @return value of type item()* - :) -declare function util:map-values($map as map(*)) as item()* external; - -(:~ - : Evaluates $input and returns the result $count times. Unless $multiple is enabled, the input expression is only evaluated once. Equivalent expressions:
  util:replicate ( $ input , $ count , true ()), ( 1 to $ count ) ! $ input 
- : - : @param $input value of type item()* - : @param $count value of type xs:integer - : @return value of type item()* - : @error util:negative The specified number is negative. - :) -declare function util:replicate($input as item()*, $count as xs:integer) as item()* external; - -(:~ - : Evaluates $input and returns the result $count times. Unless $multiple is enabled, the input expression is only evaluated once. Equivalent expressions:
  util:replicate ( $ input , $ count , true ()), ( 1 to $ count ) ! $ input 
- : - : @param $input value of type item()* - : @param $count value of type xs:integer - : @param $multiple value of type xs:boolean - : @return value of type item()* - : @error util:negative The specified number is negative. - :) -declare function util:replicate($input as item()*, $count as xs:integer, $multiple as xs:boolean) as item()* external; - -(:~ - : Inserts the defined $separator between the $items of a sequence and returns the resulting sequence. Equivalent to:
  head ( $ items ), for $ item in tail ( $ items ) return ( $ separator , $ item ) 
- : - : @param $items value of type item()* - : @param $separator value of type item()* - : @return value of type item()* - :) -declare function util:intersperse($items as item()*, $separator as item()*) as item()* external; - -(:~ - : Returns duplicate values in a $sequence. See fn:distinct-values for the applied equality rules and the usage of the $collation argument. - : - : @param $sequence value of type item()* - : @return value of type xs:anyAtomicType* - :) -declare function util:duplicates($sequence as item()*) as xs:anyAtomicType* external; - -(:~ - : Returns duplicate values in a $sequence. See fn:distinct-values for the applied equality rules and the usage of the $collation argument. - : - : @param $sequence value of type item()* - : @param $collation value of type xs:string - : @return value of type xs:anyAtomicType* - :) -declare function util:duplicates($sequence as item()*, $collation as xs:string) as xs:anyAtomicType* external; - -(:~ - : Returns all characters of a $string as a sequence. Equivalent to:
  for $ cp in string-to-codepoints ( $ string ) return codepoints-to-string ( $ cp ) 
- : - : @param $string value of type xs:string - : @return value of type xs:string* - :) -declare function util:chars($string as xs:string) as xs:string* external; diff --git a/packages.src/basex-9.7/validate.xqm b/packages.src/basex-9.7/validate.xqm deleted file mode 100644 index 2122464..0000000 --- a/packages.src/basex-9.7/validate.xqm +++ /dev/null @@ -1,252 +0,0 @@ -(:~ - : This XQuery Module contains functions to perform validations against DTDs, XML Schema and RelaxNG. The documentation further describes how to use Schematron validation with BaseX. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Validation_Module - :) -module namespace validate = "http://basex.org/modules/validate"; - -(:~ - : Validates the XML $input document against a $schema and returns an empty sequence or an error. - : - : @param $input value of type item() - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd($input as item()) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema and returns an empty sequence or an error. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd($input as item(), $schema as xs:string?) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd-info($input as item()) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd-info($input as item(), $schema as xs:string?) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd-report($input as item()) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no DTD validator is available. - :) -declare function validate:dtd-report($input as item(), $schema as xs:string?) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features. - : - : @param $input value of type item() - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd($input as item()) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features. - : - : @param $input value of type item() - : @param $schema value of type item()? - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd($input as item(), $schema as item()?) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features. - : - : @param $input value of type item() - : @param $schema value of type item()? - : @param $features value of type map(*) - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd($input as item(), $schema as item()?, $features as map(*)) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd-info($input as item()) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type item()? - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd-info($input as item(), $schema as item()?) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type item()? - : @param $features value of type map(*) - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd-info($input as item(), $schema as item()?, $features as map(*)) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd-report($input as item()) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd-report($input as item(), $schema as xs:string?) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string? - : @param $features value of type map(*) - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found no XML Schema validator is available. - :) -declare function validate:xsd-report($input as item(), $schema as xs:string?, $features as map(*)) as element(report) external; - -(:~ - : Returns the name of the applied XSD processor. - : - : @return value of type xs:string - :) -declare function validate:xsd-processor() as xs:string external; - -(:~ - : Returns the supported version of XSD Schema. - : - : @return value of type xs:string - :) -declare function validate:xsd-version() as xs:string external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation. - : - : @param $input value of type item() - : @param $schema value of type item() - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found the RelaxNG validator is not available. - :) -declare function validate:rng($input as item(), $schema as item()) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation. - : - : @param $input value of type item() - : @param $schema value of type item() - : @param $compact value of type xs:boolean - : @error validate:error the validation fails. - : @error validate:init the validation process cannot be started. - : @error validate:not-found the RelaxNG validator is not available. - :) -declare function validate:rng($input as item(), $schema as item(), $compact as xs:boolean) as empty-sequence() external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type item() - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found the RelaxNG validator is not available. - :) -declare function validate:rng-info($input as item(), $schema as item()) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors in a string sequence. - : - : @param $input value of type item() - : @param $schema value of type item() - : @param $compact value of type xs:boolean - : @return value of type xs:string* - : @error validate:init the validation process cannot be started. - : @error validate:not-found the RelaxNG validator is not available. - :) -declare function validate:rng-info($input as item(), $schema as item(), $compact as xs:boolean) as xs:string* external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found The RelaxNG validator is not available. - :) -declare function validate:rng-report($input as item(), $schema as xs:string) as element(report) external; - -(:~ - : Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors as XML. - : - : @param $input value of type item() - : @param $schema value of type xs:string - : @param $compact value of type xs:boolean - : @return value of type element(report) - : @error validate:init the validation process cannot be started. - : @error validate:not-found The RelaxNG validator is not available. - :) -declare function validate:rng-report($input as item(), $schema as xs:string, $compact as xs:boolean) as element(report) external; diff --git a/packages.src/basex-9.7/web.xqm b/packages.src/basex-9.7/web.xqm deleted file mode 100644 index 7c2128b..0000000 --- a/packages.src/basex-9.7/web.xqm +++ /dev/null @@ -1,139 +0,0 @@ -(:~ - : This XQuery Module provides convenience functions for building web applications with RESTXQ. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/Web_Module - :) -module namespace web = "http://basex.org/modules/web"; - -(:~ - : Returns the content type of a path by analyzing its file suffix. application/octet-stream is returned if the file suffix is unknown. - : - : @param $path value of type xs:string - : @return value of type xs:string - :) -declare function web:content-type($path as xs:string) as xs:string external; - -(:~ - : Creates a new URL from the specified $url string, query string $parameters and an optional $anchor reference. The keys and values of the map entries will be converted to strings, URL-encoded (see web:encode-url), and appended to the URL as query parameters. If a map entry has more than a single item, all of them will be appended as single parameters. - : - : @param $url value of type xs:string - : @param $parameters value of type map(*) - : @return value of type xs:string - :) -declare function web:create-url($url as xs:string, $parameters as map(*)) as xs:string external; - -(:~ - : Creates a new URL from the specified $url string, query string $parameters and an optional $anchor reference. The keys and values of the map entries will be converted to strings, URL-encoded (see web:encode-url), and appended to the URL as query parameters. If a map entry has more than a single item, all of them will be appended as single parameters. - : - : @param $url value of type xs:string - : @param $parameters value of type map(*) - : @param $anchor value of type xs:string - : @return value of type xs:string - :) -declare function web:create-url($url as xs:string, $parameters as map(*), $anchor as xs:string) as xs:string external; - -(:~ - : Encodes a string to a URL. Spaces are rewritten to +; *, -, . and _ are adopted; and all other non-ASCII characters and special characters are percent-encoded. - : - : @param $string value of type xs:string - : @return value of type xs:string - :) -declare function web:encode-url($string as xs:string) as xs:string external; - -(:~ - : Decodes a URL to the original string. Percent-encoded characters are decoded to their UTF8 codepoints, and + characters are rewritten to spaces. - : - : @param $string value of type xs:string - : @return value of type xs:string - : @error web:invalid the string contains invalid XML characters. - :) -declare function web:decode-url($string as xs:string) as xs:string external; - -(:~ - : Creates a server-side RESTXQ forward request to the specified $path:
  • The client will not get notified of this forwarding.
  • Supplied query parameters will be attached to parameters of the current request.
  • The $parameter argument is processed as described in web:create-url.
- : - : @param $path value of type xs:string - : @return value of type element(rest:forward) - :) -declare function web:forward($path as xs:string) as element(rest:forward) external; - -(:~ - : Creates a server-side RESTXQ forward request to the specified $path:
  • The client will not get notified of this forwarding.
  • Supplied query parameters will be attached to parameters of the current request.
  • The $parameter argument is processed as described in web:create-url.
- : - : @param $path value of type xs:string - : @param $parameters value of type map(*) - : @return value of type element(rest:forward) - :) -declare function web:forward($path as xs:string, $parameters as map(*)) as element(rest:forward) external; - -(:~ - : Creates a RESTXQ redirection to the specified $url. The returned response will only work if no other items are returned by the RESTXQ function.
The $parameters and $anchor arguments are processed as described in (see web:create-url). - : - : @param $url value of type xs:string - : @return value of type element(rest:response) - :) -declare function web:redirect($url as xs:string) as element(rest:response) external; - -(:~ - : Creates a RESTXQ redirection to the specified $url. The returned response will only work if no other items are returned by the RESTXQ function.
The $parameters and $anchor arguments are processed as described in (see web:create-url). - : - : @param $url value of type xs:string - : @param $parameters value of type map(*) - : @return value of type element(rest:response) - :) -declare function web:redirect($url as xs:string, $parameters as map(*)) as element(rest:response) external; - -(:~ - : Creates a RESTXQ redirection to the specified $url. The returned response will only work if no other items are returned by the RESTXQ function.
The $parameters and $anchor arguments are processed as described in (see web:create-url). - : - : @param $url value of type xs:string - : @param $parameters value of type map(*) - : @param $anchor value of type xs:string - : @return value of type element(rest:response) - :) -declare function web:redirect($url as xs:string, $parameters as map(*), $anchor as xs:string) as element(rest:response) external; - -(:~ - : Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
- : - : @return value of type element(rest:response) - :) -declare function web:response-header() as element(rest:response) external; - -(:~ - : Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
- : - : @param $output value of type map(*)? - : @return value of type element(rest:response) - :) -declare function web:response-header($output as map(*)?) as element(rest:response) external; - -(:~ - : Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
- : - : @param $output value of type map(*)? - : @param $headers value of type map(*)? - : @return value of type element(rest:response) - :) -declare function web:response-header($output as map(*)?, $headers as map(*)?) as element(rest:response) external; - -(:~ - : Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
- : - : @param $output value of type map(*)? - : @param $headers value of type map(*)? - : @param $atts value of type map(*)? - : @return value of type element(rest:response) - :) -declare function web:response-header($output as map(*)?, $headers as map(*)?, $atts as map(*)?) as element(rest:response) external; - -(:~ - : Raises an error with the QName rest:error, the specified $message and the specified $status as error value.
Calls to this function are equivalent to fn:error(xs:QName('rest:error'), $message, $status).

See RESTXQ: Raise Errors to learn how the function is helpful in web applications.

- : - : @param $status value of type xs:integer - : @param $message value of type xs:string - : @return value of type none - : @error web:status The supplied status code is invalid. - :) -declare function web:error($status as xs:integer, $message as xs:string) as none external; diff --git a/packages.src/basex-9.7/ws.xqm b/packages.src/basex-9.7/ws.xqm deleted file mode 100644 index b4ec90e..0000000 --- a/packages.src/basex-9.7/ws.xqm +++ /dev/null @@ -1,134 +0,0 @@ -(:~ - : This XQuery Module contains functions for accessing specific WebSocket functions. This module is mainly useful in the context of WebSockets. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/WebSocket_Module - :) -module namespace ws = "http://basex.org/modules/ws"; - -(:~ - : Returns the ID of the current WebSocket. - : - : @return value of type xs:string - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:id() as xs:string external; - -(:~ - : Returns the ids of all currently registered WebSockets. - : - : @return value of type xs:string* - :) -declare function ws:ids() as xs:string* external; - -(:~ - : Returns the path of the WebSocket with the specified $id. - : - : @param $id value of type xs:string - : @return value of type xs:string - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:path($id as xs:string) as xs:string external; - -(:~ - : Closes the connection of the WebSocket with the specified $id. - : - : @param $id value of type xs:string - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:close($id as xs:string) as empty-sequence() external; - -(:~ - : Sends a $message to the clients with the specified $ids. Ids that cannot be assigned to clients will be ignored. The message will be handled as follows:
  • Items of type xs:base64Binary and xs:hexBinary will be transmitted as binary messages.
  • Function items (maps, arrays) will be serialized as JSON and transmitted as string messages.
  • All other items will be serialized with the default serialization options and transmitted as string messages.
- : - : @param $message value of type item() - : @param $ids value of type xs:string* - :) -declare function ws:send($message as item(), $ids as xs:string*) as empty-sequence() external; - -(:~ - : Broadcasts a $message to all connected clients except to the caller. Invocations of this convenience function are equivalent to ws:send($message, ws:ids()[. != ws:id()]). See ws:send for more details on the message handling. - : - : @param $message value of type xs:anyAtomicType - :) -declare function ws:broadcast($message as xs:anyAtomicType) as empty-sequence() external; - -(:~ - : Emits a $message to all connected clients. Invocations of this function are equivalent to ws:send($message, ws:ids()). See ws:send for more details on the message handling. - : - : @param $message value of type xs:anyAtomicType - :) -declare function ws:emit($message as xs:anyAtomicType) as empty-sequence() external; - -(:~ - : Schedules the evaluation of the supplied $query and returns the result to the calling WebSocket client. The query can be a URI or a string, and variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.

Query scheduling is recommendable if the immediate query execution might be too time consuming and lead to a timeout.

- : - : @param $query value of type xs:anyAtomicItem - : @return value of type xs:string - : @error ws:overflow Query execution is rejected, because too many jobs are queued or being executed. - : @error ws:id The specified id is invalid or has already been assigned. - :) -declare function ws:eval($query as xs:anyAtomicItem) as xs:string external; - -(:~ - : Schedules the evaluation of the supplied $query and returns the result to the calling WebSocket client. The query can be a URI or a string, and variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.

Query scheduling is recommendable if the immediate query execution might be too time consuming and lead to a timeout.

- : - : @param $query value of type xs:anyAtomicItem - : @param $bindings value of type map(*)? - : @return value of type xs:string - : @error ws:overflow Query execution is rejected, because too many jobs are queued or being executed. - : @error ws:id The specified id is invalid or has already been assigned. - :) -declare function ws:eval($query as xs:anyAtomicItem, $bindings as map(*)?) as xs:string external; - -(:~ - : Schedules the evaluation of the supplied $query and returns the result to the calling WebSocket client. The query can be a URI or a string, and variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.

Query scheduling is recommendable if the immediate query execution might be too time consuming and lead to a timeout.

- : - : @param $query value of type xs:anyAtomicItem - : @param $bindings value of type map(*)? - : @param $options value of type map(*)? - : @return value of type xs:string - : @error ws:overflow Query execution is rejected, because too many jobs are queued or being executed. - : @error ws:id The specified id is invalid or has already been assigned. - :) -declare function ws:eval($query as xs:anyAtomicItem, $bindings as map(*)?, $options as map(*)?) as xs:string external; - -(:~ - : Returns the value of an attribute with the specified $name from the WebSocket with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @return value of type item()* - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:get($id as xs:string, $name as xs:string) as item()* external; - -(:~ - : Returns the value of an attribute with the specified $name from the WebSocket with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @param $default value of type item()* - : @return value of type item()* - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:get($id as xs:string, $name as xs:string, $default as item()*) as item()* external; - -(:~ - : Returns the specified value of the attribute with the specified $name from the WebSocket with the specified $id. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @param $value value of type item()* - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:set($id as xs:string, $name as xs:string, $value as item()*) as empty-sequence() external; - -(:~ - : Deletes an attribute with the specified $name from the WebSocket with the specified $id. - : - : @param $id value of type xs:string - : @param $name value of type xs:string - : @error ws:not-found No WebSocket with the specified id exists. - :) -declare function ws:delete($id as xs:string, $name as xs:string) as empty-sequence() external; diff --git a/packages.src/basex-9.7/xquery.xqm b/packages.src/basex-9.7/xquery.xqm deleted file mode 100644 index 07f9e02..0000000 --- a/packages.src/basex-9.7/xquery.xqm +++ /dev/null @@ -1,117 +0,0 @@ -(:~ - : This XQuery Module contains functions for parsing and evaluating XQuery strings at runtime, and to run code in parallel. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/XQuery_Module - :) -module namespace xquery = "http://basex.org/modules/xquery"; - -(:~ - : Evaluates the supplied $query and returns the resulting items. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string.

Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:

  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. Overwrites the base URI of the query; will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
- : - : @param $query value of type xs:anyAtomicType - : @return value of type item()* - : @error xquery:update the query contains updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval($query as xs:anyAtomicType) as item()* external; - -(:~ - : Evaluates the supplied $query and returns the resulting items. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string.

Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:

  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. Overwrites the base URI of the query; will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
- : - : @param $query value of type xs:anyAtomicType - : @param $bindings value of type map(*)? - : @return value of type item()* - : @error xquery:update the query contains updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval($query as xs:anyAtomicType, $bindings as map(*)?) as item()* external; - -(:~ - : Evaluates the supplied $query and returns the resulting items. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string.

Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:

  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. Overwrites the base URI of the query; will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
- : - : @param $query value of type xs:anyAtomicType - : @param $bindings value of type map(*)? - : @param $options value of type map(*)? - : @return value of type item()* - : @error xquery:update the query contains updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval($query as xs:anyAtomicType, $bindings as map(*)?, $options as map(*)?) as item()* external; - -(:~ - : Evaluates a query as updating expression. All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules for all arguments are the same as for xquery:eval. - : - : @param $query value of type xs:anyAtomicType - : @return value of type item()* - : @error xquery:update the query contains no updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval-update($query as xs:anyAtomicType) as item()* external; - -(:~ - : Evaluates a query as updating expression. All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules for all arguments are the same as for xquery:eval. - : - : @param $query value of type xs:anyAtomicType - : @param $bindings value of type map(*)? - : @return value of type item()* - : @error xquery:update the query contains no updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval-update($query as xs:anyAtomicType, $bindings as map(*)?) as item()* external; - -(:~ - : Evaluates a query as updating expression. All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules for all arguments are the same as for xquery:eval. - : - : @param $query value of type xs:anyAtomicType - : @param $bindings value of type map(*)? - : @param $options value of type map(*)? - : @return value of type item()* - : @error xquery:update the query contains no updating expressions. - : @error xquery:permission insufficient permissions for evaluating the query. - : @error xquery:timeout query execution exceeded timeout. - : @error xquery:limit query execution exceeded memory limit. - : @error xquery:nested nested query evaluation is not allowed. - :) -declare function xquery:eval-update($query as xs:anyAtomicType, $bindings as map(*)?, $options as map(*)?) as item()* external; - -(:~ - : Parses the specified $query as XQuery module and returns the resulting query plan. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string. The $options parameter influences the output:
  • compile: additionally compiles the query after parsing it. By default, this option is false.
  • plan: returns an XML representation of the internal query plan. By default, this option is true. The naming of the expressions in the query plan may change over time
  • pass: by default, the option is false. If an error is raised, the line/column number and the optional file uri will refer to the location of the function call. If the option is enabled, the line/column and file uri will be adopted from the raised error.
  • base-uri: set base-uri property for the query. This URI will be used when resolving relative URIs by functions such as fn:doc.
- : - : @param $query value of type xs:anyAtomicType - : @return value of type item()? - :) -declare function xquery:parse($query as xs:anyAtomicType) as item()? external; - -(:~ - : Parses the specified $query as XQuery module and returns the resulting query plan. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string. The $options parameter influences the output:
  • compile: additionally compiles the query after parsing it. By default, this option is false.
  • plan: returns an XML representation of the internal query plan. By default, this option is true. The naming of the expressions in the query plan may change over time
  • pass: by default, the option is false. If an error is raised, the line/column number and the optional file uri will refer to the location of the function call. If the option is enabled, the line/column and file uri will be adopted from the raised error.
  • base-uri: set base-uri property for the query. This URI will be used when resolving relative URIs by functions such as fn:doc.
- : - : @param $query value of type xs:anyAtomicType - : @param $options value of type map(*)? - : @return value of type item()? - :) -declare function xquery:parse($query as xs:anyAtomicType, $options as map(*)?) as item()? external; - -(:~ - : This function executes the supplied (non-updating) functions in parallel. - : - : @param $functions value of type function(*)* - : @return value of type item()* - : @error xquery:error an unexpected error occurred. - :) -declare function xquery:fork-join($functions as function(*)*) as item()* external; diff --git a/packages.src/basex-9.7/xslt.xqm b/packages.src/basex-9.7/xslt.xqm deleted file mode 100644 index ba1cd92..0000000 --- a/packages.src/basex-9.7/xslt.xqm +++ /dev/null @@ -1,111 +0,0 @@ -(:~ - : This XQuery Module contains functions and variables to perform XSL transformations. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/XSLT_Module - :) -module namespace xslt = "http://basex.org/modules/xslt"; - -(:~ - : Returns the name of the applied XSLT processor, or the path to a custom implementation (currently: "Java", "Saxon EE", "Saxon PE", or "Saxon HE").
- : - : @return value of type xs:string - :) -declare function xslt:processor() as xs:string external; - -(:~ - : Returns the supported XSLT version (currently: "1.0" or "3.0"). "Unknown" is returned if a custom implementation was chosen.
- : - : @return value of type xs:string - :) -declare function xslt:version() as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

XML Catalog files will be considered when resolving URIs. Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available:

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @return value of type node() - :) -declare function xslt:transform($input as item(), $stylesheet as item()) as node() external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

XML Catalog files will be considered when resolving URIs. Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available:

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $params value of type map(*)? - : @return value of type node() - :) -declare function xslt:transform($input as item(), $stylesheet as item(), $params as map(*)?) as node() external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

XML Catalog files will be considered when resolving URIs. Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available:

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $args value of type map(*)? - : @param $options value of type map(*)? - : @return value of type node() - :) -declare function xslt:transform($input as item(), $stylesheet as item(), $args as map(*)?, $options as map(*)?) as node() external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform.
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @return value of type xs:string - :) -declare function xslt:transform-text($input as item(), $stylesheet as item()) as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform.
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $params value of type map(*)? - : @return value of type xs:string - :) -declare function xslt:transform-text($input as item(), $stylesheet as item(), $params as map(*)?) as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform.
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $params value of type map(*)? - : @param $options value of type map(*)? - : @return value of type xs:string - :) -declare function xslt:transform-text($input as item(), $stylesheet as item(), $params as map(*)?, $options as map(*)?) as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns a map with the following keys:
  • result: The transformation result: One or more document nodes, or (if the result cannot be converted to XML) an item of type xs:untypedAtomic.
  • messages: Informational output generated by xsl:message elements: A sequence of arrays. The arrays consist of XML elements, or (for those messages that cannot be converted to XML) items of type xs:untypedAtomic.

The semantics of $params and $options is the same as for xslt:transform.
For the moment, messages can only be returned with recent versions of Saxon.

  • error (optional): An error string, which would be raised as an error by the other functions of this module.
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @return value of type xs:string - :) -declare function xslt:transform-report($input as item(), $stylesheet as item()) as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns a map with the following keys:
  • result: The transformation result: One or more document nodes, or (if the result cannot be converted to XML) an item of type xs:untypedAtomic.
  • messages: Informational output generated by xsl:message elements: A sequence of arrays. The arrays consist of XML elements, or (for those messages that cannot be converted to XML) items of type xs:untypedAtomic.

The semantics of $params and $options is the same as for xslt:transform.
For the moment, messages can only be returned with recent versions of Saxon.

  • error (optional): An error string, which would be raised as an error by the other functions of this module.
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $params value of type map(*)? - : @return value of type xs:string - :) -declare function xslt:transform-report($input as item(), $stylesheet as item(), $params as map(*)?) as xs:string external; - -(:~ - : Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns a map with the following keys:
  • result: The transformation result: One or more document nodes, or (if the result cannot be converted to XML) an item of type xs:untypedAtomic.
  • messages: Informational output generated by xsl:message elements: A sequence of arrays. The arrays consist of XML elements, or (for those messages that cannot be converted to XML) items of type xs:untypedAtomic.

The semantics of $params and $options is the same as for xslt:transform.
For the moment, messages can only be returned with recent versions of Saxon.

  • error (optional): An error string, which would be raised as an error by the other functions of this module.
- : - : @param $input value of type item() - : @param $stylesheet value of type item() - : @param $params value of type map(*)? - : @param $options value of type map(*)? - : @return value of type xs:string - :) -declare function xslt:transform-report($input as item(), $stylesheet as item(), $params as map(*)?, $options as map(*)?) as xs:string external; diff --git a/packages.src/basex-9.7/zip.xqm b/packages.src/basex-9.7/zip.xqm deleted file mode 100644 index 42bd155..0000000 --- a/packages.src/basex-9.7/zip.xqm +++ /dev/null @@ -1,95 +0,0 @@ -(:~ - : This XQuery Module contains functions to handle ZIP archives. The contents of ZIP files can be extracted and listed, and new archives can be created. The module is based on the EXPath ZIP Module. Please note that the ZIP module is not being actively maintained but is still distributed for compatibility with older applications. We recommend you use the Archive Module wherever possible. - : - : @author BaseX Team - : @see https://web.archive.org/web/20220623231014/https://docs.basex.org/wiki/ZIP_Module - :) -module namespace zip = "http://expath.org/ns/zip"; -declare namespace experr = "http://expath.org/ns/error"; - -(:~ - : Extracts the binary file at $path within the ZIP file located at $uri and returns it as an xs:base64Binary item. - : - : @param $uri value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:base64Binary - : @error experr:ZIP0001 the specified path does not exist. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:binary-entry($uri as xs:string, $path as xs:string) as xs:base64Binary external; - -(:~ - : Extracts the text file at $path within the ZIP file located at $uri and returns it as an xs:string item.
An optional encoding can be specified via $encoding. - : - : @param $uri value of type xs:string - : @param $path value of type xs:string - : @return value of type xs:string - : @error experr:ZIP0001 the specified path does not exist. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:text-entry($uri as xs:string, $path as xs:string) as xs:string external; - -(:~ - : Extracts the text file at $path within the ZIP file located at $uri and returns it as an xs:string item.
An optional encoding can be specified via $encoding. - : - : @param $uri value of type xs:string - : @param $path value of type xs:string - : @param $encoding value of type xs:string - : @return value of type xs:string - : @error experr:ZIP0001 the specified path does not exist. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:text-entry($uri as xs:string, $path as xs:string, $encoding as xs:string) as xs:string external; - -(:~ - : Extracts the XML file at $path within the ZIP file located at $uri and returns it as a document node. - : - : @param $uri value of type xs:string - : @param $path value of type xs:string - : @return value of type document-node() - : @error experr:ZIP0001 the specified path does not exist. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:xml-entry($uri as xs:string, $path as xs:string) as document-node() external; - -(:~ - : Extracts the HTML file at $path within the ZIP file located at $uri and returns it as a document node. The file is converted to XML first if Tagsoup is found in the classpath. - : - : @param $uri value of type xs:string - : @param $path value of type xs:string - : @return value of type document-node() - : @error experr:ZIP0001 the specified path does not exist. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:html-entry($uri as xs:string, $path as xs:string) as document-node() external; - -(:~ - : Generates an ZIP XML Representation of the hierarchical structure of the ZIP file located at $uri and returns it as an element node. The file contents are not returned by this function. - : - : @param $uri value of type xs:string - : @return value of type element(zip:file) - : @error experr:ZIP0001 the specified path does not exist. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:entries($uri as xs:string) as element(zip:file) external; - -(:~ - : Creates a new ZIP archive with the characteristics described by $zip, the ZIP XML Representation. - : - : @param $zip value of type element(zip:file) - : @error experr:ZIP0001 an addressed file does not exist. - : @error experr:ZIP0002 entries in the ZIP archive description are unknown, missing, or invalid. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:zip-file($zip as element(zip:file)) as empty-sequence() external; - -(:~ - : Updates an existing ZIP archive or creates a modifed copy, based on the characteristics described by $zip, the ZIP XML Representation. The $output argument is the URI where the modified ZIP file is copied to. - : - : @param $zip value of type element(zip:file) - : @param $output value of type xs:string - : @error experr:ZIP0001 an addressed file does not exist. - : @error experr:ZIP0002 entries in the ZIP archive description are unknown, missing, or invalid. - : @error experr:ZIP0003 the operation fails for some other reason. - :) -declare function zip:update-entries($zip as element(zip:file), $output as xs:string) as empty-sequence() external; diff --git a/packages.src/xpath-3.1/array.xqm.dup b/packages.src/xpath-3.1/array.xqm.dup deleted file mode 100644 index ce4e2f0..0000000 --- a/packages.src/xpath-3.1/array.xqm.dup +++ /dev/null @@ -1,208 +0,0 @@ -(:~ - : This XQuery Module contains functions for manipulating arrays, which has been introduced with XQuery 3.1. - : - : @author BaseX Team - : @see /wiki/Array_Module - :) -module namespace array = "http://www.w3.org/2005/xpath-functions/array"; - -(:~ - : Returns the number of members in $array. Note that because an array is an item, the fn:count function when applied to an array always returns 1. - : - : @param $input value of type array(*) - : @return value of type xs:integer - :) -declare function array:size($input as array(*)) as xs:integer external; - -(:~ - : Returns the $array member at the specified $position. - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @return value of type item()* - : @error array:FOAY0001 $position is not in the range 1 to array:size($array) inclusive. - :) -declare function array:get($array as array(*), $position as xs:integer) as item()* external; - -(:~ - : Returns a copy of $array with a new $member attached. - : - : @param $array value of type array(*) - : @param $member value of type item()* - : @return value of type array(*) - :) -declare function array:append($array as array(*), $member as item()*) as array(*) external; - -(:~ - : Constructs a new array with with $length members of $array beginning from the specified $position.
The two-argument version of the function returns the same result as the three-argument version when called with $length equal to the value of array:size($array) - $position + 1. - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @return value of type array(*) - : @error array:FOAY0001 $position is less than one, or if $position + $length is greater than array:size($array) + 1. - : @error array:FOAY0002 $length is less than zero. - :) -declare function array:subarray($array as array(*), $position as xs:integer) as array(*) external; - -(:~ - : Constructs a new array with with $length members of $array beginning from the specified $position.
The two-argument version of the function returns the same result as the three-argument version when called with $length equal to the value of array:size($array) - $position + 1. - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @param $length value of type xs:integer - : @return value of type array(*) - : @error array:FOAY0001 $position is less than one, or if $position + $length is greater than array:size($array) + 1. - : @error array:FOAY0002 $length is less than zero. - :) -declare function array:subarray($array as array(*), $position as xs:integer, $length as xs:integer) as array(*) external; - -(:~ - : Returns a copy of $array with $member replaced at the specified $position. Equivalent to $array => array:remove($position) => array:insert-before($position, $member). - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @param $member value of type item()* - : @return value of type array(*) - : @error array:FOAY0001 $position is not in the range 1 to array:size($array) inclusive. - :) -declare function array:put($array as array(*), $position as xs:integer, $member as item()*) as array(*) external; - -(:~ - : Returns a copy of $array without the member at the specified $positions. - : - : @param $array value of type array(*) - : @param $positions value of type xs:integer* - : @return value of type array(*) - : @error array:FOAY0001 A position is not in the range 1 to array:size($array) inclusive. - :) -declare function array:remove($array as array(*), $positions as xs:integer*) as array(*) external; - -(:~ - : Returns a copy of $array with one new $member at the specified $position. Setting $position to the value array:size($array) + 1 yields the same result as array:append($array, $insert). - : - : @param $array value of type array(*) - : @param $position value of type xs:integer - : @param $member value of type item()* - : @return value of type array(*) - : @error array:FOAY0001 $position is not in the range 1 to array:size($array) + 1 inclusive. - :) -declare function array:insert-before($array as array(*), $position as xs:integer, $member as item()*) as array(*) external; - -(:~ - : Returns the first member of $array. This function is equivalent to the expression $array(1). - : - : @param $array value of type array(*) - : @return value of type item()* - : @error array:FOAY0001 The array is empty. - :) -declare function array:head($array as array(*)) as item()* external; - -(:~ - : Returns a new array with all members except the first from $array. This function is equivalent to the expression array:remove($array, 1). - : - : @param $array value of type array(*) - : @return value of type array(*) - : @error array:FOAY0001 The array is empty. - :) -declare function array:tail($array as array(*)) as array(*) external; - -(:~ - : Returns a new array with all members of $array in reverse order. - : - : @param $array value of type array(*) - : @return value of type array(*) - :) -declare function array:reverse($array as array(*)) as array(*) external; - -(:~ - : Concatenates the contents of several $arrays into a single array. - : - : @param $arrays value of type array(*)* - : @return value of type array(*) - :) -declare function array:join($arrays as array(*)*) as array(*) external; - -(:~ - : Recursively flattens all arrays that occur in the supplied $items. - : - : @param $items value of type item()* - : @return value of type item()* - :) -declare function array:flatten($items as item()*) as item()* external; - -(:~ - : Returns a new array, in which each member is computed by applying $function to the corresponding member of $array. - : - : @param $array value of type array(*) - : @param $function value of type function(item()* - : @return value of type array(*) - :) -declare function array:for-each($array as array(*), $function as function(item()*) as item()*) as array(*) external; - -(:~ - : Returns a new array with those members of $array for which $function returns true. - : - : @param $array value of type array(*) - : @param $function value of type function(item()* - : @return value of type array(*) - :) -declare function array:filter($array as array(*), $function as function(item()*) as xs:boolean) as array(*) external; - -(:~ - : Evaluates the supplied $function cumulatively on successive members of the supplied $array from left to right and using $zero as first argument. - : - : @param $array value of type array(*) - : @param $zero value of type item()* - : @param $function value of type function(item()* - : @param item()* value of type - : @return value of type item()* - :) -declare function array:fold-left($array as array(*), $zero as item()*, $function as function(item()*, item()*) as item()*) as item()* external; - -(:~ - : Evaluates the supplied $function cumulatively on successive members of the supplied $array from right to left and using $zero as first argument. - : - : @param $array value of type array(*) - : @param $zero value of type item()* - : @param $function value of type function(item()* - : @param item()* value of type - : @return value of type item()* - :) -declare function array:fold-right($array as array(*), $zero as item()*, $function as function(item()*, item()*) as item()*) as item()* external; - -(:~ - : Returns a new array obtained by evaluating the supplied $function for each pair of members at the same position in $array1 and $array2. - : - : @param $array1 value of type array(*) - : @param $array2 value of type array(*) - : @param $function value of type function(item()* - : @return value of type array(*) - :) -declare function array:for-each-pair($array1 as array(*), $array2 as array(*), $function as function(item()*) as item()*) as array(*) external; - -(:~ - : Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression. - : - : @param $array value of type array(*) - : @return value of type array(*) - :) -declare function array:sort($array as array(*)) as array(*) external; - -(:~ - : Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression. - : - : @param $array value of type array(*) - : @param $collation value of type xs:string? - : @return value of type array(*) - :) -declare function array:sort($array as array(*), $collation as xs:string?) as array(*) external; - -(:~ - : Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression. - : - : @param $array value of type array(*) - : @param $collation value of type xs:string? - : @param $key value of type function(item()* - : @return value of type array(*) - :) -declare function array:sort($array as array(*), $collation as xs:string?, $key as function(item()*) as xs:anyAtomicType*) as array(*) external; diff --git a/packages.src/xpath-3.1/map.xqm.dup b/packages.src/xpath-3.1/map.xqm.dup deleted file mode 100644 index 0d55fa8..0000000 --- a/packages.src/xpath-3.1/map.xqm.dup +++ /dev/null @@ -1,105 +0,0 @@ -(:~ - : This XQuery Module contains functions for manipulating maps. Maps have been introduced with XQuery 3.1 and are described in detail in the XQuery Functions and Operators 3.1 specification. - : - : @author BaseX Team - : @see /wiki/Map_Module - :) -module namespace map = "http://www.w3.org/2005/xpath-functions/map"; - -(:~ - : Returns true if the supplied $map contains an entry with a key equal to the supplied value of $key; otherwise it returns false. No error is raised if the map contains keys that are not comparable with the supplied $key.

If the supplied key is xs:untypedAtomic, it is compared as an instance of xs:string. If the supplied key is the xs:float or xs:double value NaN, the function returns true if there is an entry whose key is NaN, or false otherwise.

- : - : @param $map value of type map(*) - : @param $key value of type xs:anyAtomicType - : @return value of type xs:boolean - :) -declare function map:contains($map as map(*), $key as xs:anyAtomicType) as xs:boolean external; - -(:~ - : Creates a new map containing a single entry. The key of the entry in the new map is $key, and its associated value is $value.

The function map:entry is intended primarily for use in conjunction with the function map:merge . For example, a map containing seven entries may be constructed like this:

 map:merge(( map:entry("Sun", "Sunday"), map:entry("Mon", "Monday"), map:entry("Tue", "Tuesday"), map:entry("Wed", "Wednesday"), map:entry("Thu", "Thursday"), map:entry("Fri", "Friday"), map:entry("Sat", "Saturday") )) 

Unlike the map { ... } expression, this technique can be used to construct a map with a variable number of entries, for example:

map:merge(for $b in //book return map:entry($b/isbn, $b))
- : - : @param $key value of type xs:anyAtomicType - : @param $value value of type item()* - : @return value of type map(*) - :) -declare function map:entry($key as xs:anyAtomicType, $value as item()*) as map(*) external; - -(:~ - : Returns all values of maps in the supplied $input with the specified $key. The found values will be returned in an array. Arbitrary input will be processed recursively as follows:
  • In a sequence, each item will be processed in order.
  • In an array, all array members will be processed as sequence.
  • In a map, all entries whose keys match the specified key. Moreover, all values of the map will be processed as sequence.
- : - : @param $input value of type item()* - : @param $key value of type xs:anyAtomicType - : @return value of type array(*) - :) -declare function map:find($input as item()*, $key as xs:anyAtomicType) as array(*) external; - -(:~ - : Applies the specified $function to every key/value pair of the supplied $map and returns the results as a sequence. - : - : @param $map value of type map(*) - : @param $function value of type function(xs:anyAtomicType - : @param item()* value of type - : @return value of type item()* - :) -declare function map:for-each($map as map(*), $function as function(xs:anyAtomicType, item()*) as item()*) as item()* external; - -(:~ - : Returns the value associated with a supplied key in a given map. This function attempts to find an entry within the $map that has a key equal to the supplied value of $key. If there is such an entry, the function returns the associated value; otherwise it returns an empty sequence. No error is raised if the map contains keys that are not comparable with the supplied $key. If the supplied key is xs:untypedAtomic, it is converted to xs:string.

A return value of () from map:get could indicate that the key is present in the map with an associated value of (), or it could indicate that the key is not present in the map. The two cases can be distinguished by calling map:contains. Invoking the map as a function item has the same effect as calling get: that is, when $map is a map, the expression $map($K) is equivalent to get($map, $K). Similarly, the expression get(get(get($map, 'employee'), 'name'), 'first') can be written as $map('employee')('name')('first').

- : - : @param $map value of type map(*) - : @param $key value of type xs:anyAtomicType - : @return value of type item()* - :) -declare function map:get($map as map(*), $key as xs:anyAtomicType) as item()* external; - -(:~ - : Returns a sequence containing all the key values present in a map. The function takes the supplied $map and returns the keys that are present in the map as a sequence of atomic values. The order may differ from the order in which entries were inserted in the map. - : - : @param $map value of type map(*) - : @return value of type xs:anyAtomicType* - :) -declare function map:keys($map as map(*)) as xs:anyAtomicType* external; - -(:~ - : Constructs and returns a new map. The map is formed by combining the contents of the supplied $maps. The maps are combined as follows:
  1. There is one entry in the new map for each distinct key present in the union of the input maps.
  2. The $options argument defines how duplicate keys are handled. Currently, a single option duplicates exists, and its allowed values are use-first, use-last, combine and reject.
- : - : @param $maps value of type map(*)* - : @return value of type map(*) - :) -declare function map:merge($maps as map(*)*) as map(*) external; - -(:~ - : Constructs and returns a new map. The map is formed by combining the contents of the supplied $maps. The maps are combined as follows:
  1. There is one entry in the new map for each distinct key present in the union of the input maps.
  2. The $options argument defines how duplicate keys are handled. Currently, a single option duplicates exists, and its allowed values are use-first, use-last, combine and reject.
- : - : @param $maps value of type map(*)* - : @param $options value of type map(*) - : @return value of type map(*) - :) -declare function map:merge($maps as map(*)*, $options as map(*)) as map(*) external; - -(:~ - : Creates a new map, containing the entries of the supplied $map and a new entry composed by $key and $value. The semantics of this function are equivalent to map:merge((map { $key, $value }, $map)) - : - : @param $map value of type map(*) - : @param $key value of type xs:anyAtomicType - : @param $value value of type item()* - : @return value of type map(*) - :) -declare function map:put($map as map(*), $key as xs:anyAtomicType, $value as item()*) as map(*) external; - -(:~ - : Constructs a new map by removing entries from an existing map. The entries in the new map correspond to the entries of $map, excluding entries supplied via $keys.

No failure occurs if the input map contains no entry with the supplied keys; the input map is returned unchanged.

- : - : @param $map value of type map(*) - : @param $keys value of type xs:anyAtomicType* - : @return value of type map(*) - :) -declare function map:remove($map as map(*), $keys as xs:anyAtomicType*) as map(*) external; - -(:~ - : Returns a the number of entries in the supplied map. The function takes the supplied $map and returns the number of entries that are present in the map. - : - : @param $map value of type map(*) - : @return value of type xs:integer - :) -declare function map:size($map as map(*)) as xs:integer external; diff --git a/packages.src/xpath-3.1/math.xqm b/packages.src/xpath-3.1/math.xqm deleted file mode 100644 index ac466a3..0000000 --- a/packages.src/xpath-3.1/math.xqm +++ /dev/null @@ -1,151 +0,0 @@ -(:~ - : The math XQuery Module defines functions to perform mathematical operations, such as pi, asin and acos. Most functions are specified in the Functions and Operators Specification of the upcoming XQuery 3.0 Recommendation, and some additional ones have been added in this module. - : - : @author BaseX Team - : @see /wiki/Math_Module - :) -module namespace math = "http://www.w3.org/2005/xpath-functions/math"; - -(:~ - : Returns the xs:double value of the mathematical constant π whose lexical representation is 3.141592653589793. - : - : @return value of type xs:double - :) -declare function math:pi() as xs:double external; - -(:~ - : Returns the square root of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the xs:double value of the mathematical square root of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:sqrt($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the sine of the $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the sine of $arg, treated as an angle in radians. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:sin($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the cosine of $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the cosine of $arg, treated as an angle in radians. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:cos($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the tangent of $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the tangent of $arg, treated as an angle in radians. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:tan($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the arc sine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc sine of $arg, returned as an angle in radians in the range -Ï€/2 to +Ï€/2. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:asin($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the arc cosine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc cosine of $arg, returned as an angle in radians in the range 0 to +Ï€. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:acos($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the arc tangent of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc tangent of $arg, returned as an angle in radians in the range -Ï€/2 to +Ï€/2. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:atan($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the arc tangent of $arg1 divided by $arg2, the result being in the range -Ï€/2 to +Ï€/2 radians.
If $arg1 is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc tangent of $arg1 divided by $arg2, returned as an angle in radians in the range -Ï€ to +Ï€. - : - : @param $arg1 value of type xs:double? - : @param $arg2 value of type xs:double - : @return value of type xs:double? - :) -declare function math:atan2($arg1 as xs:double?, $arg2 as xs:double) as xs:double? external; - -(:~ - : Returns $arg1 raised to the power of $arg2.
If $arg1 is the empty sequence, the empty sequence is returned.
Otherwise the result is the $arg1 raised to the power of $arg2. - : - : @param $arg1 value of type xs:double? - : @param $arg2 value of type xs:double - : @return value of type xs:double? - :) -declare function math:pow($arg1 as xs:double?, $arg2 as xs:double) as xs:double? external; - -(:~ - : Returns e raised to the power of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the value of e raised to the power of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:exp($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the natural logarithm of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the natural logarithm (base e) of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:log($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the base 10 logarithm of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the base 10 logarithm of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:log10($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the xs:double value of the mathematical constant e whose lexical representation is 2.718281828459045. - : - : @return value of type xs:double - :) -declare function math:e() as xs:double external; - -(:~ - : Returns the hyperbolic sine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic sine of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:sinh($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the hyperbolic cosine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic cosine of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:cosh($arg as xs:double?) as xs:double? external; - -(:~ - : Returns the hyperbolic tangent of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic tangent of $arg. - : - : @param $arg value of type xs:double? - : @return value of type xs:double? - :) -declare function math:tanh($arg as xs:double?) as xs:double? external; - -(:~ - : Calculates the CRC32 check sum of the given $string.
If an empty sequence is supplied, the empty sequence is returned. - : - : @param $string value of type xs:string? - : @return value of type xs:hexBinary? - :) -declare function math:crc32($string as xs:string?) as xs:hexBinary? external; diff --git a/packages.src/xpath-3.1/xpath3.1-fn.xqm b/packages.src/xpath-3.1/xpath3.1-fn.xqm deleted file mode 100644 index 2693f62..0000000 --- a/packages.src/xpath-3.1/xpath3.1-fn.xqm +++ /dev/null @@ -1,1057 +0,0 @@ -(: From https://www.w3.org/TR/2017/REC-xpath-functions-31-20170321/xpath-functions-31.xml :) -module namespace fn = 'http://www.w3.org/2005/xpath-functions'; - -(:~ - Calling the fn:error function raises an application-defined error. -:) -declare function fn:error() external; - -(:~ - Calling the fn:error function raises an application-defined error. -:) -declare function fn:error($code as xs:QName?) external; - -(:~ - Calling the fn:error function raises an application-defined error. -:) -declare function fn:error($code as xs:QName?,$description as xs:string) external; - -(:~ - Calling the fn:error function raises an application-defined error. -:) -declare function fn:error($code as xs:QName?,$description as xs:string,$error-object as item()*) external; - -(:~ - Provides an execution trace intended to be used in debugging queries. -:) -declare function fn:trace($value as item()*) as item()* external; - -(:~ - Provides an execution trace intended to be used in debugging queries. -:) -declare function fn:trace($value as item()*,$label as xs:string) as item()* external; - -(:~ - Returns the absolute value of $arg. -:) -declare function fn:abs($arg as xs:numeric?) as xs:numeric? external; - -(:~ - Rounds $arg upwards to a whole number. -:) -declare function fn:ceiling($arg as xs:numeric?) as xs:numeric? external; - -(:~ - Rounds $arg downwards to a whole number. -:) -declare function fn:floor($arg as xs:numeric?) as xs:numeric? external; - -(:~ - Rounds a value to a specified number of decimal places, rounding upwards if two such - values are equally near. -:) -declare function fn:round($arg as xs:numeric?) as xs:numeric? external; - -(:~ - Rounds a value to a specified number of decimal places, rounding upwards if two such - values are equally near. -:) -declare function fn:round($arg as xs:numeric?,$precision as xs:integer) as xs:numeric? external; - -(:~ - Rounds a value to a specified number of decimal places, rounding to make the last digit - even if two such values are equally near. -:) -declare function fn:round-half-to-even($arg as xs:numeric?) as xs:numeric? external; - -(:~ - Rounds a value to a specified number of decimal places, rounding to make the last digit - even if two such values are equally near. -:) -declare function fn:round-half-to-even($arg as xs:numeric?,$precision as xs:integer) as xs:numeric? external; - -(:~ - Returns the value indicated by $arg or, if $arg is not - specified, the context item after atomization, converted to an xs:double. - -:) -declare function fn:number() as xs:double external; - -(:~ - Returns the value indicated by $arg or, if $arg is not - specified, the context item after atomization, converted to an xs:double. - -:) -declare function fn:number($arg as xs:anyAtomicType?) as xs:double external; - -(:~ - Formats an integer according to a given picture string, using the conventions of a given - natural language if specified. -:) -declare function fn:format-integer($value as xs:integer?,$picture as xs:string) as xs:string external; - -(:~ - Formats an integer according to a given picture string, using the conventions of a given - natural language if specified. -:) -declare function fn:format-integer($value as xs:integer?,$picture as xs:string,$lang as xs:string?) as xs:string external; - -(:~ - Returns a string containing a number formatted according to a given picture string, - taking account of decimal formats specified in the static context. -:) -declare function fn:format-number($value as xs:numeric?,$picture as xs:string) as xs:string external; - -(:~ - Returns a string containing a number formatted according to a given picture string, - taking account of decimal formats specified in the static context. -:) -declare function fn:format-number($value as xs:numeric?,$picture as xs:string,$decimal-format-name as xs:string?) as xs:string external; - -(:~ - Returns a random number generator, which can be used to generate sequences of random numbers. -:) -declare function fn:random-number-generator() as map(xs:string, item()) external; - -(:~ - Returns a random number generator, which can be used to generate sequences of random numbers. -:) -declare function fn:random-number-generator($seed as xs:anyAtomicType?) as map(xs:string, item()) external; - -(:~ - Returns an xs:string whose characters have supplied codepoints. -:) -declare function fn:codepoints-to-string($arg as xs:integer*) as xs:string external; - -(:~ - Returns the sequence of codepoints that constitute an - xs:string value. -:) -declare function fn:string-to-codepoints($arg as xs:string?) as xs:integer* external; - -(:~ - Returns -1, 0, or 1, depending on whether $comparand1 collates before, - equal to, or after $comparand2 according to the rules of a selected - collation. -:) -declare function fn:compare($comparand1 as xs:string?,$comparand2 as xs:string?) as xs:integer? external; - -(:~ - Returns -1, 0, or 1, depending on whether $comparand1 collates before, - equal to, or after $comparand2 according to the rules of a selected - collation. -:) -declare function fn:compare($comparand1 as xs:string?,$comparand2 as xs:string?,$collation as xs:string) as xs:integer? external; - -(:~ - Returns true if two strings are equal, considered codepoint-by-codepoint. -:) -declare function fn:codepoint-equal($comparand1 as xs:string?,$comparand2 as xs:string?) as xs:boolean? external; - -(:~ - Given a string value and a collation, generates an internal value called a collation key, with the property that - the matching and ordering of collation keys reflects the matching and ordering of strings under the specified collation. -:) -declare function fn:collation-key($key as xs:string) as xs:base64Binary external; - -(:~ - Given a string value and a collation, generates an internal value called a collation key, with the property that - the matching and ordering of collation keys reflects the matching and ordering of strings under the specified collation. -:) -declare function fn:collation-key($key as xs:string,$collation as xs:string) as xs:base64Binary external; - -(:~ - Determines whether or not any of the supplied strings, when tokenized at whitespace boundaries, contains the supplied token, - under the rules of the supplied collation. -:) -declare function fn:contains-token($input as xs:string*,$token as xs:string) as xs:boolean external; - -(:~ - Determines whether or not any of the supplied strings, when tokenized at whitespace boundaries, contains the supplied token, - under the rules of the supplied collation. -:) -declare function fn:contains-token($input as xs:string*,$token as xs:string,$collation as xs:string) as xs:boolean external; - -(:~ - Returns the concatenation of the string values of the arguments. -:) -declare function fn:concat($arg1 as xs:anyAtomicType?,$arg2 as xs:anyAtomicType?) as xs:string external; - -(:~ - Returns a string created by concatenating the items in a sequence, with a defined - separator between adjacent items. -:) -declare function fn:string-join($arg1 as xs:anyAtomicType*) as xs:string external; - -(:~ - Returns a string created by concatenating the items in a sequence, with a defined - separator between adjacent items. -:) -declare function fn:string-join($arg1 as xs:anyAtomicType*,$arg2 as xs:string) as xs:string external; - -(:~ - Returns the portion of the value of $sourceString beginning at the position - indicated by the value of $start and continuing for the number of characters indicated by the value of - $length. -:) -declare function fn:substring($sourceString as xs:string?,$start as xs:double) as xs:string external; - -(:~ - Returns the portion of the value of $sourceString beginning at the position - indicated by the value of $start and continuing for the number of characters indicated by the value of - $length. -:) -declare function fn:substring($sourceString as xs:string?,$start as xs:double,$length as xs:double) as xs:string external; - -(:~ - Returns the number of characters in a string. -:) -declare function fn:string-length() as xs:integer external; - -(:~ - Returns the number of characters in a string. -:) -declare function fn:string-length($arg as xs:string?) as xs:integer external; - -(:~ - Returns the value of $arg with leading and trailing whitespace removed, and - sequences of internal whitespace reduced to a single space character. -:) -declare function fn:normalize-space() as xs:string external; - -(:~ - Returns the value of $arg with leading and trailing whitespace removed, and - sequences of internal whitespace reduced to a single space character. -:) -declare function fn:normalize-space($arg as xs:string?) as xs:string external; - -(:~ - Returns the value of $arg after applying Unicode normalization. -:) -declare function fn:normalize-unicode($arg as xs:string?) as xs:string external; - -(:~ - Returns the value of $arg after applying Unicode normalization. -:) -declare function fn:normalize-unicode($arg as xs:string?,$normalizationForm as xs:string) as xs:string external; - -(:~ - Converts a string to upper case. -:) -declare function fn:upper-case($arg as xs:string?) as xs:string external; - -(:~ - Converts a string to lower case. -:) -declare function fn:lower-case($arg as xs:string?) as xs:string external; - -(:~ - Returns the value of $arg modified by replacing or removing individual - characters. -:) -declare function fn:translate($arg as xs:string?,$mapString as xs:string,$transString as xs:string) as xs:string external; - -(:~ - Returns true if the string $arg1 contains $arg2 as a - substring, taking collations into account. -:) -declare function fn:contains($arg1 as xs:string?,$arg2 as xs:string?) as xs:boolean external; - -(:~ - Returns true if the string $arg1 contains $arg2 as a - substring, taking collations into account. -:) -declare function fn:contains($arg1 as xs:string?,$arg2 as xs:string?,$collation as xs:string) as xs:boolean external; - -(:~ - Returns true if the string $arg1 contains $arg2 as a leading - substring, taking collations into account. -:) -declare function fn:starts-with($arg1 as xs:string?,$arg2 as xs:string?) as xs:boolean external; - -(:~ - Returns true if the string $arg1 contains $arg2 as a leading - substring, taking collations into account. -:) -declare function fn:starts-with($arg1 as xs:string?,$arg2 as xs:string?,$collation as xs:string) as xs:boolean external; - -(:~ - Returns true if the string $arg1 contains $arg2 as a trailing - substring, taking collations into account. -:) -declare function fn:ends-with($arg1 as xs:string?,$arg2 as xs:string?) as xs:boolean external; - -(:~ - Returns true if the string $arg1 contains $arg2 as a trailing - substring, taking collations into account. -:) -declare function fn:ends-with($arg1 as xs:string?,$arg2 as xs:string?,$collation as xs:string) as xs:boolean external; - -(:~ - Returns the part of $arg1 that precedes the first occurrence of - $arg2, taking collations into account. -:) -declare function fn:substring-before($arg1 as xs:string?,$arg2 as xs:string?) as xs:string external; - -(:~ - Returns the part of $arg1 that precedes the first occurrence of - $arg2, taking collations into account. -:) -declare function fn:substring-before($arg1 as xs:string?,$arg2 as xs:string?,$collation as xs:string) as xs:string external; - -(:~ - Returns the part of $arg1 that follows the first occurrence of - $arg2, taking collations into account. -:) -declare function fn:substring-after($arg1 as xs:string?,$arg2 as xs:string?) as xs:string external; - -(:~ - Returns the part of $arg1 that follows the first occurrence of - $arg2, taking collations into account. -:) -declare function fn:substring-after($arg1 as xs:string?,$arg2 as xs:string?,$collation as xs:string) as xs:string external; - -(:~ - Returns true if the supplied string matches a given regular expression. -:) -declare function fn:matches($input as xs:string?,$pattern as xs:string) as xs:boolean external; - -(:~ - Returns true if the supplied string matches a given regular expression. -:) -declare function fn:matches($input as xs:string?,$pattern as xs:string,$flags as xs:string) as xs:boolean external; - -(:~ - Returns a string produced from the input string by replacing any substrings that match a - given regular expression with a supplied replacement string. -:) -declare function fn:replace($input as xs:string?,$pattern as xs:string,$replacement as xs:string) as xs:string external; - -(:~ - Returns a string produced from the input string by replacing any substrings that match a - given regular expression with a supplied replacement string. -:) -declare function fn:replace($input as xs:string?,$pattern as xs:string,$replacement as xs:string,$flags as xs:string) as xs:string external; - -(:~ - Returns a sequence of strings constructed by splitting the input wherever a separator is - found; the separator is any substring that matches a given regular expression. -:) -declare function fn:tokenize($input as xs:string?) as xs:string* external; - -(:~ - Returns a sequence of strings constructed by splitting the input wherever a separator is - found; the separator is any substring that matches a given regular expression. -:) -declare function fn:tokenize($input as xs:string?,$pattern as xs:string) as xs:string* external; - -(:~ - Returns a sequence of strings constructed by splitting the input wherever a separator is - found; the separator is any substring that matches a given regular expression. -:) -declare function fn:tokenize($input as xs:string?,$pattern as xs:string,$flags as xs:string) as xs:string* external; - -(:~ - Analyzes a string using a regular expression, returning an XML structure that identifies - which parts of the input string matched or failed to match the regular expression, and - in the case of matched substrings, which substrings matched each capturing group in the - regular expression. -:) -declare function fn:analyze-string($input as xs:string?,$pattern as xs:string) as element(fn:analyze-string-result) external; - -(:~ - Analyzes a string using a regular expression, returning an XML structure that identifies - which parts of the input string matched or failed to match the regular expression, and - in the case of matched substrings, which substrings matched each capturing group in the - regular expression. -:) -declare function fn:analyze-string($input as xs:string?,$pattern as xs:string,$flags as xs:string) as element(fn:analyze-string-result) external; - -(:~ - Returns the xs:boolean value true. -:) -declare function fn:true() as xs:boolean external; - -(:~ - Returns the xs:boolean value false. -:) -declare function fn:false() as xs:boolean external; - -(:~ - Computes the effective boolean value of the sequence $arg. -:) -declare function fn:boolean($arg as item()*) as xs:boolean external; - -(:~ - Returns true if the effective boolean value of $arg is - false, or false if it is true. -:) -declare function fn:not($arg as item()*) as xs:boolean external; - -(:~ - Returns the number of years in a duration. -:) -declare function fn:years-from-duration($arg as xs:duration?) as xs:integer? external; - -(:~ - Returns the number of months in a duration. -:) -declare function fn:months-from-duration($arg as xs:duration?) as xs:integer? external; - -(:~ - Returns the number of days in a duration. -:) -declare function fn:days-from-duration($arg as xs:duration?) as xs:integer? external; - -(:~ - Returns the number of hours in a duration. -:) -declare function fn:hours-from-duration($arg as xs:duration?) as xs:integer? external; - -(:~ - Returns the number of minutes in a duration. -:) -declare function fn:minutes-from-duration($arg as xs:duration?) as xs:integer? external; - -(:~ - Returns the number of seconds in a duration. -:) -declare function fn:seconds-from-duration($arg as xs:duration?) as xs:decimal? external; - -(:~ - Returns an xs:dateTime value created by combining an xs:date - and an xs:time. -:) -declare function fn:dateTime($arg1 as xs:date?,$arg2 as xs:time?) as xs:dateTime? external; - -(:~ - Returns the year component of an xs:dateTime. -:) -declare function fn:year-from-dateTime($arg as xs:dateTime?) as xs:integer? external; - -(:~ - Returns the month component of an xs:dateTime. -:) -declare function fn:month-from-dateTime($arg as xs:dateTime?) as xs:integer? external; - -(:~ - Returns the day component of an xs:dateTime. -:) -declare function fn:day-from-dateTime($arg as xs:dateTime?) as xs:integer? external; - -(:~ - Returns the hours component of an xs:dateTime. -:) -declare function fn:hours-from-dateTime($arg as xs:dateTime?) as xs:integer? external; - -(:~ - Returns the minute component of an xs:dateTime. -:) -declare function fn:minutes-from-dateTime($arg as xs:dateTime?) as xs:integer? external; - -(:~ - Returns the seconds component of an xs:dateTime. -:) -declare function fn:seconds-from-dateTime($arg as xs:dateTime?) as xs:decimal? external; - -(:~ - Returns the timezone component of an xs:dateTime. -:) -declare function fn:timezone-from-dateTime($arg as xs:dateTime?) as xs:dayTimeDuration? external; - -(:~ - Returns the year component of an xs:date. -:) -declare function fn:year-from-date($arg as xs:date?) as xs:integer? external; - -(:~ - Returns the month component of an xs:date. -:) -declare function fn:month-from-date($arg as xs:date?) as xs:integer? external; - -(:~ - Returns the day component of an xs:date. -:) -declare function fn:day-from-date($arg as xs:date?) as xs:integer? external; - -(:~ - Returns the timezone component of an xs:date. -:) -declare function fn:timezone-from-date($arg as xs:date?) as xs:dayTimeDuration? external; - -(:~ - Returns the hours component of an xs:time. -:) -declare function fn:hours-from-time($arg as xs:time?) as xs:integer? external; - -(:~ - Returns the minutes component of an xs:time. -:) -declare function fn:minutes-from-time($arg as xs:time?) as xs:integer? external; - -(:~ - Returns the seconds component of an xs:time. -:) -declare function fn:seconds-from-time($arg as xs:time?) as xs:decimal? external; - -(:~ - Returns the timezone component of an xs:time. -:) -declare function fn:timezone-from-time($arg as xs:time?) as xs:dayTimeDuration? external; - -(:~ - Adjusts an xs:dateTime value to a specific timezone, or to no timezone at - all. -:) -declare function fn:adjust-dateTime-to-timezone($arg as xs:dateTime?) as xs:dateTime? external; - -(:~ - Adjusts an xs:dateTime value to a specific timezone, or to no timezone at - all. -:) -declare function fn:adjust-dateTime-to-timezone($arg as xs:dateTime?,$timezone as xs:dayTimeDuration?) as xs:dateTime? external; - -(:~ - Adjusts an xs:date value to a specific timezone, or to no timezone at all; - the result is the date in the target timezone that contains the starting instant of the - supplied date. -:) -declare function fn:adjust-date-to-timezone($arg as xs:date?) as xs:date? external; - -(:~ - Adjusts an xs:date value to a specific timezone, or to no timezone at all; - the result is the date in the target timezone that contains the starting instant of the - supplied date. -:) -declare function fn:adjust-date-to-timezone($arg as xs:date?,$timezone as xs:dayTimeDuration?) as xs:date? external; - -(:~ - Adjusts an xs:time value to a specific timezone, or to no timezone at - all. -:) -declare function fn:adjust-time-to-timezone($arg as xs:time?) as xs:time? external; - -(:~ - Adjusts an xs:time value to a specific timezone, or to no timezone at - all. -:) -declare function fn:adjust-time-to-timezone($arg as xs:time?,$timezone as xs:dayTimeDuration?) as xs:time? external; - -(:~ - Returns a string containing an xs:dateTime value formatted for display. -:) -declare function fn:format-dateTime($value as xs:dateTime?,$picture as xs:string) as xs:string? external; - -(:~ - Returns a string containing an xs:dateTime value formatted for display. -:) -declare function fn:format-dateTime($value as xs:dateTime?,$picture as xs:string,$language as xs:string?,$calendar as xs:string?,$place as xs:string?) as xs:string? external; - -(:~ - Returns a string containing an xs:date value formatted for display. -:) -declare function fn:format-date($value as xs:date?,$picture as xs:string) as xs:string? external; - -(:~ - Returns a string containing an xs:date value formatted for display. -:) -declare function fn:format-date($value as xs:date?,$picture as xs:string,$language as xs:string?,$calendar as xs:string?,$place as xs:string?) as xs:string? external; - -(:~ - Returns a string containing an xs:time value formatted for display. -:) -declare function fn:format-time($value as xs:time?,$picture as xs:string) as xs:string? external; - -(:~ - Returns a string containing an xs:time value formatted for display. -:) -declare function fn:format-time($value as xs:time?,$picture as xs:string,$language as xs:string?,$calendar as xs:string?,$place as xs:string?) as xs:string? external; - -(:~ - Parses a string containing the date and time in IETF format, returning the corresponding - xs:dateTime value. -:) -declare function fn:parse-ietf-date($value as xs:string?) as xs:dateTime? external; - -(:~ - Returns an xs:QName value (that is, an expanded-QName) by taking an - xs:string that has the lexical form of an xs:QName (a - string in the form "prefix:local-name" or "local-name") and resolving it using the - in-scope namespaces for a given element. -:) -declare function fn:resolve-QName($qname as xs:string?,$element as element()) as xs:QName? external; - -(:~ - Returns an xs:QName value formed using a supplied namespace URI and lexical QName. -:) -declare function fn:QName($paramURI as xs:string?,$paramQName as xs:string) as xs:QName external; - -(:~ - Returns the prefix component of the supplied QName. -:) -declare function fn:prefix-from-QName($arg as xs:QName?) as xs:NCName? external; - -(:~ - Returns the local part of the supplied QName. -:) -declare function fn:local-name-from-QName($arg as xs:QName?) as xs:NCName? external; - -(:~ - Returns the namespace URI part of the supplied QName. -:) -declare function fn:namespace-uri-from-QName($arg as xs:QName?) as xs:anyURI? external; - -(:~ - Returns the namespace URI of one of the in-scope namespaces for $element, - identified by its namespace prefix. -:) -declare function fn:namespace-uri-for-prefix($prefix as xs:string?,$element as element()) as xs:anyURI? external; - -(:~ - Returns the prefixes of the in-scope namespaces for an element node. -:) -declare function fn:in-scope-prefixes($element as element()) as xs:string* external; - -(:~ - Returns true if the argument is the empty sequence. -:) -declare function fn:empty($arg as item()*) as xs:boolean external; - -(:~ - Returns true if the argument is a non-empty sequence. -:) -declare function fn:exists($arg as item()*) as xs:boolean external; - -(:~ - Returns the first item in a sequence. -:) -declare function fn:head($arg as item()*) as item()? external; - -(:~ - Returns all but the first item in a sequence. -:) -declare function fn:tail($arg as item()*) as item()* external; - -(:~ - Returns a sequence constructed by inserting an item or a sequence of items at a given - position within an existing sequence. -:) -declare function fn:insert-before($target as item()*,$position as xs:integer,$inserts as item()*) as item()* external; - -(:~ - Returns a new sequence containing all the items of $target except the item - at position $position. -:) -declare function fn:remove($target as item()*,$position as xs:integer) as item()* external; - -(:~ - Reverses the order of items in a sequence. -:) -declare function fn:reverse($arg as item()*) as item()* external; - -(:~ - Returns the contiguous sequence of items in the value of $sourceSeq - beginning at the position indicated by the value of $startingLoc and - continuing for the number of items indicated by the value of $length. -:) -declare function fn:subsequence($sourceSeq as item()*,$startingLoc as xs:double) as item()* external; - -(:~ - Returns the contiguous sequence of items in the value of $sourceSeq - beginning at the position indicated by the value of $startingLoc and - continuing for the number of items indicated by the value of $length. -:) -declare function fn:subsequence($sourceSeq as item()*,$startingLoc as xs:double,$length as xs:double) as item()* external; - -(:~ - Returns the items of $sourceSeq in an implementation-dependent order. -:) -declare function fn:unordered($sourceSeq as item()*) as item()* external; - -(:~ - Returns the values that appear in a sequence, with duplicates eliminated. -:) -declare function fn:distinct-values($arg as xs:anyAtomicType*) as xs:anyAtomicType* external; - -(:~ - Returns the values that appear in a sequence, with duplicates eliminated. -:) -declare function fn:distinct-values($arg as xs:anyAtomicType*,$collation as xs:string) as xs:anyAtomicType* external; - -(:~ - Returns a sequence of positive integers giving the positions within the sequence - $seq of items that are equal to $search. -:) -declare function fn:index-of($seq as xs:anyAtomicType*,$search as xs:anyAtomicType) as xs:integer* external; - -(:~ - Returns a sequence of positive integers giving the positions within the sequence - $seq of items that are equal to $search. -:) -declare function fn:index-of($seq as xs:anyAtomicType*,$search as xs:anyAtomicType,$collation as xs:string) as xs:integer* external; - -(:~ - This function assesses whether two sequences are deep-equal to each other. To be - deep-equal, they must contain items that are pairwise deep-equal; and for two items to - be deep-equal, they must either be atomic values that compare equal, or nodes of the - same kind, with the same name, whose children are deep-equal, - or maps with matching entries, or arrays with matching members. -:) -declare function fn:deep-equal($parameter1 as item()*,$parameter2 as item()*) as xs:boolean external; - -(:~ - This function assesses whether two sequences are deep-equal to each other. To be - deep-equal, they must contain items that are pairwise deep-equal; and for two items to - be deep-equal, they must either be atomic values that compare equal, or nodes of the - same kind, with the same name, whose children are deep-equal, - or maps with matching entries, or arrays with matching members. -:) -declare function fn:deep-equal($parameter1 as item()*,$parameter2 as item()*,$collation as xs:string) as xs:boolean external; - -(:~ - Returns $arg if it contains zero or one items. Otherwise, raises an - error. -:) -declare function fn:zero-or-one($arg as item()*) as item()? external; - -(:~ - Returns $arg if it contains one or more items. Otherwise, raises an error. - -:) -declare function fn:one-or-more($arg as item()*) as item()+ external; - -(:~ - Returns $arg if it contains exactly one item. Otherwise, raises an error. - -:) -declare function fn:exactly-one($arg as item()*) as item() external; - -(:~ - Returns the number of items in a sequence. -:) -declare function fn:count($arg as item()*) as xs:integer external; - -(:~ - Returns the average of the values in the input sequence $arg, that is, the - sum of the values divided by the number of values. -:) -declare function fn:avg($arg as xs:anyAtomicType*) as xs:anyAtomicType? external; - -(:~ - Returns a value that is equal to the highest value appearing in the input sequence. -:) -declare function fn:max($arg as xs:anyAtomicType*) as xs:anyAtomicType? external; - -(:~ - Returns a value that is equal to the highest value appearing in the input sequence. -:) -declare function fn:max($arg as xs:anyAtomicType*,$collation as xs:string) as xs:anyAtomicType? external; - -(:~ - Returns a value that is equal to the lowest value appearing in the input sequence. -:) -declare function fn:min($arg as xs:anyAtomicType*) as xs:anyAtomicType? external; - -(:~ - Returns a value that is equal to the lowest value appearing in the input sequence. -:) -declare function fn:min($arg as xs:anyAtomicType*,$collation as xs:string) as xs:anyAtomicType? external; - -(:~ - Returns a value obtained by adding together the values in $arg. -:) -declare function fn:sum($arg as xs:anyAtomicType*) as xs:anyAtomicType external; - -(:~ - Returns a value obtained by adding together the values in $arg. -:) -declare function fn:sum($arg as xs:anyAtomicType*,$zero as xs:anyAtomicType?) as xs:anyAtomicType? external; - -(:~ - Returns the sequence of element nodes that have an ID value matching the - value of one or more of the IDREF values supplied in $arg. -:) -declare function fn:id($arg as xs:string*) as element()* external; - -(:~ - Returns the sequence of element nodes that have an ID value matching the - value of one or more of the IDREF values supplied in $arg. -:) -declare function fn:id($arg as xs:string*,$node as node()) as element()* external; - -(:~ - Returns the sequence of element nodes that have an ID value matching the - value of one or more of the IDREF values supplied in $arg. -:) -declare function fn:element-with-id($arg as xs:string*) as element()* external; - -(:~ - Returns the sequence of element nodes that have an ID value matching the - value of one or more of the IDREF values supplied in $arg. -:) -declare function fn:element-with-id($arg as xs:string*,$node as node()) as element()* external; - -(:~ - Returns the sequence of element or attribute nodes with an IDREF value - matching the value of one or more of the ID values supplied in - $arg. -:) -declare function fn:idref($arg as xs:string*) as node()* external; - -(:~ - Returns the sequence of element or attribute nodes with an IDREF value - matching the value of one or more of the ID values supplied in - $arg. -:) -declare function fn:idref($arg as xs:string*,$node as node()) as node()* external; - -(:~ - This function returns a string that uniquely identifies a given node. -:) -declare function fn:generate-id() as xs:string external; - -(:~ - This function returns a string that uniquely identifies a given node. -:) -declare function fn:generate-id($arg as node()?) as xs:string external; - -(:~ - Retrieves a document using a URI supplied as an xs:string, and returns the - corresponding document node. -:) -declare function fn:doc($uri as xs:string?) as document-node()? external; - -(:~ - The function returns true if and only if the function call fn:doc($uri) - would return a document node. -:) -declare function fn:doc-available($uri as xs:string?) as xs:boolean external; - -(:~ - Returns a sequence of items identified by a - collection URI; or a default collection if no URI is supplied. -:) -declare function fn:collection() as item()* external; - -(:~ - Returns a sequence of items identified by a - collection URI; or a default collection if no URI is supplied. -:) -declare function fn:collection($arg as xs:string?) as item()* external; - -(:~ - Returns a sequence of xs:anyURI values representing the URIs in a URI - collection. -:) -declare function fn:uri-collection() as xs:anyURI* external; - -(:~ - Returns a sequence of xs:anyURI values representing the URIs in a URI - collection. -:) -declare function fn:uri-collection($arg as xs:string?) as xs:anyURI* external; - -(:~ - The fn:unparsed-text function reads an external resource (for example, a - file) and returns a string representation of the resource. -:) -declare function fn:unparsed-text($href as xs:string?) as xs:string? external; - -(:~ - The fn:unparsed-text function reads an external resource (for example, a - file) and returns a string representation of the resource. -:) -declare function fn:unparsed-text($href as xs:string?,$encoding as xs:string) as xs:string? external; - -(:~ - The fn:unparsed-text-lines function reads an external resource (for - example, a file) and returns its contents as a sequence of strings, one for each line of - text in the string representation of the resource. -:) -declare function fn:unparsed-text-lines($href as xs:string?) as xs:string* external; - -(:~ - The fn:unparsed-text-lines function reads an external resource (for - example, a file) and returns its contents as a sequence of strings, one for each line of - text in the string representation of the resource. -:) -declare function fn:unparsed-text-lines($href as xs:string?,$encoding as xs:string) as xs:string* external; - -(:~ - Because errors in evaluating the fn:unparsed-text function are - non-recoverable, these two functions are provided to allow an application to determine - whether a call with particular arguments would succeed. -:) -declare function fn:unparsed-text-available($href as xs:string?) as xs:boolean external; - -(:~ - Because errors in evaluating the fn:unparsed-text function are - non-recoverable, these two functions are provided to allow an application to determine - whether a call with particular arguments would succeed. -:) -declare function fn:unparsed-text-available($href as xs:string?,$encoding as xs:string) as xs:boolean external; - -(:~ - Returns the value of a system environment variable, if it exists. -:) -declare function fn:environment-variable($name as xs:string) as xs:string? external; - -(:~ - Returns a list of environment variable names that are suitable for passing to - fn:environment-variable, as a (possibly empty) sequence of strings. -:) -declare function fn:available-environment-variables() as xs:string* external; - -(:~ - This function takes as input an XML document represented as a string, and returns the - document node at the root of an XDM tree representing the parsed document. -:) -declare function fn:parse-xml($arg as xs:string?) as document-node(element(*))? external; - -(:~ - This function takes as input an XML external entity represented as a string, and returns - the document node at the root of an XDM tree representing the parsed document - fragment. -:) -declare function fn:parse-xml-fragment($arg as xs:string?) as document-node()? external; - -(:~ - This function serializes the supplied input sequence $arg as described in - , returning the serialized representation - of the sequence as a string. -:) -declare function fn:serialize($arg as item()*) as xs:string external; - -(:~ - This function serializes the supplied input sequence $arg as described in - , returning the serialized representation - of the sequence as a string. -:) -declare function fn:serialize($arg as item()*,$params as item()?) as xs:string external; - -(:~ - Returns the function having a given name and arity, if there is one. -:) -declare function fn:function-lookup($name as xs:QName,$arity as xs:integer) as function(*)? external; - -(:~ - Returns the name of the function identified by a function item. -:) -declare function fn:function-name($func as function(*)) as xs:QName? external; - -(:~ - Returns the arity of the function identified by a function item. -:) -declare function fn:function-arity($func as function(*)) as xs:integer external; - -(:~ - Applies the function item $action to every item from the sequence $seq - in turn, returning the concatenation of the resulting sequences in order. -:) -declare function fn:for-each($seq as item()*,$action as function(item()) as item()*) as item()* external; - -(:~ - Returns those items from the sequence $seq for which the supplied function - $f returns true. -:) -declare function fn:filter($seq as item()*,$f as function(item()) as xs:boolean) as item()* external; - -(:~ - Processes the supplied sequence from left to right, applying the supplied function - repeatedly to each item in turn, together with an accumulated result value. -:) -declare function fn:fold-left($seq as item()*,$zero as item()*,$f as function(item()*, item()) as item()*) as item()* external; - -(:~ - Processes the supplied sequence from right to left, applying the supplied function - repeatedly to each item in turn, together with an accumulated result value. -:) -declare function fn:fold-right($seq as item()*,$zero as item()*,$f as function(item(), item()*) as item()*) as item()* external; - -(:~ - Applies the function item $action to successive pairs of items taken one from - $seq1 and one from $seq2, returning the concatenation of the - resulting sequences in order. -:) -declare function fn:for-each-pair($seq1 as item()*,$seq2 as item()*,$action as function(item(), item()) as item()*) as item()* external; - -(:~ - Sorts a supplied sequence, based on the value of a sort key supplied as a function. -:) -declare function fn:sort($input as item()*) as item()* external; - -(:~ - Sorts a supplied sequence, based on the value of a sort key supplied as a function. -:) -declare function fn:sort($input as item()*,$collation as xs:string?) as item()* external; - -(:~ - Sorts a supplied sequence, based on the value of a sort key supplied as a function. -:) -declare function fn:sort($input as item()*,$collation as xs:string?,$key as function(item()) as xs:anyAtomicType*) as item()* external; - -(:~ - Makes a dynamic call on a function with an argument list supplied in the form of an array. -:) -declare function fn:apply($function as function(*),$array as array(*)) as item()* external; - -(:~ - Provides access to the public functions and global variables of a dynamically-loaded XQuery library module. -:) -declare function fn:load-xquery-module($module-uri as xs:string) as map(*) external; - -(:~ - Provides access to the public functions and global variables of a dynamically-loaded XQuery library module. -:) -declare function fn:load-xquery-module($module-uri as xs:string,$options as map(*)) as map(*) external; - -(:~ - Invokes a transformation using a dynamically-loaded XSLT stylesheet. -:) -declare function fn:transform($options as map(*)) as map(*) external; - -(:~ - Parses a string supplied in the form of a JSON text, returning the results typically in the form - of a map or array. -:) -declare function fn:parse-json($json-text as xs:string?) as item()? external; - -(:~ - Parses a string supplied in the form of a JSON text, returning the results typically in the form - of a map or array. -:) -declare function fn:parse-json($json-text as xs:string?,$options as map(*)) as item()? external; - -(:~ - Reads an external resource containing JSON, and returns the result of parsing the resource as JSON. -:) -declare function fn:json-doc($href as xs:string?) as item()? external; - -(:~ - Reads an external resource containing JSON, and returns the result of parsing the resource as JSON. -:) -declare function fn:json-doc($href as xs:string?,$options as map(*)) as item()? external; - -(:~ - Parses a string supplied in the form of a JSON text, returning the results in the form - of an XML document node. -:) -declare function fn:json-to-xml($json-text as xs:string?) as document-node()? external; - -(:~ - Parses a string supplied in the form of a JSON text, returning the results in the form - of an XML document node. -:) -declare function fn:json-to-xml($json-text as xs:string?,$options as map(*)) as document-node()? external; - -(:~ - Converts an XML tree, whose format corresponds to the XML representation of JSON defined - in this specification, into a string conforming to the JSON grammar. -:) -declare function fn:xml-to-json($input as node()?) as xs:string? external; - -(:~ - Converts an XML tree, whose format corresponds to the XML representation of JSON defined - in this specification, into a string conforming to the JSON grammar. -:) -declare function fn:xml-to-json($input as node()?,$options as map(*)) as xs:string? external; \ No newline at end of file diff --git a/packages/basex-10.6.json b/packages/basex-10.6.json deleted file mode 100644 index 51f31ad..0000000 --- a/packages/basex-10.6.json +++ /dev/null @@ -1,6860 +0,0 @@ -{ - "http://basex.org/modules/admin": { - "ns": "http://basex.org/modules/admin", - "prefixes": [ - "admin" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/admin#logs#0": { - "name": "logs", - "uri": "http://basex.org/modules/admin", - "key": "http://basex.org/modules/admin#logs#0", - "params": [], - "type": "element(file)*", - "description": " Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
" - }, - "http://basex.org/modules/admin#logs#1": { - "name": "logs", - "uri": "http://basex.org/modules/admin", - "key": "http://basex.org/modules/admin#logs#1", - "params": [ - "$date as xs:string" - ], - "type": "element(entry)*", - "description": " Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
" - }, - "http://basex.org/modules/admin#logs#2": { - "name": "logs", - "uri": "http://basex.org/modules/admin", - "key": "http://basex.org/modules/admin#logs#2", - "params": [ - "$date as xs:string", - "$merge as xs:boolean" - ], - "type": "element(entry)*", - "description": " Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
" - }, - "http://basex.org/modules/admin#write-log#1": { - "name": "write-log", - "uri": "http://basex.org/modules/admin", - "key": "http://basex.org/modules/admin#write-log#1", - "params": [ - "$text as xs:string" - ], - "type": "empty-sequence()", - "description": " Writes a string to the database logs, along with current user data (timestamp, username). An optional log $type can be specified. If omitted, the log type is INFO.
If the function is called from a database client, the IP will be logged. Otherwise, the string SERVER will be logged." - }, - "http://basex.org/modules/admin#write-log#2": { - "name": "write-log", - "uri": "http://basex.org/modules/admin", - "key": "http://basex.org/modules/admin#write-log#2", - "params": [ - "$text as xs:string", - "$type as xs:string" - ], - "type": "empty-sequence()", - "description": " Writes a string to the database logs, along with current user data (timestamp, username). An optional log $type can be specified. If omitted, the log type is INFO.
If the function is called from a database client, the IP will be logged. Otherwise, the string SERVER will be logged." - }, - "http://basex.org/modules/admin#delete-logs#1": { - "name": "delete-logs", - "uri": "http://basex.org/modules/admin", - "key": "http://basex.org/modules/admin#delete-logs#1", - "params": [ - "$date as xs:string" - ], - "type": "empty-sequence()", - "description": " Deletes the log entries from the specified $date" - }, - "http://basex.org/modules/admin#sessions#0": { - "name": "sessions", - "uri": "http://basex.org/modules/admin", - "key": "http://basex.org/modules/admin#sessions#0", - "params": [], - "type": "element(session)*", - "description": " Returns an element sequence with all currently opened database sessions, including the username, address (IP:port) and an optionally opened database.
The output of this function and the SHOW SESSIONS command is similar." - } - }, - "description": " This XQuery Module contains functions for performing admin-centric operations such as managing database users and log data.", - "type": "module", - "override": true - }, - "http://basex.org/modules/archive": { - "ns": "http://basex.org/modules/archive", - "prefixes": [ - "archive" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/archive#entries#1": { - "name": "entries", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#entries#1", - "params": [ - "$archive as xs:base64Binary" - ], - "type": "element(archive:entry)*", - "description": " Returns the entry descriptors of the specified $archive. A descriptor contains the following attributes, provided that they are available in the archive format:
  • size: original file size
  • last-modified: timestamp, formatted as xs:dateTime
  • compressed-size: compressed file size

An example:

  <archive:entry size= \"1840\" last-modified= \"2009-03-20T03:30:32\" compressed-size= \"672\" > doc/index.html </archive:entry> 
" - }, - "http://basex.org/modules/archive#options#1": { - "name": "options", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#options#1", - "params": [ - "$archive as xs:base64Binary" - ], - "type": "map(*)", - "description": " Returns the options of the specified $archive in the format specified by archive:create ." - }, - "http://basex.org/modules/archive#extract-text#1": { - "name": "extract-text", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#extract-text#1", - "params": [ - "$archive as xs:base64Binary" - ], - "type": "xs:string*", - "description": " Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding." - }, - "http://basex.org/modules/archive#extract-text#2": { - "name": "extract-text", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#extract-text#2", - "params": [ - "$archive as xs:base64Binary", - "$entries as item()*" - ], - "type": "xs:string*", - "description": " Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding." - }, - "http://basex.org/modules/archive#extract-text#3": { - "name": "extract-text", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#extract-text#3", - "params": [ - "$archive as xs:base64Binary", - "$entries as item()*", - "$encoding as xs:string" - ], - "type": "xs:string*", - "description": " Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding." - }, - "http://basex.org/modules/archive#extract-binary#1": { - "name": "extract-binary", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#extract-binary#1", - "params": [ - "$archive as xs:base64Binary" - ], - "type": "xs:base64Binary*", - "description": " Extracts entries of the specified $archive and returns them as binaries.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored)." - }, - "http://basex.org/modules/archive#extract-binary#2": { - "name": "extract-binary", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#extract-binary#2", - "params": [ - "$archive as xs:base64Binary", - "$entries as item()*" - ], - "type": "xs:base64Binary*", - "description": " Extracts entries of the specified $archive and returns them as binaries.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored)." - }, - "http://basex.org/modules/archive#create#2": { - "name": "create", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#create#2", - "params": [ - "$entries as item()", - "$contents as item()*" - ], - "type": "xs:base64Binary", - "description": " Creates a new archive from the specified entries and contents.
The $entries argument contains meta information required to create new entries. All items may either be of type xs:string, representing the entry name, or element(archive:entry), containing the name as text node and additional, optional attributes:
  • last-modified: timestamp, specified as xs:dateTime (default: current time)
  • compression-level: 0-9, 0 = uncompressed (default: 8)
  • encoding: for textual entries (default: UTF-8)

An example:

  <archive:entry last-modified= '2011-11-11T11:11:11' compression-level= '8' encoding= 'US-ASCII' >hello.txt</archive:entry> 

The actual $contents must be xs:string or xs:base64Binary items.
The $options parameter contains archiving options:

  • format: allowed values are zip and gzip. zip is the default.
  • algorithm: allowed values are deflate and stored (for the zip format). deflate is the default.
" - }, - "http://basex.org/modules/archive#create#3": { - "name": "create", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#create#3", - "params": [ - "$entries as item()", - "$contents as item()*", - "$options as map(*)?" - ], - "type": "xs:base64Binary", - "description": " Creates a new archive from the specified entries and contents.
The $entries argument contains meta information required to create new entries. All items may either be of type xs:string, representing the entry name, or element(archive:entry), containing the name as text node and additional, optional attributes:
  • last-modified: timestamp, specified as xs:dateTime (default: current time)
  • compression-level: 0-9, 0 = uncompressed (default: 8)
  • encoding: for textual entries (default: UTF-8)

An example:

  <archive:entry last-modified= '2011-11-11T11:11:11' compression-level= '8' encoding= 'US-ASCII' >hello.txt</archive:entry> 

The actual $contents must be xs:string or xs:base64Binary items.
The $options parameter contains archiving options:

  • format: allowed values are zip and gzip. zip is the default.
  • algorithm: allowed values are deflate and stored (for the zip format). deflate is the default.
" - }, - "http://basex.org/modules/archive#update#3": { - "name": "update", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#update#3", - "params": [ - "$archive as xs:base64Binary", - "$entries as item()*", - "$contents as item()*" - ], - "type": "xs:base64Binary", - "description": " Creates an updated version of the specified $archive with new or replaced entries.
The format of $entries and $contents is the same as for archive:create ." - }, - "http://basex.org/modules/archive#delete#2": { - "name": "delete", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#delete#2", - "params": [ - "$archive as xs:base64Binary", - "$entries as item()*" - ], - "type": "xs:base64Binary", - "description": " Deletes entries from an $archive.
The format of $entries is the same as for archive:create ." - }, - "http://basex.org/modules/archive#create-from#1": { - "name": "create-from", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#create-from#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:base64Binary", - "description": " This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is identical to archive:create , but two additional options are available:
  • recursive: parse all files recursively (default: true; ignored if entries are specified via the last argument).
  • root-dir: use name of supplied directory as archive root directory (default: false).
" - }, - "http://basex.org/modules/archive#create-from#2": { - "name": "create-from", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#create-from#2", - "params": [ - "$path as xs:string", - "$options as map(*)?" - ], - "type": "xs:base64Binary", - "description": " This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is identical to archive:create , but two additional options are available:
  • recursive: parse all files recursively (default: true; ignored if entries are specified via the last argument).
  • root-dir: use name of supplied directory as archive root directory (default: false).
" - }, - "http://basex.org/modules/archive#create-from#3": { - "name": "create-from", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#create-from#3", - "params": [ - "$path as xs:string", - "$options as map(*)?", - "$entries as item()*" - ], - "type": "xs:base64Binary", - "description": " This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is identical to archive:create , but two additional options are available:
  • recursive: parse all files recursively (default: true; ignored if entries are specified via the last argument).
  • root-dir: use name of supplied directory as archive root directory (default: false).
" - }, - "http://basex.org/modules/archive#extract-to#2": { - "name": "extract-to", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#extract-to#2", - "params": [ - "$path as xs:string", - "$archive as xs:base64Binary" - ], - "type": "empty-sequence()", - "description": " This convenience function writes files of an $archive directly to the specified directory $path.
The archive entries to be written can be restricted via $entries. The format of the argument is the same as for archive:create (attributes will be ignored)." - }, - "http://basex.org/modules/archive#extract-to#3": { - "name": "extract-to", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#extract-to#3", - "params": [ - "$path as xs:string", - "$archive as xs:base64Binary", - "$entries as item()*" - ], - "type": "empty-sequence()", - "description": " This convenience function writes files of an $archive directly to the specified directory $path.
The archive entries to be written can be restricted via $entries. The format of the argument is the same as for archive:create (attributes will be ignored)." - }, - "http://basex.org/modules/archive#write#3": { - "name": "write", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#write#3", - "params": [ - "$path as xs:string", - "$entries as item()", - "$contents as item()*" - ], - "type": "xs:base64Binary", - "description": " This convenience function creates a new archive from the specified $entries and $contents and writes it disk.
See archive:create for more details." - }, - "http://basex.org/modules/archive#write#4": { - "name": "write", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#write#4", - "params": [ - "$path as xs:string", - "$entries as item()", - "$contents as item()*", - "$options as map(*)?" - ], - "type": "xs:base64Binary", - "description": " This convenience function creates a new archive from the specified $entries and $contents and writes it disk.
See archive:create for more details." - } - }, - "description": " This XQuery Module contains functions to handle archives (including ePub, Open Office, JAR, and many other formats). New ZIP and GZIP archives can be created, existing archives can be updated, and the archive entries can be listed and extracted. The archive:extract-binary function includes an example for writing the contents of an archive to disk.", - "type": "module", - "override": true - }, - "http://www.w3.org/2005/xpath-functions/array": { - "ns": "http://www.w3.org/2005/xpath-functions/array", - "prefixes": [ - "array" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://www.w3.org/2005/xpath-functions/array#size#1": { - "name": "size", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#size#1", - "params": [ - "$input as array(*)" - ], - "type": "xs:integer", - "description": " Returns the number of members in $array. Note that because an array is an item, the fn:count function when applied to an array always returns 1." - }, - "http://www.w3.org/2005/xpath-functions/array#get#2": { - "name": "get", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#get#2", - "params": [ - "$array as array(*)", - "$position as xs:integer" - ], - "type": "item()*", - "description": " Returns the $array member at the specified $position." - }, - "http://www.w3.org/2005/xpath-functions/array#append#2": { - "name": "append", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#append#2", - "params": [ - "$array as array(*)", - "$member as item()*" - ], - "type": "array(*)", - "description": " Returns a copy of $array with a new $member attached." - }, - "http://www.w3.org/2005/xpath-functions/array#subarray#2": { - "name": "subarray", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#subarray#2", - "params": [ - "$array as array(*)", - "$position as xs:integer" - ], - "type": "array(*)", - "description": " Constructs a new array with with $length members of $array beginning from the specified $position.
The two-argument version of the function returns the same result as the three-argument version when called with $length equal to the value of array:size($array) - $position + 1." - }, - "http://www.w3.org/2005/xpath-functions/array#subarray#3": { - "name": "subarray", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#subarray#3", - "params": [ - "$array as array(*)", - "$position as xs:integer", - "$length as xs:integer" - ], - "type": "array(*)", - "description": " Constructs a new array with with $length members of $array beginning from the specified $position.
The two-argument version of the function returns the same result as the three-argument version when called with $length equal to the value of array:size($array) - $position + 1." - }, - "http://www.w3.org/2005/xpath-functions/array#put#3": { - "name": "put", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#put#3", - "params": [ - "$array as array(*)", - "$position as xs:integer", - "$member as item()*" - ], - "type": "array(*)", - "description": " Returns a copy of $array with $member replaced at the specified $position. Equivalent to $array => array:remove($position) => array:insert-before($position, $member)." - }, - "http://www.w3.org/2005/xpath-functions/array#remove#2": { - "name": "remove", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#remove#2", - "params": [ - "$array as array(*)", - "$positions as xs:integer*" - ], - "type": "array(*)", - "description": " Returns a copy of $array without the member at the specified $positions." - }, - "http://www.w3.org/2005/xpath-functions/array#insert-before#3": { - "name": "insert-before", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#insert-before#3", - "params": [ - "$array as array(*)", - "$position as xs:integer", - "$member as item()*" - ], - "type": "array(*)", - "description": " Returns a copy of $array with one new $member at the specified $position. Setting $position to the value array:size($array) + 1 yields the same result as array:append($array, $insert)." - }, - "http://www.w3.org/2005/xpath-functions/array#head#1": { - "name": "head", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#head#1", - "params": [ - "$array as array(*)" - ], - "type": "item()*", - "description": " Returns the first member of $array. This function is equivalent to the expression $array(1)." - }, - "http://www.w3.org/2005/xpath-functions/array#tail#1": { - "name": "tail", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#tail#1", - "params": [ - "$array as array(*)" - ], - "type": "array(*)", - "description": " Returns a new array with all members except the first from $array. This function is equivalent to the expression array:remove($array, 1)." - }, - "http://www.w3.org/2005/xpath-functions/array#reverse#1": { - "name": "reverse", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#reverse#1", - "params": [ - "$array as array(*)" - ], - "type": "array(*)", - "description": " Returns a new array with all members of $array in reverse order." - }, - "http://www.w3.org/2005/xpath-functions/array#join#1": { - "name": "join", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#join#1", - "params": [ - "$arrays as array(*)*" - ], - "type": "array(*)", - "description": " Concatenates the contents of several $arrays into a single array." - }, - "http://www.w3.org/2005/xpath-functions/array#flatten#1": { - "name": "flatten", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#flatten#1", - "params": [ - "$items as item()*" - ], - "type": "item()*", - "description": " Recursively flattens all arrays that occur in the supplied $items." - }, - "http://www.w3.org/2005/xpath-functions/array#for-each#2": { - "name": "for-each", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#for-each#2", - "params": [ - "$array as array(*)", - "$function as function(item()*) as item()*" - ], - "type": "array(*)", - "description": " Returns a new array, in which each member is computed by applying $function to the corresponding member of $array." - }, - "http://www.w3.org/2005/xpath-functions/array#filter#2": { - "name": "filter", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#filter#2", - "params": [ - "$array as array(*)", - "$function as function(item()*) as xs:boolean" - ], - "type": "array(*)", - "description": " Returns a new array with those members of $array for which $function returns true." - }, - "http://www.w3.org/2005/xpath-functions/array#fold-left#3": { - "name": "fold-left", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#fold-left#3", - "params": [ - "$array as array(*)", - "$zero as item()*", - "$function as function(item()*, item()*) as item()*" - ], - "type": "item()*", - "description": " Evaluates the supplied $function cumulatively on successive members of the supplied $array from left to right and using $zero as first argument." - }, - "http://www.w3.org/2005/xpath-functions/array#fold-right#3": { - "name": "fold-right", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#fold-right#3", - "params": [ - "$array as array(*)", - "$zero as item()*", - "$function as function(item()*, item()*) as item()*" - ], - "type": "item()*", - "description": " Evaluates the supplied $function cumulatively on successive members of the supplied $array from right to left and using $zero as first argument." - }, - "http://www.w3.org/2005/xpath-functions/array#for-each-pair#3": { - "name": "for-each-pair", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#for-each-pair#3", - "params": [ - "$array1 as array(*)", - "$array2 as array(*)", - "$function as function(item()*) as item()*" - ], - "type": "array(*)", - "description": " Returns a new array obtained by evaluating the supplied $function for each pair of members at the same position in $array1 and $array2." - }, - "http://www.w3.org/2005/xpath-functions/array#sort#1": { - "name": "sort", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#sort#1", - "params": [ - "$array as array(*)" - ], - "type": "array(*)", - "description": " Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression." - }, - "http://www.w3.org/2005/xpath-functions/array#sort#2": { - "name": "sort", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#sort#2", - "params": [ - "$array as array(*)", - "$collation as xs:string?" - ], - "type": "array(*)", - "description": " Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression." - }, - "http://www.w3.org/2005/xpath-functions/array#sort#3": { - "name": "sort", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#sort#3", - "params": [ - "$array as array(*)", - "$collation as xs:string?", - "$key as function(item()*) as xs:anyAtomicType*" - ], - "type": "array(*)", - "description": " Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression." - } - }, - "description": " This XQuery Module contains functions for manipulating arrays, which has been introduced with XQuery 3.1.", - "type": "module", - "override": true - }, - "http://expath.org/ns/binary": { - "ns": "http://expath.org/ns/binary", - "prefixes": [ - "bin" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://expath.org/ns/binary#hex#1": { - "name": "hex", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#hex#1", - "params": [ - "$in as xs:string?" - ], - "type": "xs:base64Binary?", - "description": " Returns the binary form of the set of octets written as a sequence of (ASCII) hex digits ([0-9A-Fa-f]).
$in will be effectively zero-padded from the left to generate an integral number of octets, i.e. an even number of hexadecimal digits. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#bin#1": { - "name": "bin", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#bin#1", - "params": [ - "$in as xs:string?" - ], - "type": "xs:base64Binary?", - "description": " Returns the binary form of the set of octets written as a sequence of (8-wise) (ASCII) binary digits ([01]).
$in will be effectively zero-padded from the left to generate an integral number of octets. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#octal#1": { - "name": "octal", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#octal#1", - "params": [ - "$in as xs:string?" - ], - "type": "xs:base64Binary?", - "description": " Returns the binary form of the set of octets written as a sequence of (ASCII) octal digits ([0-7]).
$in will be effectively zero-padded from the left to generate an integral number of octets. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#to-octets#1": { - "name": "to-octets", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#to-octets#1", - "params": [ - "$in as xs:base64Binary" - ], - "type": "xs:integer*", - "description": " Returns binary data as a sequence of octets.
If $in is a zero length binary data then the empty sequence is returned. Octets are returned as integers from 0 to 255." - }, - "http://expath.org/ns/binary#from-octets#1": { - "name": "from-octets", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#from-octets#1", - "params": [ - "$in as xs:integer*" - ], - "type": "xs:base64Binary", - "description": " Converts a sequence of octets into binary data.
Octets are integers from 0 to 255. If the value of $in is the empty sequence, the function returns zero-sized binary data." - }, - "http://expath.org/ns/binary#length#1": { - "name": "length", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#length#1", - "params": [ - "$in as xs:base64Binary" - ], - "type": "xs:integer", - "description": " Returns the size of binary data in octets." - }, - "http://expath.org/ns/binary#part#2": { - "name": "part", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#part#2", - "params": [ - "$in as xs:base64Binary?", - "$offset as xs:integer" - ], - "type": "xs:base64Binary?", - "description": " Returns a section of binary data starting at the $offset octet.
If $size is specified, the size of the returned binary data is $size octets. If $size is absent, all remaining data from $offset is returned. The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#part#3": { - "name": "part", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#part#3", - "params": [ - "$in as xs:base64Binary?", - "$offset as xs:integer", - "$size as xs:integer" - ], - "type": "xs:base64Binary?", - "description": " Returns a section of binary data starting at the $offset octet.
If $size is specified, the size of the returned binary data is $size octets. If $size is absent, all remaining data from $offset is returned. The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#join#1": { - "name": "join", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#join#1", - "params": [ - "$in as xs:base64Binary*" - ], - "type": "xs:base64Binary", - "description": " Returns an xs:base64Binary created by concatenating the items in the sequence $in, in order. If the value of $in is the empty sequence, the function returns a binary item containing no data bytes." - }, - "http://expath.org/ns/binary#insert-before#3": { - "name": "insert-before", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#insert-before#3", - "params": [ - "$in as xs:base64Binary?", - "$offset as xs:integer", - "$extra as xs:base64Binary?" - ], - "type": "xs:base64Binary?", - "description": " Returns binary data consisting sequentially of the data from $in up to and including the $offset - 1 octet, followed by all the data from $extra, and then the remaining data from $in.
The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#pad-left#2": { - "name": "pad-left", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pad-left#2", - "params": [ - "$in as xs:base64Binary?", - "$size as xs:integer" - ], - "type": "xs:base64Binary?", - "description": " Returns an xs:base64Binary created by padding the input with $size octets in front of the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#pad-left#3": { - "name": "pad-left", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pad-left#3", - "params": [ - "$in as xs:base64Binary?", - "$size as xs:integer", - "$octet as xs:integer" - ], - "type": "xs:base64Binary?", - "description": " Returns an xs:base64Binary created by padding the input with $size octets in front of the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#pad-right#2": { - "name": "pad-right", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pad-right#2", - "params": [ - "$in as xs:base64Binary?", - "$size as xs:integer" - ], - "type": "xs:base64Binary?", - "description": " Returns an xs:base64Binary created by padding the input with $size octets after the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#pad-right#3": { - "name": "pad-right", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pad-right#3", - "params": [ - "$in as xs:base64Binary?", - "$size as xs:integer", - "$octet as xs:integer" - ], - "type": "xs:base64Binary?", - "description": " Returns an xs:base64Binary created by padding the input with $size octets after the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#find#3": { - "name": "find", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#find#3", - "params": [ - "$in as xs:base64Binary?", - "$offset as xs:integer", - "$search as xs:base64Binary" - ], - "type": "xs:integer?", - "description": " Returns the first location of the binary search sequence in the input, or if not found, the empty sequence.
The $offset and the returned location are zero based. If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#decode-string#2": { - "name": "decode-string", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#decode-string#2", - "params": [ - "$in as xs:base64Binary?", - "$encoding as xs:string" - ], - "type": "xs:string?", - "description": " Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#decode-string#3": { - "name": "decode-string", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#decode-string#3", - "params": [ - "$in as xs:base64Binary?", - "$encoding as xs:string", - "$offset as xs:integer" - ], - "type": "xs:string?", - "description": " Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#decode-string#4": { - "name": "decode-string", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#decode-string#4", - "params": [ - "$in as xs:base64Binary?", - "$encoding as xs:string", - "$offset as xs:integer", - "$size as xs:integer" - ], - "type": "xs:string?", - "description": " Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#encode-string#2": { - "name": "encode-string", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#encode-string#2", - "params": [ - "$in as xs:string?", - "$encoding as xs:string" - ], - "type": "xs:base64Binary?", - "description": " Encodes a string into binary data using a given $encoding.
If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#pack-double#1": { - "name": "pack-double", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pack-double#1", - "params": [ - "$in as xs:double" - ], - "type": "xs:base64Binary", - "description": " Returns the 8-octet binary representation of a double value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified." - }, - "http://expath.org/ns/binary#pack-double#2": { - "name": "pack-double", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pack-double#2", - "params": [ - "$in as xs:double", - "$octet-order as xs:string" - ], - "type": "xs:base64Binary", - "description": " Returns the 8-octet binary representation of a double value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified." - }, - "http://expath.org/ns/binary#pack-float#1": { - "name": "pack-float", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pack-float#1", - "params": [ - "$in as xs:float" - ], - "type": "xs:base64Binary", - "description": " Returns the 4-octet binary representation of a float value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified." - }, - "http://expath.org/ns/binary#pack-float#2": { - "name": "pack-float", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pack-float#2", - "params": [ - "$in as xs:float", - "$octet-order as xs:string" - ], - "type": "xs:base64Binary", - "description": " Returns the 4-octet binary representation of a float value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified." - }, - "http://expath.org/ns/binary#pack-integer#2": { - "name": "pack-integer", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pack-integer#2", - "params": [ - "$in as xs:integer", - "$size as xs:integer" - ], - "type": "xs:base64Binary", - "description": " Returns the twos-complement binary representation of an integer value treated as $size octets long. Any 'excess' high-order bits are discarded.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. Specifying a $size of zero yields an empty binary data." - }, - "http://expath.org/ns/binary#pack-integer#3": { - "name": "pack-integer", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pack-integer#3", - "params": [ - "$in as xs:integer", - "$size as xs:integer", - "$octet-order as xs:string" - ], - "type": "xs:base64Binary", - "description": " Returns the twos-complement binary representation of an integer value treated as $size octets long. Any 'excess' high-order bits are discarded.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. Specifying a $size of zero yields an empty binary data." - }, - "http://expath.org/ns/binary#unpack-double#2": { - "name": "unpack-double", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-double#2", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer" - ], - "type": "xs:double", - "description": " Extracts the double value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based." - }, - "http://expath.org/ns/binary#unpack-double#3": { - "name": "unpack-double", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-double#3", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer", - "$octet-order as xs:string" - ], - "type": "xs:double", - "description": " Extracts the double value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based." - }, - "http://expath.org/ns/binary#unpack-float#2": { - "name": "unpack-float", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-float#2", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer" - ], - "type": "xs:float", - "description": " Extracts the float value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based." - }, - "http://expath.org/ns/binary#unpack-float#3": { - "name": "unpack-float", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-float#3", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer", - "$octet-order as xs:string" - ], - "type": "xs:float", - "description": " Extracts the float value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based." - }, - "http://expath.org/ns/binary#unpack-integer#3": { - "name": "unpack-integer", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-integer#3", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer", - "$size as xs:integer" - ], - "type": "xs:integer", - "description": " Returns a signed integer value represented by the $size octets starting from $offset in the input binary representation. Necessary sign extension is performed (i.e. the result is negative if the high order bit is '1').
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0." - }, - "http://expath.org/ns/binary#unpack-integer#4": { - "name": "unpack-integer", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-integer#4", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer", - "$size as xs:integer", - "$octet-order as xs:string" - ], - "type": "xs:integer", - "description": " Returns a signed integer value represented by the $size octets starting from $offset in the input binary representation. Necessary sign extension is performed (i.e. the result is negative if the high order bit is '1').
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0." - }, - "http://expath.org/ns/binary#unpack-unsigned-integer#3": { - "name": "unpack-unsigned-integer", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-unsigned-integer#3", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer", - "$size as xs:integer" - ], - "type": "xs:integer", - "description": " Returns an unsigned integer value represented by the $size octets starting from $offset in the input binary representation.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0." - }, - "http://expath.org/ns/binary#unpack-unsigned-integer#4": { - "name": "unpack-unsigned-integer", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-unsigned-integer#4", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer", - "$size as xs:integer", - "$octet-order as xs:string" - ], - "type": "xs:integer", - "description": " Returns an unsigned integer value represented by the $size octets starting from $offset in the input binary representation.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0." - }, - "http://expath.org/ns/binary#or#2": { - "name": "or", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#or#2", - "params": [ - "$a as xs:base64Binary?", - "$b as xs:base64Binary?" - ], - "type": "xs:base64Binary?", - "description": " Returns the \"bitwise or\" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned." - }, - "http://expath.org/ns/binary#xor#2": { - "name": "xor", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#xor#2", - "params": [ - "$a as xs:base64Binary?", - "$b as xs:base64Binary?" - ], - "type": "xs:base64Binary?", - "description": " Returns the \"bitwise xor\" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned." - }, - "http://expath.org/ns/binary#and#2": { - "name": "and", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#and#2", - "params": [ - "$a as xs:base64Binary?", - "$b as xs:base64Binary?" - ], - "type": "xs:base64Binary?", - "description": " Returns the \"bitwise and\" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned." - }, - "http://expath.org/ns/binary#not#1": { - "name": "not", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#not#1", - "params": [ - "$in as xs:base64Binary?" - ], - "type": "xs:base64Binary?", - "description": " Returns the \"bitwise not\" of a binary argument.
If the argument is the empty sequence, an empty sequence is returned." - }, - "http://expath.org/ns/binary#shift#2": { - "name": "shift", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#shift#2", - "params": [ - "$in as xs:base64Binary?", - "$by as xs:integer" - ], - "type": "xs:base64Binary?", - "description": " Shifts bits in binary data.
If $by is zero, the result is identical to $in. If $by is positive then bits are shifted to the left. Otherwise, bits are shifted to the right. If the absolute value of $by is greater than the bit-length of $in then an all-zeros result is returned. The result always has the same size as $in. The shifting is logical: zeros are placed into discarded bits. If the value of $in is the empty sequence, the function returns an empty sequence." - } - }, - "description": " This XQuery Module contains functions to process binary data, including extracting subparts, searching, basic binary operations and conversion between binary and structured forms.", - "type": "module", - "override": true - }, - "http://basex.org/modules/client": { - "ns": "http://basex.org/modules/client", - "prefixes": [ - "client" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/client#connect#4": { - "name": "connect", - "uri": "http://basex.org/modules/client", - "key": "http://basex.org/modules/client#connect#4", - "params": [ - "$host as xs:string", - "$port as xs:integer", - "$username as xs:string", - "$password as xs:string" - ], - "type": "xs:anyURI", - "description": " This function establishes a connection to a remote BaseX server, creates a new client session, and returns a session id. The parameter $host is the name of the database server, $port specifies the server port, and $username and $password represent the login data." - }, - "http://basex.org/modules/client#execute#2": { - "name": "execute", - "uri": "http://basex.org/modules/client", - "key": "http://basex.org/modules/client#execute#2", - "params": [ - "$id as xs:anyURI", - "$command as xs:string" - ], - "type": "xs:string", - "description": " This function executes a command and returns the result as a string. The parameter $id contains the session ID returned by client:connect . The $command argument represents a single command, which will be executed by the server." - }, - "http://basex.org/modules/client#info#1": { - "name": "info", - "uri": "http://basex.org/modules/client", - "key": "http://basex.org/modules/client#info#1", - "params": [ - "$id as xs:anyURI" - ], - "type": "xs:string", - "description": " This function returns an information string, created by the last call of client:execute . $id specifies the session id." - }, - "http://basex.org/modules/client#query#2": { - "name": "query", - "uri": "http://basex.org/modules/client", - "key": "http://basex.org/modules/client#query#2", - "params": [ - "$id as xs:anyURI", - "$query as xs:string" - ], - "type": "item()*", - "description": " Evaluates a query and returns the result as sequence. The parameter $id contains the session id returned by client:connect , and $query represents the query string, which will be evaluated by the server.
Variables and the context item can be declared via $bindings. The specified keys must be QNames or strings:
  • If a key is a QName, it will be directly adopted as variable name.
  • If a key is a string, it may be prefixed with a dollar sign. A namespace can be specified using the Clark Notation. If the specified string is empty, the value will be bound to the context item.
" - }, - "http://basex.org/modules/client#query#3": { - "name": "query", - "uri": "http://basex.org/modules/client", - "key": "http://basex.org/modules/client#query#3", - "params": [ - "$id as xs:anyURI", - "$query as xs:string", - "$bindings as map(*)?" - ], - "type": "item()*", - "description": " Evaluates a query and returns the result as sequence. The parameter $id contains the session id returned by client:connect , and $query represents the query string, which will be evaluated by the server.
Variables and the context item can be declared via $bindings. The specified keys must be QNames or strings:
  • If a key is a QName, it will be directly adopted as variable name.
  • If a key is a string, it may be prefixed with a dollar sign. A namespace can be specified using the Clark Notation. If the specified string is empty, the value will be bound to the context item.
" - }, - "http://basex.org/modules/client#close#1": { - "name": "close", - "uri": "http://basex.org/modules/client", - "key": "http://basex.org/modules/client#close#1", - "params": [ - "$id as xs:anyURI" - ], - "type": "empty-sequence()", - "description": " This function closes a client session. $id specifies the session id.
Opened connections will automatically be closed after the XQuery expression has been evaluated, but it is recommendable to explicitly close them with this function if you open many connections." - } - }, - "description": " This XQuery Module contains functions to access BaseX server instances from XQuery. With this module, you can execute database commands and evaluate XQuery expressions.", - "type": "module", - "override": true - }, - "http://basex.org/modules/convert": { - "ns": "http://basex.org/modules/convert", - "prefixes": [ - "convert" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/convert#binary-to-string#1": { - "name": "binary-to-string", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#binary-to-string#1", - "params": [ - "$bytes as xs:anyAtomicType" - ], - "type": "xs:string", - "description": " Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://basex.org/modules/convert#binary-to-string#2": { - "name": "binary-to-string", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#binary-to-string#2", - "params": [ - "$bytes as xs:anyAtomicType", - "$encoding as xs:string" - ], - "type": "xs:string", - "description": " Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://basex.org/modules/convert#binary-to-string#3": { - "name": "binary-to-string", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#binary-to-string#3", - "params": [ - "$bytes as xs:anyAtomicType", - "$encoding as xs:string", - "$fallback as xs:boolean" - ], - "type": "xs:string", - "description": " Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://basex.org/modules/convert#string-to-base64#1": { - "name": "string-to-base64", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#string-to-base64#1", - "params": [ - "$string as xs:string" - ], - "type": "xs:base64Binary", - "description": " Converts the specified $string to an xs:base64Binary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument." - }, - "http://basex.org/modules/convert#string-to-base64#2": { - "name": "string-to-base64", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#string-to-base64#2", - "params": [ - "$string as xs:string", - "$encoding as xs:string" - ], - "type": "xs:base64Binary", - "description": " Converts the specified $string to an xs:base64Binary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument." - }, - "http://basex.org/modules/convert#string-to-hex#1": { - "name": "string-to-hex", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#string-to-hex#1", - "params": [ - "$string as xs:string" - ], - "type": "xs:hexBinary", - "description": " Converts the specified $string to an xs:hexBinary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument." - }, - "http://basex.org/modules/convert#string-to-hex#2": { - "name": "string-to-hex", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#string-to-hex#2", - "params": [ - "$string as xs:string", - "$encoding as xs:string" - ], - "type": "xs:hexBinary", - "description": " Converts the specified $string to an xs:hexBinary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument." - }, - "http://basex.org/modules/convert#integers-to-base64#1": { - "name": "integers-to-base64", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#integers-to-base64#1", - "params": [ - "$integers as xs:integer*" - ], - "type": "xs:base64Binary", - "description": " Converts the specified $integers to an item of type xs:base64Binary:
  • Only the first 8 bits of the supplied integers will be considered.
  • Conversion of byte sequences is very efficient, as items of binary type are internally represented as byte arrays.
" - }, - "http://basex.org/modules/convert#integers-to-hex#1": { - "name": "integers-to-hex", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#integers-to-hex#1", - "params": [ - "$integers as xs:integer*" - ], - "type": "xs:hexBinary", - "description": " Converts the specified $integers to an item of type xs:hexBinary:
  • Only the first 8 bits of the supplied integers will be considered.
  • Conversion of byte sequences is very efficient, as items of binary type are internally represented as byte arrays.
" - }, - "http://basex.org/modules/convert#binary-to-integers#1": { - "name": "binary-to-integers", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#binary-to-integers#1", - "params": [ - "$binary as xs:anyAtomicType" - ], - "type": "xs:integer*", - "description": " Returns the specified $binary (xs:base64Binary, xs:hexBinary) as a sequence of unsigned integers (octets)." - }, - "http://basex.org/modules/convert#binary-to-bytes#1": { - "name": "binary-to-bytes", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#binary-to-bytes#1", - "params": [ - "$binary as xs:anyAtomicType" - ], - "type": "xs:byte*", - "description": " Returns the specified $binary (xs:base64Binary, xs:hexBinary) as a sequence of bytes. The conversion is very cheap and takes no additional memory, as items of binary type are internally represented as byte arrays." - }, - "http://basex.org/modules/convert#integer-to-base#2": { - "name": "integer-to-base", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#integer-to-base#2", - "params": [ - "$number as xs:integer", - "$base as xs:integer" - ], - "type": "xs:string", - "description": " Converts $number to a string, using the specified $base, interpreting it as a 64-bit unsigned integer.
The first base elements of the sequence '0',..,'9','a',..,'z' are used as digits.
Valid bases are 2, .., 36.
" - }, - "http://basex.org/modules/convert#integer-from-base#2": { - "name": "integer-from-base", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#integer-from-base#2", - "params": [ - "$string as xs:string", - "$base as xs:integer" - ], - "type": "xs:integer", - "description": " Decodes an integer from $string, using the specified $base.
The first base elements of the sequence '0',..,'9','a',..,'z' are allowed as digits; case does not matter.
Valid bases are 2 - 36.
If the supplied string contains more than 64 bits of information, the result will be truncated." - }, - "http://basex.org/modules/convert#integer-to-dateTime#1": { - "name": "integer-to-dateTime", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#integer-to-dateTime#1", - "params": [ - "$milliseconds as xs:integer" - ], - "type": "xs:dateTime", - "description": " Converts the specified number of $milliseconds since 1 Jan 1970 to an item of type xs:dateTime.
" - }, - "http://basex.org/modules/convert#dateTime-to-integer#1": { - "name": "dateTime-to-integer", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#dateTime-to-integer#1", - "params": [ - "$dateTime as xs:dateTime" - ], - "type": "xs:integer", - "description": " Converts the specified $dateTime item to the number of milliseconds since 1 Jan 1970.
" - }, - "http://basex.org/modules/convert#integer-to-dayTime#1": { - "name": "integer-to-dayTime", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#integer-to-dayTime#1", - "params": [ - "$milliseconds as xs:integer" - ], - "type": "xs:dayTimeDuration", - "description": " Converts the specified number of $milliseconds to an item of type xs:dayTimeDuration.
" - }, - "http://basex.org/modules/convert#dayTime-to-integer#1": { - "name": "dayTime-to-integer", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#dayTime-to-integer#1", - "params": [ - "$dayTime as xs:dayTimeDuration" - ], - "type": "xs:integer", - "description": " Converts the specified $dayTime duration to milliseconds represented by an integer.
" - }, - "http://basex.org/modules/convert#encode-key#1": { - "name": "encode-key", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#encode-key#1", - "params": [ - "$key as xs:string" - ], - "type": "xs:string", - "description": " Encodes the specified $key (with the optional $lax conversion method) to a valid NCName representation, which can be used to create an element node:
  • An empty string is converted to a single underscore (_).
  • Existing underscores are rewritten to two underscores (__).
  • Characters that are no valid NCName characters are rewritten to an underscore and the character’s four-digit Unicode. For example, the exclamation mark ? is transformed to _003f.
  • If lax conversion is chosen, invalid characters are replaced with underscores or (when invalid as first character of an element name) prefixed with an underscore. The resulting string may be better readable, but it cannot necessarily be converted back to the original form.

This encoding is employed by the direct conversion format in the JSON Module and the CSV Module.

" - }, - "http://basex.org/modules/convert#encode-key#2": { - "name": "encode-key", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#encode-key#2", - "params": [ - "$key as xs:string", - "$lax as xs:boolean" - ], - "type": "xs:string", - "description": " Encodes the specified $key (with the optional $lax conversion method) to a valid NCName representation, which can be used to create an element node:
  • An empty string is converted to a single underscore (_).
  • Existing underscores are rewritten to two underscores (__).
  • Characters that are no valid NCName characters are rewritten to an underscore and the character’s four-digit Unicode. For example, the exclamation mark ? is transformed to _003f.
  • If lax conversion is chosen, invalid characters are replaced with underscores or (when invalid as first character of an element name) prefixed with an underscore. The resulting string may be better readable, but it cannot necessarily be converted back to the original form.

This encoding is employed by the direct conversion format in the JSON Module and the CSV Module.

" - }, - "http://basex.org/modules/convert#decode-key#1": { - "name": "decode-key", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#decode-key#1", - "params": [ - "$key as xs:string" - ], - "type": "xs:string", - "description": " Decodes the specified $key (with the optional $lax conversion method) to the original string representation.
Keys supplied to this function are usually element names from documents that have been created with the JSON Module or CSV Module." - }, - "http://basex.org/modules/convert#decode-key#2": { - "name": "decode-key", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#decode-key#2", - "params": [ - "$key as xs:string", - "$lax as xs:boolean" - ], - "type": "xs:string", - "description": " Decodes the specified $key (with the optional $lax conversion method) to the original string representation.
Keys supplied to this function are usually element names from documents that have been created with the JSON Module or CSV Module." - } - }, - "description": " This XQuery Module contains functions to convert data between different formats.", - "type": "module", - "override": true - }, - "http://expath.org/ns/crypto": { - "ns": "http://expath.org/ns/crypto", - "prefixes": [ - "crypto" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://expath.org/ns/crypto#hmac#3": { - "name": "hmac", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#hmac#3", - "params": [ - "$data as xs:anyAtomicType", - "$key as xs:anyAtomicType", - "$algorithm as xs:string" - ], - "type": "xs:string", - "description": " Creates an authentication code for the specified $data via a cryptographic hash function:
  • $key must not be empty.
  • $algorithm describes the hash algorithm which is used for encryption. Currently supported are md5, sha1, sha256, sha384, sha512. Default is md5.
  • $encoding must either be hex or base64; it specifies the encoding of the returned authentication code. Default is base64.
" - }, - "http://expath.org/ns/crypto#hmac#4": { - "name": "hmac", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#hmac#4", - "params": [ - "$data as xs:anyAtomicType", - "$key as xs:anyAtomicType", - "$algorithm as xs:string", - "$encoding as xs:string" - ], - "type": "xs:string", - "description": " Creates an authentication code for the specified $data via a cryptographic hash function:
  • $key must not be empty.
  • $algorithm describes the hash algorithm which is used for encryption. Currently supported are md5, sha1, sha256, sha384, sha512. Default is md5.
  • $encoding must either be hex or base64; it specifies the encoding of the returned authentication code. Default is base64.
" - }, - "http://expath.org/ns/crypto#encrypt#4": { - "name": "encrypt", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#encrypt#4", - "params": [ - "$data as xs:anyAtomicType", - "$type as xs:string", - "$key as xs:anyAtomicType", - "$algorithm as xs:string" - ], - "type": "xs:base64Binary", - "description": " Encrypts data with the specified key:
  • $data must be a string or binary item.
  • $type must be symmetric.
  • $key is the secret key which is used for both encryption and decryption of input data. It must be a string or binary item. Its length is fixed and depends on the chosen algorithm: 8 bytes for DES, 16 bytes for AES.
  • $algorithm must either be DES or AES. Default is DES.
" - }, - "http://expath.org/ns/crypto#decrypt#4": { - "name": "decrypt", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#decrypt#4", - "params": [ - "$data as xs:anyAtomicType", - "$type as xs:string", - "$key as xs:anyAtomicType", - "$algorithm as xs:string" - ], - "type": "xs:string", - "description": " Encrypts data with the specified key:
  • $data must be a string or binary item.
  • $type must be symmetric.
  • $key is the secret key which is used for both encryption and decryption of input data. It must be a string or binary item. Its length is fixed and depends on the chosen algorithm: 8 bytes for DES, 16 bytes for AES.
  • $algorithm must either be DES or AES. Default is DES.
" - }, - "http://expath.org/ns/crypto#generate-signature#6": { - "name": "generate-signature", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#generate-signature#6", - "params": [ - "$input as node()", - "$canonicalization as xs:string", - "$digest as xs:string", - "$signature as xs:string", - "$prefix as xs:string", - "$type as xs:string" - ], - "type": "node()", - "description": " $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

" - }, - "http://expath.org/ns/crypto#generate-signature#8": { - "name": "generate-signature", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#generate-signature#8", - "params": [ - "$input as node()", - "$canonicalization as xs:string", - "$digest as xs:string", - "$signature as xs:string", - "$prefix as xs:string", - "$type as xs:string", - "$xpath as xs:string", - "$certificate as node()" - ], - "type": "node()", - "description": " $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

" - }, - "http://expath.org/ns/crypto#generate-signature#7": { - "name": "generate-signature", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#generate-signature#7", - "params": [ - "$input as node()", - "$canonicalization as xs:string", - "$digest as xs:string", - "$signature as xs:string", - "$prefix as xs:string", - "$type as xs:string", - "$ext as item()" - ], - "type": "node()", - "description": " $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

" - }, - "http://expath.org/ns/crypto#validate-signature#1": { - "name": "validate-signature", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#validate-signature#1", - "params": [ - "$input-doc as node()" - ], - "type": "xs:boolean", - "description": " Checks if the given node contains a Signature element and whether the signature is valid. In this case true is returned. If the signature is invalid the function returns false." - } - }, - "description": " This XQuery Module contains functions to perform cryptographic operations in XQuery. The cryptographic module is based on an early draft of the EXPath Cryptographic Module and provides the following functionality: creation of message authentication codes (HMAC), encryption and decryption, and creation and validation of XML Digital Signatures.", - "type": "module", - "override": true - }, - "http://basex.org/modules/csv": { - "ns": "http://basex.org/modules/csv", - "prefixes": [ - "csv" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/csv#doc#1": { - "name": "doc", - "uri": "http://basex.org/modules/csv", - "key": "http://basex.org/modules/csv#doc#1", - "params": [ - "$uri as xs:string?" - ], - "type": "item()?", - "description": " Fetches the CSV document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/csv#doc#2": { - "name": "doc", - "uri": "http://basex.org/modules/csv", - "key": "http://basex.org/modules/csv#doc#2", - "params": [ - "$uri as xs:string?", - "$options as map(*)?" - ], - "type": "item()?", - "description": " Fetches the CSV document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/csv#parse#1": { - "name": "parse", - "uri": "http://basex.org/modules/csv", - "key": "http://basex.org/modules/csv#parse#1", - "params": [ - "$string as xs:string?" - ], - "type": "item()?", - "description": " Converts the CSV $string to an XQuery value. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/csv#parse#2": { - "name": "parse", - "uri": "http://basex.org/modules/csv", - "key": "http://basex.org/modules/csv#parse#2", - "params": [ - "$string as xs:string?", - "$options as map(*)?" - ], - "type": "item()?", - "description": " Converts the CSV $string to an XQuery value. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/csv#serialize#1": { - "name": "serialize", - "uri": "http://basex.org/modules/csv", - "key": "http://basex.org/modules/csv#serialize#1", - "params": [ - "$input as item()?" - ], - "type": "xs:string", - "description": " Serializes the specified $input as CSV, using the specified $options, and returns the result as string.

Values can also be serialized as CSV with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to csv, and
  • the options presented in this article need to be assigned to the csv parameter.
" - }, - "http://basex.org/modules/csv#serialize#2": { - "name": "serialize", - "uri": "http://basex.org/modules/csv", - "key": "http://basex.org/modules/csv#serialize#2", - "params": [ - "$input as item()?", - "$options as map(*)?" - ], - "type": "xs:string", - "description": " Serializes the specified $input as CSV, using the specified $options, and returns the result as string.

Values can also be serialized as CSV with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to csv, and
  • the options presented in this article need to be assigned to the csv parameter.
" - } - }, - "description": " This XQuery Module contains a single function to parse CSV input. CSV (comma-separated values) is a popular representation for tabular data, exported e. g. from Excel.", - "type": "module", - "override": true - }, - "http://basex.org/modules/db": { - "ns": "http://basex.org/modules/db", - "prefixes": [ - "db" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/db#system#0": { - "name": "system", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#system#0", - "params": [], - "type": "element(system)", - "description": " Returns general information on the database system the current values of all global and local Options. The INFO command returns similar output." - }, - "http://basex.org/modules/db#option#1": { - "name": "option", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#option#1", - "params": [ - "$name as xs:string" - ], - "type": "xs:string", - "description": " Returns the current value (string, integer, boolean, map) of a global or local Option with the specified $name. The SHOW OPTIONS command returns similar output." - }, - "http://basex.org/modules/db#info#1": { - "name": "info", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#info#1", - "params": [ - "$db as xs:string" - ], - "type": "element(database)", - "description": " Returns meta information on the database $db. The output is similar to the INFO DB command." - }, - "http://basex.org/modules/db#property#2": { - "name": "property", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#property#2", - "params": [ - "$db as xs:string", - "$name as xs:string" - ], - "type": "xs:anyAtomicType", - "description": " Returns the value (string, boolean, integer) of a property with the specified $name in the database $db. The available properties are the ones returned by db:info ." - }, - "http://basex.org/modules/db#list#0": { - "name": "list", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#list#0", - "params": [], - "type": "xs:string*", - "description": " The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
" - }, - "http://basex.org/modules/db#list#1": { - "name": "list", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#list#1", - "params": [ - "$db as xs:string" - ], - "type": "xs:string*", - "description": " The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
" - }, - "http://basex.org/modules/db#list#2": { - "name": "list", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#list#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "xs:string*", - "description": " The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
" - }, - "http://basex.org/modules/db#list-details#0": { - "name": "list-details", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#list-details#0", - "params": [], - "type": "element(database)*", - "description": " Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
" - }, - "http://basex.org/modules/db#list-details#1": { - "name": "list-details", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#list-details#1", - "params": [ - "$db as xs:string" - ], - "type": "element(resource)*", - "description": " Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
" - }, - "http://basex.org/modules/db#list-details#2": { - "name": "list-details", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#list-details#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "element(resource)*", - "description": " Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
" - }, - "http://basex.org/modules/db#dir#2": { - "name": "dir", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#dir#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "element()*", - "description": " Returns metadata on all directories and resources of the database $db in the specified directory $path. Two types of elements are returned:
  • resource represents a resource. The element value is the directory path; content type, modification date, raw flag (which indicates if the resource is binary or XML), and size of the resource are returned as attributes.
  • dir represents a directory. The element value is the directory path; the modification date is returned as attribute.

Please note that directories are not stored in BaseX. Instead, they result implicitly from the paths of stored resources.

" - }, - "http://basex.org/modules/db#get#1": { - "name": "get", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#get#1", - "params": [ - "$db as xs:string" - ], - "type": "document-node()*", - "description": " Returns all documents from the database $db, or only documents matching the specified $path." - }, - "http://basex.org/modules/db#get#2": { - "name": "get", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#get#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "document-node()*", - "description": " Returns all documents from the database $db, or only documents matching the specified $path." - }, - "http://basex.org/modules/db#get-pre#2": { - "name": "get-pre", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#get-pre#2", - "params": [ - "$db as xs:string", - "$pres as xs:integer*" - ], - "type": "node()*", - "description": " Returns all nodes from the database $db with the pre values $pres in distinct document order.
The PRE value provides very fast access to an existing database node, but it will change whenever a node with a smaller pre values is added to or deleted from a database." - }, - "http://basex.org/modules/db#get-id#2": { - "name": "get-id", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#get-id#2", - "params": [ - "$db as xs:string", - "$ids as xs:integer*" - ], - "type": "node()*", - "description": " Returns all nodes from the database $db with the pre values $ids in distinct document order.
Each database node has a persistent ID value. Access to the node ID can be sped up by turning on the UPDINDEX option." - }, - "http://basex.org/modules/db#get-binary#2": { - "name": "get-binary", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#get-binary#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "item()", - "description": " Returns a map with all paths and binary resources of the database $db. A single xs:base64Binary item is returned if a $path is specified. All items are lazy, i.e., the actual data will only be retrieved if it is processed." - }, - "http://basex.org/modules/db#get-value#2": { - "name": "get-value", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#get-value#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "item()*", - "description": " Returns a map with all paths and values of the database $db. A single value is returned if a $path is specified." - }, - "http://basex.org/modules/db#node-pre#1": { - "name": "node-pre", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#node-pre#1", - "params": [ - "$nodes as node()*" - ], - "type": "xs:integer*", - "description": " Returns the pre values of the specified $nodes, which must all be database nodes.
The PRE value provides very fast access to an existing database node, but it will change whenever a node with a smaller pre values is added to or deleted from a database." - }, - "http://basex.org/modules/db#node-id#1": { - "name": "node-id", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#node-id#1", - "params": [ - "$nodes as node()*" - ], - "type": "xs:integer*", - "description": " Returns the id values of the specified $nodes, which must all be database nodes.
Each database node has a persistent ID value. Access to the node id can be sped up by turning on the UPDINDEX option." - }, - "http://basex.org/modules/db#export#2": { - "name": "export", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#export#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "empty-sequence()", - "description": " Exports the specified database $db to the specified file $path. Existing files will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= \"div\" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { \"method\" : \"xml\" , \"cdata-section-elements\" : \"div\" , .. . } 
" - }, - "http://basex.org/modules/db#export#3": { - "name": "export", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#export#3", - "params": [ - "$db as xs:string", - "$path as xs:string", - "$params as item()" - ], - "type": "empty-sequence()", - "description": " Exports the specified database $db to the specified file $path. Existing files will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= \"div\" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { \"method\" : \"xml\" , \"cdata-section-elements\" : \"div\" , .. . } 
" - }, - "http://basex.org/modules/db#text#2": { - "name": "text", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#text#2", - "params": [ - "$db as xs:string", - "$strings as xs:string*" - ], - "type": "text()*", - "description": " Returns all text nodes of the database $db that have one of the specified $strings as values and that are stored in the text index." - }, - "http://basex.org/modules/db#text-range#3": { - "name": "text-range", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#text-range#3", - "params": [ - "$db as xs:string", - "$min as xs:string", - "$max as xs:string" - ], - "type": "text()*", - "description": " Returns all text nodes of the database $db whose values are between $min and $max and that are stored in the text index." - }, - "http://basex.org/modules/db#attribute#2": { - "name": "attribute", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#attribute#2", - "params": [ - "$db as xs:string", - "$strings as xs:string*" - ], - "type": "attribute()*", - "description": " Returns all attribute nodes of the database $db that have one of the specified $strings as values and that are stored in the attribute index.
If $name is specified, the resulting attribute nodes are filtered by their attribute name." - }, - "http://basex.org/modules/db#attribute#3": { - "name": "attribute", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#attribute#3", - "params": [ - "$db as xs:string", - "$strings as xs:string*", - "$name as xs:string" - ], - "type": "attribute()*", - "description": " Returns all attribute nodes of the database $db that have one of the specified $strings as values and that are stored in the attribute index.
If $name is specified, the resulting attribute nodes are filtered by their attribute name." - }, - "http://basex.org/modules/db#attribute-range#3": { - "name": "attribute-range", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#attribute-range#3", - "params": [ - "$db as xs:string", - "$min as xs:string", - "$max as xs:string" - ], - "type": "attribute()*", - "description": " Returns all attributes of the database $db, the string values of which are larger than or equal to $min and smaller than or equal to $max and that are stored in the attribute index." - }, - "http://basex.org/modules/db#attribute-range#4": { - "name": "attribute-range", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#attribute-range#4", - "params": [ - "$db as xs:string", - "$min as xs:string", - "$max as xs:string", - "$name as xs:string" - ], - "type": "attribute()*", - "description": " Returns all attributes of the database $db, the string values of which are larger than or equal to $min and smaller than or equal to $max and that are stored in the attribute index." - }, - "http://basex.org/modules/db#token#2": { - "name": "token", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#token#2", - "params": [ - "$db as xs:string", - "$tokens as xs:string*" - ], - "type": "attribute()*", - "description": " Returns all attribute nodes of the database $db the values of which contain one of the specified $tokens.
If $name is specified, the resulting attribute nodes are filtered by their attribute name." - }, - "http://basex.org/modules/db#token#3": { - "name": "token", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#token#3", - "params": [ - "$db as xs:string", - "$tokens as xs:string*", - "$name as xs:string" - ], - "type": "attribute()*", - "description": " Returns all attribute nodes of the database $db the values of which contain one of the specified $tokens.
If $name is specified, the resulting attribute nodes are filtered by their attribute name." - }, - "http://basex.org/modules/db#create#1": { - "name": "create", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#create#1", - "params": [ - "$db as xs:string" - ], - "type": "empty-sequence()", - "description": " Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
" - }, - "http://basex.org/modules/db#create#2": { - "name": "create", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#create#2", - "params": [ - "$db as xs:string", - "$inputs as item()*" - ], - "type": "empty-sequence()", - "description": " Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
" - }, - "http://basex.org/modules/db#create#3": { - "name": "create", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#create#3", - "params": [ - "$db as xs:string", - "$inputs as item()*", - "$paths as xs:string*" - ], - "type": "empty-sequence()", - "description": " Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
" - }, - "http://basex.org/modules/db#create#4": { - "name": "create", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#create#4", - "params": [ - "$db as xs:string", - "$inputs as item()*", - "$paths as xs:string*", - "$options as map(*)?" - ], - "type": "empty-sequence()", - "description": " Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
" - }, - "http://basex.org/modules/db#add#2": { - "name": "add", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#add#2", - "params": [ - "$db as xs:string", - "$input as item()" - ], - "type": "empty-sequence()", - "description": " Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:put instead.
  • See db:create for more details on the input and path arguments.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
" - }, - "http://basex.org/modules/db#add#3": { - "name": "add", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#add#3", - "params": [ - "$db as xs:string", - "$input as item()", - "$path as xs:string?" - ], - "type": "empty-sequence()", - "description": " Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:put instead.
  • See db:create for more details on the input and path arguments.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
" - }, - "http://basex.org/modules/db#add#4": { - "name": "add", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#add#4", - "params": [ - "$db as xs:string", - "$input as item()", - "$path as xs:string?", - "$options as map(*)?" - ], - "type": "empty-sequence()", - "description": " Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:put instead.
  • See db:create for more details on the input and path arguments.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
" - }, - "http://basex.org/modules/db#put#3": { - "name": "put", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#put#3", - "params": [ - "$db as xs:string", - "$input as item()", - "$path as xs:string" - ], - "type": "empty-sequence()", - "description": " Replaces a resource, specified by $path, in the database $db with the contents of $input, or adds it as a new resource:
  • The parsing behavior can be controlled via $options:
    • Allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case.
    • Parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed.
  • See db:create for more details on the input argument.
" - }, - "http://basex.org/modules/db#put#4": { - "name": "put", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#put#4", - "params": [ - "$db as xs:string", - "$input as item()", - "$path as xs:string", - "$options as map(*)?" - ], - "type": "empty-sequence()", - "description": " Replaces a resource, specified by $path, in the database $db with the contents of $input, or adds it as a new resource:
  • The parsing behavior can be controlled via $options:
    • Allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case.
    • Parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed.
  • See db:create for more details on the input argument.
" - }, - "http://basex.org/modules/db#put-binary#3": { - "name": "put-binary", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#put-binary#3", - "params": [ - "$db as xs:string", - "$input as item()", - "$path as xs:string" - ], - "type": "empty-sequence()", - "description": " Stores a binary resource specified by $input in the database $db at the specified $path. Existing resources are overwritten." - }, - "http://basex.org/modules/db#put-value#3": { - "name": "put-value", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#put-value#3", - "params": [ - "$db as xs:string", - "$input as item()*", - "$path as xs:string" - ], - "type": "empty-sequence()", - "description": " Stores a value specified by $input in the database $db at the specified $path. Existing resources are overwritten. The value can be an arbitrary sequence of atomic items, nodes, maps, and arrays." - }, - "http://basex.org/modules/db#delete#2": { - "name": "delete", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#delete#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "empty-sequence()", - "description": " Deletes resource(s), specified by $path, from the database $db." - }, - "http://basex.org/modules/db#copy#2": { - "name": "copy", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#copy#2", - "params": [ - "$db as xs:string", - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Creates a copy of the database $db, which will be called $name." - }, - "http://basex.org/modules/db#alter#2": { - "name": "alter", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#alter#2", - "params": [ - "$db as xs:string", - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Renames the database $db to $name." - }, - "http://basex.org/modules/db#optimize#1": { - "name": "optimize", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#optimize#1", - "params": [ - "$db as xs:string" - ], - "type": "empty-sequence()", - "description": " Optimizes the metadata and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true." - }, - "http://basex.org/modules/db#optimize#2": { - "name": "optimize", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#optimize#2", - "params": [ - "$db as xs:string", - "$all as xs:boolean" - ], - "type": "empty-sequence()", - "description": " Optimizes the metadata and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true." - }, - "http://basex.org/modules/db#optimize#3": { - "name": "optimize", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#optimize#3", - "params": [ - "$db as xs:string", - "$all as xs:boolean", - "$options as map(*)?" - ], - "type": "empty-sequence()", - "description": " Optimizes the metadata and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true." - }, - "http://basex.org/modules/db#rename#3": { - "name": "rename", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#rename#3", - "params": [ - "$db as xs:string", - "$source as xs:string", - "$target as xs:string" - ], - "type": "empty-sequence()", - "description": " Moves all resources(s) of database $db, which are found in the supplied $source path, to the supplied $target path. The paths may point to single resources or directories. No updates will take place if a non-existing source path is supplied." - }, - "http://basex.org/modules/db#flush#1": { - "name": "flush", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#flush#1", - "params": [ - "$db as xs:string" - ], - "type": "empty-sequence()", - "description": " Explicitly flushes the buffers of the database $db. This command is only useful if AUTOFLUSH has been set to false." - }, - "http://basex.org/modules/db#drop#1": { - "name": "drop", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#drop#1", - "params": [ - "$db as xs:string" - ], - "type": "empty-sequence()", - "description": " Drops the database $db and all connected resources." - }, - "http://basex.org/modules/db#create-backup#1": { - "name": "create-backup", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#create-backup#1", - "params": [ - "$db as xs:string" - ], - "type": "empty-sequence()", - "description": " Creates a backup of the database $db. If no name is supplied, general data will be backed up. The following $options are available:
  • With comment, a comment string can be attached to the backup.
  • By setting compress to false, the backup will be created faster, but it will take more space on disk.
" - }, - "http://basex.org/modules/db#create-backup#2": { - "name": "create-backup", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#create-backup#2", - "params": [ - "$db as xs:string", - "$options as map(*)" - ], - "type": "empty-sequence()", - "description": " Creates a backup of the database $db. If no name is supplied, general data will be backed up. The following $options are available:
  • With comment, a comment string can be attached to the backup.
  • By setting compress to false, the backup will be created faster, but it will take more space on disk.
" - }, - "http://basex.org/modules/db#drop-backup#1": { - "name": "drop-backup", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#drop-backup#1", - "params": [ - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Drops all backups of the database with the specified $name. If the name ends with a timestamp, only the specified backup file will be deleted. If no name is supplied, backups with general data are addressed." - }, - "http://basex.org/modules/db#alter-backup#2": { - "name": "alter-backup", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#alter-backup#2", - "params": [ - "$name as xs:string", - "$new-name as xs:string" - ], - "type": "empty-sequence()", - "description": " Renames all backups of the database with the specified $name to $new-name. If the name ends with a date, only the specified backup file will be renamed." - }, - "http://basex.org/modules/db#restore#1": { - "name": "restore", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#restore#1", - "params": [ - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Restores the database with the specified $name. The $name may include the timestamp of the backup file. If no name is supplied, general data will be restored. If general data is restored, it will only be available after BaseX has been restarted." - }, - "http://basex.org/modules/db#backups#0": { - "name": "backups", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#backups#0", - "params": [], - "type": "element(backup)*", - "description": " Returns an element sequence containing all available database backups with timestamp, file size and comment.
If a database $db is specified, the sequence will be restricted to the backups matching this database." - }, - "http://basex.org/modules/db#backups#1": { - "name": "backups", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#backups#1", - "params": [ - "$db as xs:string" - ], - "type": "element(backup)*", - "description": " Returns an element sequence containing all available database backups with timestamp, file size and comment.
If a database $db is specified, the sequence will be restricted to the backups matching this database." - }, - "http://basex.org/modules/db#name#1": { - "name": "name", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#name#1", - "params": [ - "$node as node()" - ], - "type": "xs:string", - "description": " Returns the name of the database in which the specified database node $node is stored." - }, - "http://basex.org/modules/db#path#1": { - "name": "path", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#path#1", - "params": [ - "$node as node()" - ], - "type": "xs:string", - "description": " Returns the path of the database document in which the specified database node $node is stored." - }, - "http://basex.org/modules/db#exists#1": { - "name": "exists", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#exists#1", - "params": [ - "$db as xs:string" - ], - "type": "xs:boolean", - "description": " Checks if the database $db or the resource specified by $path exists. false is returned if a database directory has been addressed." - }, - "http://basex.org/modules/db#exists#2": { - "name": "exists", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#exists#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "xs:boolean", - "description": " Checks if the database $db or the resource specified by $path exists. false is returned if a database directory has been addressed." - }, - "http://basex.org/modules/db#type#2": { - "name": "type", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#type#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "xs:boolean", - "description": " Returns the type of a resource – xml, binary, or value – in the database $db at the specified $path." - }, - "http://basex.org/modules/db#content-type#2": { - "name": "content-type", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#content-type#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "xs:string", - "description": " Retrieves the content type of a resource in the database $db and the path $path.
The file extension is used to recognize the content-type of a resource stored in the database. Content-type application/xml will be returned for any XML document stored in the database, regardless of its file name extension." - } - }, - "description": " This XQuery Module contains functions for processing databases from within XQuery. Existing databases can be opened and listed, its contents can be directly accessed, documents can be added to and removed, etc.", - "type": "module", - "override": true - }, - "http://basex.org/modules/fetch": { - "ns": "http://basex.org/modules/fetch", - "prefixes": [ - "fetch" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/fetch#binary#1": { - "name": "binary", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#binary#1", - "params": [ - "$uri as xs:string" - ], - "type": "xs:base64Binary", - "description": " Fetches the resource referred to by the given URI and returns it as lazy xs:base64Binary item." - }, - "http://basex.org/modules/fetch#text#1": { - "name": "text", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#text#1", - "params": [ - "$uri as xs:string" - ], - "type": "xs:string", - "description": " Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://basex.org/modules/fetch#text#2": { - "name": "text", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#text#2", - "params": [ - "$uri as xs:string", - "$encoding as xs:string" - ], - "type": "xs:string", - "description": " Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://basex.org/modules/fetch#text#3": { - "name": "text", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#text#3", - "params": [ - "$uri as xs:string", - "$encoding as xs:string", - "$fallback as xs:boolean" - ], - "type": "xs:string", - "description": " Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://basex.org/modules/fetch#doc#1": { - "name": "doc", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#doc#1", - "params": [ - "$uri as xs:string" - ], - "type": "document-node()", - "description": " Fetches the resource referred to by the given $uri and returns it as a document node.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case.
The function differs from fn:doc in various aspects:
  • It is non-deterministic, i.e., a new document node will be created by each call of this function.
  • A document created by this function will be garbage-collected as soon as it is not referenced anymore.
  • URIs will not be resolved against existing databases. As a result, it will not trigger any locks (see limitations of database locking for more details).
" - }, - "http://basex.org/modules/fetch#doc#2": { - "name": "doc", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#doc#2", - "params": [ - "$uri as xs:string", - "$options as map(*)?" - ], - "type": "document-node()", - "description": " Fetches the resource referred to by the given $uri and returns it as a document node.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case.
The function differs from fn:doc in various aspects:
  • It is non-deterministic, i.e., a new document node will be created by each call of this function.
  • A document created by this function will be garbage-collected as soon as it is not referenced anymore.
  • URIs will not be resolved against existing databases. As a result, it will not trigger any locks (see limitations of database locking for more details).
" - }, - "http://basex.org/modules/fetch#binary-doc#1": { - "name": "binary-doc", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#binary-doc#1", - "params": [ - "$input as xs:anyAtomicType" - ], - "type": "document-node()", - "description": " Converts the specified $input (xs:base64Binary, xs:hexBinary) to XML and returns it as a document node.
In contrast to fn:parse-xml, which expects a string, the input can be arbitrarily encoded. The encoding will be derived from the XML declaration or (in case of UTF-16 or UTF-32) from the first bytes of the input.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case." - }, - "http://basex.org/modules/fetch#binary-doc#2": { - "name": "binary-doc", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#binary-doc#2", - "params": [ - "$data as xs:anyAtomicType", - "$options as map(*)?" - ], - "type": "document-node()", - "description": " Converts the specified $input (xs:base64Binary, xs:hexBinary) to XML and returns it as a document node.
In contrast to fn:parse-xml, which expects a string, the input can be arbitrarily encoded. The encoding will be derived from the XML declaration or (in case of UTF-16 or UTF-32) from the first bytes of the input.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case." - }, - "http://basex.org/modules/fetch#content-type#1": { - "name": "content-type", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#content-type#1", - "params": [ - "$uri as xs:string" - ], - "type": "xs:string", - "description": " Returns the content-type (also called mime-type) of the resource specified by $uri:
  • If a remote resource is addressed, the request header will be evaluated.
  • If the addressed resource is locally stored, the content-type will be guessed based on the file extension.
" - } - }, - "description": " This XQuery Module provides simple functions to fetch the content of resources identified by URIs. Resources can be stored locally or remotely and e.g. use the file:// or http:// scheme. If more control over HTTP requests is required, the HTTP Client Module can be used. With the HTML Module, retrieved HTML documents can be converted to XML.", - "type": "module", - "override": true - }, - "http://expath.org/ns/file": { - "ns": "http://expath.org/ns/file", - "prefixes": [ - "file" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://expath.org/ns/file#list#1": { - "name": "list", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#list#1", - "params": [ - "$dir as xs:string" - ], - "type": "xs:string*", - "description": " Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether subdirectories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
" - }, - "http://expath.org/ns/file#list#2": { - "name": "list", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#list#2", - "params": [ - "$dir as xs:string", - "$recursive as xs:boolean" - ], - "type": "xs:string*", - "description": " Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether subdirectories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
" - }, - "http://expath.org/ns/file#list#3": { - "name": "list", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#list#3", - "params": [ - "$dir as xs:string", - "$recursive as xs:boolean", - "$pattern as xs:string" - ], - "type": "xs:string*", - "description": " Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether subdirectories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
" - }, - "http://expath.org/ns/file#children#1": { - "name": "children", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#children#1", - "params": [ - "$dir as xs:string" - ], - "type": "xs:string*", - "description": " Returns the full paths to all files and directories found in the specified $dir.
The inverse function is file:parent . The returned paths start with the specified directory. The related function file:list returns relative file paths." - }, - "http://expath.org/ns/file#descendants#1": { - "name": "descendants", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#descendants#1", - "params": [ - "$dir as xs:string" - ], - "type": "xs:string*", - "description": " Returns the full paths to all files and directories found in the specified $dir and its subdirectories.
. The returned paths start with the specified directory. The related function file:list creates relative file paths." - }, - "http://expath.org/ns/file#read-binary#1": { - "name": "read-binary", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-binary#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:base64Binary", - "description": " Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file." - }, - "http://expath.org/ns/file#read-binary#2": { - "name": "read-binary", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-binary#2", - "params": [ - "$path as xs:string", - "$offset as xs:integer" - ], - "type": "xs:base64Binary", - "description": " Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file." - }, - "http://expath.org/ns/file#read-binary#3": { - "name": "read-binary", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-binary#3", - "params": [ - "$path as xs:string", - "$offset as xs:integer", - "$length as xs:integer" - ], - "type": "xs:base64Binary", - "description": " Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file." - }, - "http://expath.org/ns/file#read-text#1": { - "name": "read-text", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string", - "description": " Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://expath.org/ns/file#read-text#2": { - "name": "read-text", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text#2", - "params": [ - "$path as xs:string", - "$encoding as xs:string" - ], - "type": "xs:string", - "description": " Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://expath.org/ns/file#read-text#3": { - "name": "read-text", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text#3", - "params": [ - "$path as xs:string", - "$encoding as xs:string", - "$fallback as xs:boolean" - ], - "type": "xs:string", - "description": " Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://expath.org/ns/file#read-text-lines#1": { - "name": "read-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text-lines#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string*", - "description": " Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

" - }, - "http://expath.org/ns/file#read-text-lines#2": { - "name": "read-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text-lines#2", - "params": [ - "$path as xs:string", - "$encoding as xs:string" - ], - "type": "xs:string*", - "description": " Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

" - }, - "http://expath.org/ns/file#read-text-lines#3": { - "name": "read-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text-lines#3", - "params": [ - "$path as xs:string", - "$encoding as xs:string", - "$fallback as xs:boolean" - ], - "type": "xs:string*", - "description": " Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

" - }, - "http://expath.org/ns/file#read-text-lines#4": { - "name": "read-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text-lines#4", - "params": [ - "$path as xs:string", - "$encoding as xs:string", - "$fallback as xs:boolean", - "$offset as xs:integer" - ], - "type": "xs:string*", - "description": " Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

" - }, - "http://expath.org/ns/file#read-text-lines#5": { - "name": "read-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text-lines#5", - "params": [ - "$path as xs:string", - "$encoding as xs:string", - "$fallback as xs:boolean", - "$offset as xs:integer", - "$length as xs:integer" - ], - "type": "xs:string*", - "description": " Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

" - }, - "http://expath.org/ns/file#create-dir#1": { - "name": "create-dir", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#create-dir#1", - "params": [ - "$dir as xs:string" - ], - "type": "empty-sequence()", - "description": " Creates the directory specified by $dir if it does not already exist. Non-existing parent directories will be created as well.
" - }, - "http://expath.org/ns/file#create-temp-dir#2": { - "name": "create-temp-dir", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#create-temp-dir#2", - "params": [ - "$prefix as xs:string", - "$suffix as xs:string" - ], - "type": "xs:string", - "description": " Creates a new temporary directory that did not exist before this function was called, and returns its full file path. The directory name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the directory will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories." - }, - "http://expath.org/ns/file#create-temp-dir#3": { - "name": "create-temp-dir", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#create-temp-dir#3", - "params": [ - "$prefix as xs:string", - "$suffix as xs:string", - "$dir as xs:string" - ], - "type": "xs:string", - "description": " Creates a new temporary directory that did not exist before this function was called, and returns its full file path. The directory name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the directory will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories." - }, - "http://expath.org/ns/file#create-temp-file#2": { - "name": "create-temp-file", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#create-temp-file#2", - "params": [ - "$prefix as xs:string", - "$suffix as xs:string" - ], - "type": "xs:string", - "description": " Creates a new temporary file that did not exist before this function was called, and returns its full file path. The file name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the file will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories." - }, - "http://expath.org/ns/file#create-temp-file#3": { - "name": "create-temp-file", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#create-temp-file#3", - "params": [ - "$prefix as xs:string", - "$suffix as xs:string", - "$dir as xs:string" - ], - "type": "xs:string", - "description": " Creates a new temporary file that did not exist before this function was called, and returns its full file path. The file name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the file will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories." - }, - "http://expath.org/ns/file#delete#1": { - "name": "delete", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#delete#1", - "params": [ - "$path as xs:string" - ], - "type": "empty-sequence()", - "description": " Recursively deletes a file or directory specified by $path.
The optional parameter $recursive specifies whether subdirectories will be deleted, too.
" - }, - "http://expath.org/ns/file#delete#2": { - "name": "delete", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#delete#2", - "params": [ - "$path as xs:string", - "$recursive as xs:boolean" - ], - "type": "empty-sequence()", - "description": " Recursively deletes a file or directory specified by $path.
The optional parameter $recursive specifies whether subdirectories will be deleted, too.
" - }, - "http://expath.org/ns/file#write#2": { - "name": "write", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write#2", - "params": [ - "$path as xs:string", - "$items as item()*" - ], - "type": "empty-sequence()", - "description": " Writes a serialized sequence of items to the specified file. If the file already exists, it will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= \"div\" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { \"method\" : \"xml\" , \"cdata-section-elements\" : \"div\" , .. . } 
" - }, - "http://expath.org/ns/file#write#3": { - "name": "write", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write#3", - "params": [ - "$path as xs:string", - "$items as item()*", - "$params as item()" - ], - "type": "empty-sequence()", - "description": " Writes a serialized sequence of items to the specified file. If the file already exists, it will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= \"div\" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { \"method\" : \"xml\" , \"cdata-section-elements\" : \"div\" , .. . } 
" - }, - "http://expath.org/ns/file#write-binary#2": { - "name": "write-binary", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write-binary#2", - "params": [ - "$path as xs:string", - "$value as xs:anyAtomicType" - ], - "type": "empty-sequence()", - "description": " Writes a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file already exists, it will be overwritten.
If $offset is specified, data will be written at this file position. An existing file may be resized by that operation." - }, - "http://expath.org/ns/file#write-binary#3": { - "name": "write-binary", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write-binary#3", - "params": [ - "$path as xs:string", - "$value as xs:anyAtomicType", - "$offset as xs:integer" - ], - "type": "empty-sequence()", - "description": " Writes a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file already exists, it will be overwritten.
If $offset is specified, data will be written at this file position. An existing file may be resized by that operation." - }, - "http://expath.org/ns/file#write-text#2": { - "name": "write-text", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write-text#2", - "params": [ - "$path as xs:string", - "$value as xs:string" - ], - "type": "empty-sequence()", - "description": " Writes a string to the specified file. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#write-text#3": { - "name": "write-text", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write-text#3", - "params": [ - "$path as xs:string", - "$value as xs:string", - "$encoding as xs:string" - ], - "type": "empty-sequence()", - "description": " Writes a string to the specified file. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#write-text-lines#2": { - "name": "write-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write-text-lines#2", - "params": [ - "$path as xs:string", - "$values as xs:string*" - ], - "type": "empty-sequence()", - "description": " Writes a sequence of strings to the specified file, each followed by the system specific newline character. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#write-text-lines#3": { - "name": "write-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write-text-lines#3", - "params": [ - "$path as xs:string", - "$values as xs:string*", - "$encoding as xs:string" - ], - "type": "empty-sequence()", - "description": " Writes a sequence of strings to the specified file, each followed by the system specific newline character. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#append#2": { - "name": "append", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#append#2", - "params": [ - "$path as xs:string", - "$items as item()*" - ], - "type": "empty-sequence()", - "description": " Appends a serialized sequence of items to the specified file. If the file does not exists, a new file is created.
" - }, - "http://expath.org/ns/file#append#3": { - "name": "append", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#append#3", - "params": [ - "$path as xs:string", - "$items as item()*", - "$params as item()" - ], - "type": "empty-sequence()", - "description": " Appends a serialized sequence of items to the specified file. If the file does not exists, a new file is created.
" - }, - "http://expath.org/ns/file#append-binary#2": { - "name": "append-binary", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#append-binary#2", - "params": [ - "$path as xs:string", - "$value as xs:anyAtomicType" - ], - "type": "empty-sequence()", - "description": " Appends a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file does not exists, a new one is created.
" - }, - "http://expath.org/ns/file#append-text#2": { - "name": "append-text", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#append-text#2", - "params": [ - "$path as xs:string", - "$value as xs:string" - ], - "type": "empty-sequence()", - "description": " Appends a string to a file specified by $path. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#append-text#3": { - "name": "append-text", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#append-text#3", - "params": [ - "$path as xs:string", - "$value as xs:string", - "$encoding as xs:string" - ], - "type": "empty-sequence()", - "description": " Appends a string to a file specified by $path. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#append-text-lines#2": { - "name": "append-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#append-text-lines#2", - "params": [ - "$path as xs:string", - "$values as xs:string*" - ], - "type": "empty-sequence()", - "description": " Appends a sequence of strings to the specified file, each followed by the system specific newline character. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#append-text-lines#3": { - "name": "append-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#append-text-lines#3", - "params": [ - "$path as xs:string", - "$values as xs:string*", - "$encoding as xs:string" - ], - "type": "empty-sequence()", - "description": " Appends a sequence of strings to the specified file, each followed by the system specific newline character. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#copy#2": { - "name": "copy", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#copy#2", - "params": [ - "$source as xs:string", - "$target as xs:string" - ], - "type": "empty-sequence()", - "description": " Copies a file or directory specified by $source to the file or directory specified by $target. If the target file already exists, it will be overwritten. No operation will be performed if the source and target path are equal.
" - }, - "http://expath.org/ns/file#move#2": { - "name": "move", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#move#2", - "params": [ - "$source as xs:string", - "$target as xs:string" - ], - "type": "empty-sequence()", - "description": " Moves or renames the file or directory specified by $source to the path specified by $target. If the target file already exists, it will be overwritten. No operation will be performed if the source and target path are equal.
" - }, - "http://expath.org/ns/file#exists#1": { - "name": "exists", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#exists#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:boolean", - "description": " Returns an xs:boolean indicating whether a file or directory specified by $path exists in the file system.
" - }, - "http://expath.org/ns/file#is-dir#1": { - "name": "is-dir", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#is-dir#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:boolean", - "description": " Returns an xs:boolean indicating whether the argument $path points to an existing directory.
" - }, - "http://expath.org/ns/file#is-absolute#1": { - "name": "is-absolute", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#is-absolute#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:boolean", - "description": " Returns an xs:boolean indicating whether the argument $path is absolute.
The behavior of this function depends on the operating system: On Windows, an absolute path starts with the drive letter and a colon, whereas on Linux it starts with a slash." - }, - "http://expath.org/ns/file#is-file#1": { - "name": "is-file", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#is-file#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:boolean", - "description": " Returns an xs:boolean indicating whether the argument $path points to an existing file.
" - }, - "http://expath.org/ns/file#last-modified#1": { - "name": "last-modified", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#last-modified#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:dateTime", - "description": " Retrieves the timestamp of the last modification of the file or directory specified by $path.
" - }, - "http://expath.org/ns/file#size#1": { - "name": "size", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#size#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:integer", - "description": " Returns the size, in bytes, of the file specified by $path, or 0 for directories.
" - }, - "http://expath.org/ns/file#name#1": { - "name": "name", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#name#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string", - "description": " Returns the name of a file or directory specified by $path. An empty string is returned if the path points to the root directory." - }, - "http://expath.org/ns/file#parent#1": { - "name": "parent", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#parent#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string?", - "description": " Returns the absolute path to the parent directory of a file or directory specified by $path. An empty sequence is returned if the path points to a root directory.
The inverse function is file:children .
" - }, - "http://expath.org/ns/file#path-to-native#1": { - "name": "path-to-native", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#path-to-native#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string", - "description": " Transforms the $path argument to its native representation on the operating system.
" - }, - "http://expath.org/ns/file#resolve-path#1": { - "name": "resolve-path", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#resolve-path#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string", - "description": " Transforms the $path argument to an absolute operating system path.
If the path is relative, and if an absolute $base path is specified, it will be resolved against this path." - }, - "http://expath.org/ns/file#resolve-path#2": { - "name": "resolve-path", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#resolve-path#2", - "params": [ - "$path as xs:string", - "$base as xs:string" - ], - "type": "xs:string", - "description": " Transforms the $path argument to an absolute operating system path.
If the path is relative, and if an absolute $base path is specified, it will be resolved against this path." - }, - "http://expath.org/ns/file#path-to-uri#1": { - "name": "path-to-uri", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#path-to-uri#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string", - "description": " Transforms the path specified by $path into a URI with the file:// scheme.
" - }, - "http://expath.org/ns/file#dir-separator#0": { - "name": "dir-separator", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#dir-separator#0", - "params": [], - "type": "xs:string", - "description": " Returns the directory separator used by the operating system, such as / or \\.
" - }, - "http://expath.org/ns/file#path-separator#0": { - "name": "path-separator", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#path-separator#0", - "params": [], - "type": "xs:string", - "description": " Returns the path separator used by the operating system, such as ; or :.
" - }, - "http://expath.org/ns/file#line-separator#0": { - "name": "line-separator", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#line-separator#0", - "params": [], - "type": "xs:string", - "description": " Returns the line separator used by the operating system, such as &#10;, &#13;&#10; or &#13;.
" - }, - "http://expath.org/ns/file#temp-dir#0": { - "name": "temp-dir", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#temp-dir#0", - "params": [], - "type": "xs:string", - "description": " Returns the system’s default temporary-file directory.
" - }, - "http://expath.org/ns/file#current-dir#0": { - "name": "current-dir", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#current-dir#0", - "params": [], - "type": "xs:string", - "description": " Returns the current working directory, i.e., the directory from which the query processor was started. This function returns the same result as the function call file:resolve-path(\"\")." - }, - "http://expath.org/ns/file#base-dir#0": { - "name": "base-dir", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#base-dir#0", - "params": [], - "type": "xs:string?", - "description": " Returns the parent directory of the static base URI.
If the static base URI is undefined or does not point to a local resource, it returns the empty sequence. Otherwise, it returns the same result as file:parent(static-base-uri())." - } - }, - "description": " This XQuery Module contains functions related to file system operations, such as listing, reading, or writing files.", - "type": "module", - "override": true - }, - "http://basex.org/modules/ft": { - "ns": "http://basex.org/modules/ft", - "prefixes": [ - "ft" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/ft#search#2": { - "name": "search", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#search#2", - "params": [ - "$db as xs:string", - "$terms as item()*" - ], - "type": "text()*", - "description": " Returns all text nodes from the full-text index of the database $db that contain the specified $terms.
The options used for tokenizing the input and building the full-text will also be applied to the search terms. As an example, if the index terms have been stemmed, the search string will be stemmed as well.

The $options argument can be used to control full-text processing. The following options are supported (the introduction on Full-Text processing gives you equivalent expressions in the XQuery Full-Text notation):

  • mode: determine the mode how tokens are searched. Allowed values are any, any word, all, all words, and phrase. any is the default search mode.
  • wildcards: turn wildcard querying on or off. Allowed values are true and false. By default, wildcard querying is turned off.
  • fuzzy: turn fuzzy querying on or off. Allowed values are true and false. By default, fuzzy querying is turned off.
  • errors: control the maximum number of tolerated errors for fuzzy querying. By default, 0 is assigned (see Fuzzy Querying for more details).
  • ordered: indicate if all tokens must occur in the order in which they are specified. Allowed values are true and false. The default is false.
  • content: specify that the matched tokens need to occur at the beginning or end of a searched string, or need to cover the entire string. Allowed values are start, end, and entire. By default, the option is turned off.
  • scope: define the scope in which tokens must be located. The option has following sub options:
    • same: can be set to true or false. It specifies if tokens need to occur in the same or different units.
    • unit: can be sentence or paragraph. It specifies the unit for finding tokens.
  • window: set up a window in which all tokens must be located. By default, the option is turned off. It has following sub options:
    • size: specify the size of the window in terms of units.
    • unit: can be sentences, sentences or paragraphs. The default is words.
  • distance: specify the distance in which tokens must occur. By default, the option is turned off. It has following sub options:
    • min: specify the minimum distance in terms of units. The default is 0.
    • max: specify the maximum distance in terms of units. The default is ∞.
    • unit: can be words, sentences or paragraphs. The default is words.
" - }, - "http://basex.org/modules/ft#search#3": { - "name": "search", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#search#3", - "params": [ - "$db as xs:string", - "$terms as item()*", - "$options as map(*)?" - ], - "type": "text()*", - "description": " Returns all text nodes from the full-text index of the database $db that contain the specified $terms.
The options used for tokenizing the input and building the full-text will also be applied to the search terms. As an example, if the index terms have been stemmed, the search string will be stemmed as well.

The $options argument can be used to control full-text processing. The following options are supported (the introduction on Full-Text processing gives you equivalent expressions in the XQuery Full-Text notation):

  • mode: determine the mode how tokens are searched. Allowed values are any, any word, all, all words, and phrase. any is the default search mode.
  • wildcards: turn wildcard querying on or off. Allowed values are true and false. By default, wildcard querying is turned off.
  • fuzzy: turn fuzzy querying on or off. Allowed values are true and false. By default, fuzzy querying is turned off.
  • errors: control the maximum number of tolerated errors for fuzzy querying. By default, 0 is assigned (see Fuzzy Querying for more details).
  • ordered: indicate if all tokens must occur in the order in which they are specified. Allowed values are true and false. The default is false.
  • content: specify that the matched tokens need to occur at the beginning or end of a searched string, or need to cover the entire string. Allowed values are start, end, and entire. By default, the option is turned off.
  • scope: define the scope in which tokens must be located. The option has following sub options:
    • same: can be set to true or false. It specifies if tokens need to occur in the same or different units.
    • unit: can be sentence or paragraph. It specifies the unit for finding tokens.
  • window: set up a window in which all tokens must be located. By default, the option is turned off. It has following sub options:
    • size: specify the size of the window in terms of units.
    • unit: can be sentences, sentences or paragraphs. The default is words.
  • distance: specify the distance in which tokens must occur. By default, the option is turned off. It has following sub options:
    • min: specify the minimum distance in terms of units. The default is 0.
    • max: specify the maximum distance in terms of units. The default is ∞.
    • unit: can be words, sentences or paragraphs. The default is words.
" - }, - "http://basex.org/modules/ft#tokens#1": { - "name": "tokens", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#tokens#1", - "params": [ - "$db as xs:string" - ], - "type": "element(value)*", - "description": " Returns all full-text tokens stored in the index of the database $db, along with their numbers of occurrences.
If $prefix is specified, the returned nodes will be refined to the strings starting with that prefix. The prefix will be tokenized according to the full-text used for creating the index." - }, - "http://basex.org/modules/ft#tokens#2": { - "name": "tokens", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#tokens#2", - "params": [ - "$db as xs:string", - "$prefix as xs:string" - ], - "type": "element(value)*", - "description": " Returns all full-text tokens stored in the index of the database $db, along with their numbers of occurrences.
If $prefix is specified, the returned nodes will be refined to the strings starting with that prefix. The prefix will be tokenized according to the full-text used for creating the index." - }, - "http://basex.org/modules/ft#contains#2": { - "name": "contains", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#contains#2", - "params": [ - "$input as item()*", - "$terms as item()*" - ], - "type": "xs:boolean", - "description": " Checks if the specified $input items contain the specified $terms.
The function does the same as the Full-Text expression contains text, but options can be specified more dynamically. The $options are the same as for ft:search , and the following ones exist:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case-insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.
" - }, - "http://basex.org/modules/ft#contains#3": { - "name": "contains", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#contains#3", - "params": [ - "$input as item()*", - "$terms as item()*", - "$options as map(*)?" - ], - "type": "xs:boolean", - "description": " Checks if the specified $input items contain the specified $terms.
The function does the same as the Full-Text expression contains text, but options can be specified more dynamically. The $options are the same as for ft:search , and the following ones exist:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case-insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.
" - }, - "http://basex.org/modules/ft#count#1": { - "name": "count", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#count#1", - "params": [ - "$nodes as node()*" - ], - "type": "xs:integer", - "description": " Returns the number of occurrences of the search terms specified in a full-text expression." - }, - "http://basex.org/modules/ft#score#1": { - "name": "score", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#score#1", - "params": [ - "$item as item()*" - ], - "type": "xs:double*", - "description": " Returns the score values (0.0 - 1.0) that have been attached to the specified items. 0 is returned a value if no score was attached." - }, - "http://basex.org/modules/ft#tokenize#1": { - "name": "tokenize", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#tokenize#1", - "params": [ - "$string as xs:string?" - ], - "type": "xs:string*", - "description": " Tokenizes the given $string, using the current default full-text options or the $options specified as second argument, and returns a sequence with the tokenized string. The following options are available:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.

The $options argument can be used to control full-text processing.

" - }, - "http://basex.org/modules/ft#tokenize#2": { - "name": "tokenize", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#tokenize#2", - "params": [ - "$string as xs:string?", - "$options as map(*)?" - ], - "type": "xs:string*", - "description": " Tokenizes the given $string, using the current default full-text options or the $options specified as second argument, and returns a sequence with the tokenized string. The following options are available:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.

The $options argument can be used to control full-text processing.

" - }, - "http://basex.org/modules/ft#normalize#1": { - "name": "normalize", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#normalize#1", - "params": [ - "$string as xs:string?" - ], - "type": "xs:string", - "description": " Normalizes the given $string, using the current default full-text options or the $options specified as second argument. The function accepts the same arguments as ft:tokenize ; special characters and separators will be preserved." - }, - "http://basex.org/modules/ft#normalize#2": { - "name": "normalize", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#normalize#2", - "params": [ - "$string as xs:string?", - "$options as map(*)?" - ], - "type": "xs:string", - "description": " Normalizes the given $string, using the current default full-text options or the $options specified as second argument. The function accepts the same arguments as ft:tokenize ; special characters and separators will be preserved." - }, - "http://basex.org/modules/ft#thesaurus#2": { - "name": "thesaurus", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#thesaurus#2", - "params": [ - "$node as node()", - "$term as xs:string" - ], - "type": "xs:string*", - "description": " Looks up a $term in a Thesaurus Structure supplied by $node. The following $options exist:
  • relationship: determines the relationship between terms
  • levels: determines the maximum number of levels to traverse
" - }, - "http://basex.org/modules/ft#thesaurus#3": { - "name": "thesaurus", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#thesaurus#3", - "params": [ - "$node as node()", - "$term as xs:string", - "$options as map(*)?" - ], - "type": "xs:string*", - "description": " Looks up a $term in a Thesaurus Structure supplied by $node. The following $options exist:
  • relationship: determines the relationship between terms
  • levels: determines the maximum number of levels to traverse
" - }, - "http://basex.org/modules/ft#mark#1": { - "name": "mark", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#mark#1", - "params": [ - "$nodes as node()*" - ], - "type": "node()*", - "description": " Puts a marker element around the resulting $nodes of a full-text request.
The default name of the marker element is mark. An alternative name can be chosen via the optional $name argument.
Please note that:
  • The full-text expression that computes the token positions must be specified as argument of the ft:mark() function, as all position information is lost in subsequent processing steps. You may need to specify more than one full-text expression if you want to use the function in a FLWOR expression, as shown in Example 2.
  • The supplied node must be a Database Node. As shown in Example 3, update or transform can be utilized to convert a fragment to the required internal representation.
" - }, - "http://basex.org/modules/ft#mark#2": { - "name": "mark", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#mark#2", - "params": [ - "$nodes as node()*", - "$name as xs:string" - ], - "type": "node()*", - "description": " Puts a marker element around the resulting $nodes of a full-text request.
The default name of the marker element is mark. An alternative name can be chosen via the optional $name argument.
Please note that:
  • The full-text expression that computes the token positions must be specified as argument of the ft:mark() function, as all position information is lost in subsequent processing steps. You may need to specify more than one full-text expression if you want to use the function in a FLWOR expression, as shown in Example 2.
  • The supplied node must be a Database Node. As shown in Example 3, update or transform can be utilized to convert a fragment to the required internal representation.
" - }, - "http://basex.org/modules/ft#extract#1": { - "name": "extract", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#extract#1", - "params": [ - "$nodes as node()*" - ], - "type": "node()*", - "description": " Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark ." - }, - "http://basex.org/modules/ft#extract#2": { - "name": "extract", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#extract#2", - "params": [ - "$nodes as node()*", - "$name as xs:string" - ], - "type": "node()*", - "description": " Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark ." - }, - "http://basex.org/modules/ft#extract#3": { - "name": "extract", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#extract#3", - "params": [ - "$nodes as node()*", - "$name as xs:string", - "$length as xs:integer" - ], - "type": "node()*", - "description": " Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark ." - } - }, - "description": " This XQuery Module extends the Full-Text features of BaseX: The index can be directly accessed, full-text results can be marked with additional elements, or the relevant parts can be extracted. Moreover, the score value, which is generated by the contains text expression, can be explicitly requested from items.", - "type": "module", - "override": true - }, - "http://basex.org/modules/hash": { - "ns": "http://basex.org/modules/hash", - "prefixes": [ - "hash" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/hash#md5#1": { - "name": "md5", - "uri": "http://basex.org/modules/hash", - "key": "http://basex.org/modules/hash#md5#1", - "params": [ - "$value as xs:anyAtomicType" - ], - "type": "xs:base64Binary", - "description": " Computes the MD5 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary." - }, - "http://basex.org/modules/hash#sha1#1": { - "name": "sha1", - "uri": "http://basex.org/modules/hash", - "key": "http://basex.org/modules/hash#sha1#1", - "params": [ - "$value as xs:anyAtomicType" - ], - "type": "xs:base64Binary", - "description": " Computes the SHA-1 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary." - }, - "http://basex.org/modules/hash#sha256#1": { - "name": "sha256", - "uri": "http://basex.org/modules/hash", - "key": "http://basex.org/modules/hash#sha256#1", - "params": [ - "$value as xs:anyAtomicType" - ], - "type": "xs:base64Binary", - "description": " Computes the SHA-256 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary." - }, - "http://basex.org/modules/hash#hash#2": { - "name": "hash", - "uri": "http://basex.org/modules/hash", - "key": "http://basex.org/modules/hash#hash#2", - "params": [ - "$value as xs:anyAtomicType", - "$algorithm as xs:string" - ], - "type": "xs:base64Binary", - "description": " Computes the hash of the given $value, using the specified $algorithm. The specified values may be of type xs:string, xs:base64Binary, or xs:hexBinary.
The following three algorithms are supported: MD5, SHA-1, and SHA-256." - } - }, - "description": " This XQuery Module provides functions that perform different hash operations.", - "type": "module", - "override": true - }, - "http://basex.org/modules/hof": { - "ns": "http://basex.org/modules/hof", - "prefixes": [ - "hof" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/hof#fold-left1#2": { - "name": "fold-left1", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#fold-left1#2", - "params": [ - "$seq as item()+", - "$f as function(item()*, item()) as item()*" - ], - "type": "item()*", - "description": " Works the same as fn:fold-left, but does not need a seed, because the sequence must be non-empty." - }, - "http://basex.org/modules/hof#until#3": { - "name": "until", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#until#3", - "params": [ - "$pred as function(item()*) as xs:boolean", - "$f as function(item()*) as item()*", - "$start as item()*" - ], - "type": "item()*", - "description": " Applies the predicate function $pred to $start. If the result is false, $f is invoked with the start value – or, subsequently, with the result of this function – until the predicate function returns true()." - }, - "http://basex.org/modules/hof#scan-left#3": { - "name": "scan-left", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#scan-left#3", - "params": [ - "$seq as item()*", - "$start as item()*", - "$f as function(item()*, item()) as item()*" - ], - "type": "item()*", - "description": " This function is similar to fn:fold-left, but it returns a list of successive reduced values from the left. It is equivalent to:
  declare function hof:scan-left ( $ seq , $ acc , $ f ) { if ( empty ( $ seq )) then $ acc else ( $ acc , hof:scan-left ( tail ( $ seq ), $ f ( $ acc , head ( $ seq )), $ f ) ) }; 
" - }, - "http://basex.org/modules/hof#take-while#2": { - "name": "take-while", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#take-while#2", - "params": [ - "$seq as item()*", - "$pred as function(item()) as xs:boolean" - ], - "type": "item()*", - "description": " The function returns items of $seq as long as the predicate $pred is satisfied. It is equivalent to:
  declare function hof:take-while ( $ seq , $ pred ) { if ( empty ( $ seq ) or not ( $ pred ( head( $ seq )))) then () else ( head ( $ seq ), hof:take-while ( tail ( $ seq ), $ pred ) ) }; 
" - }, - "http://basex.org/modules/hof#drop-while#2": { - "name": "drop-while", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#drop-while#2", - "params": [ - "$seq as item()*", - "$pred as function(item()) as xs:boolean" - ], - "type": "item()*", - "description": " The function skips all items of $seq until the predicate $pred is not satisfied anymore. It is equivalent to:
  declare function hof:drop-while ( $ seq , $ pred ) { if ( $ pred ( head( $ seq ))) then ( hof:drop-while ( tail ( $ seq ), $ pred ) ) else ( $ seq ) }; 
" - }, - "http://basex.org/modules/hof#top-k-by#3": { - "name": "top-k-by", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#top-k-by#3", - "params": [ - "$seq as item()*", - "$sort-key as function(item()) as item()", - "$k as xs:integer" - ], - "type": "item()*", - "description": " Returns the $k items in $seq that are greatest when sorted by the result of $f applied to the item. The function is a much more efficient implementation of the following scheme:
  ( for $ x in $ seq order by $ sort-key ( $ x ) descending return $ x )[ position () <= $ k ] 
" - }, - "http://basex.org/modules/hof#top-k-with#3": { - "name": "top-k-with", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#top-k-with#3", - "params": [ - "$seq as item()*", - "$lt as function(item(), item()) as xs:boolean", - "$k as xs:integer" - ], - "type": "item()*", - "description": " Returns the $k items in $seq that are greatest when sorted in the order of the less-than predicate $lt. The function is a general version of hof:top-k-by($seq, $sort-key, $k)." - }, - "http://basex.org/modules/hof#id#1": { - "name": "id", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#id#1", - "params": [ - "$expr as item()*" - ], - "type": "item()*", - "description": " Returns its argument unchanged. This function isn’t useful on its own, but can be used as argument to other higher-order functions." - }, - "http://basex.org/modules/hof#const#2": { - "name": "const", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#const#2", - "params": [ - "$expr as item()*", - "$ignored as item()*" - ], - "type": "item()*", - "description": " Returns its first argument unchanged and ignores the second. This function isn’t useful on its own, but can be used as argument to other higher-order functions, e.g. when a function combining two values is expected and one only wants to retain the left one." - } - }, - "description": " This XQuery Module adds some useful higher-order functions, additional to the Higher-Order Functions provided by the official specification.", - "type": "module", - "override": true - }, - "http://basex.org/modules/html": { - "ns": "http://basex.org/modules/html", - "prefixes": [ - "html" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/html#doc#1": { - "name": "doc", - "uri": "http://basex.org/modules/html", - "key": "http://basex.org/modules/html#doc#1", - "params": [ - "$uri as xs:string?" - ], - "type": "document-node()?", - "description": " Fetches the HTML document referred to by the given $uri, converts it to XML and returns a document node. The $options argument can be used to set TagSoup Options." - }, - "http://basex.org/modules/html#doc#2": { - "name": "doc", - "uri": "http://basex.org/modules/html", - "key": "http://basex.org/modules/html#doc#2", - "params": [ - "$uri as xs:string?", - "$options as map(*)?" - ], - "type": "document-node()?", - "description": " Fetches the HTML document referred to by the given $uri, converts it to XML and returns a document node. The $options argument can be used to set TagSoup Options." - }, - "http://basex.org/modules/html#parse#1": { - "name": "parse", - "uri": "http://basex.org/modules/html", - "key": "http://basex.org/modules/html#parse#1", - "params": [ - "$input as xs:anyAtomicType" - ], - "type": "document-node()", - "description": " Converts the HTML document specified by $input to XML and returns a document node:
  • The input may be of type xs:string, xs:base64Binary, or xs:hexBinary.
  • If the input is passed on in its binary representation, the HTML parser will try to choose the correct encoding automatically.

The $options argument can be used to set TagSoup Options.

" - }, - "http://basex.org/modules/html#parse#2": { - "name": "parse", - "uri": "http://basex.org/modules/html", - "key": "http://basex.org/modules/html#parse#2", - "params": [ - "$input as xs:anyAtomicType", - "$options as map(*)?" - ], - "type": "document-node()", - "description": " Converts the HTML document specified by $input to XML and returns a document node:
  • The input may be of type xs:string, xs:base64Binary, or xs:hexBinary.
  • If the input is passed on in its binary representation, the HTML parser will try to choose the correct encoding automatically.

The $options argument can be used to set TagSoup Options.

" - }, - "http://basex.org/modules/html#parser#0": { - "name": "parser", - "uri": "http://basex.org/modules/html", - "key": "http://basex.org/modules/html#parser#0", - "params": [], - "type": "xs:string", - "description": " Returns the name of the applied HTML parser (currently: TagSoup). If an empty string is returned, TagSoup was not found in the classpath, and the input will be treated as well-formed XML.
" - } - }, - "description": " This XQuery Module provides functions for converting HTML to XML. Conversion will only take place if TagSoup is included in the classpath (see HTML Parsing for more details).", - "type": "module", - "override": true - }, - "http://expath.org/ns/http-client": { - "ns": "http://expath.org/ns/http-client", - "prefixes": [ - "http" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://expath.org/ns/http-client#send-request#1": { - "name": "send-request", - "uri": "http://expath.org/ns/http-client", - "key": "http://expath.org/ns/http-client#send-request#1", - "params": [ - "$request as element(http:request)" - ], - "type": "item()+", - "description": " Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.
  • Certificate verification can be globally disabled via the IGNORECERT option.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
" - }, - "http://expath.org/ns/http-client#send-request#2": { - "name": "send-request", - "uri": "http://expath.org/ns/http-client", - "key": "http://expath.org/ns/http-client#send-request#2", - "params": [ - "$request as element(http:request)?", - "$href as xs:string?" - ], - "type": "item()+", - "description": " Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.
  • Certificate verification can be globally disabled via the IGNORECERT option.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
" - }, - "http://expath.org/ns/http-client#send-request#3": { - "name": "send-request", - "uri": "http://expath.org/ns/http-client", - "key": "http://expath.org/ns/http-client#send-request#3", - "params": [ - "$request as element(http:request)?", - "$href as xs:string?", - "$bodies as item()*" - ], - "type": "item()+", - "description": " Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.
  • Certificate verification can be globally disabled via the IGNORECERT option.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
" - } - }, - "description": " This XQuery Module contains a single function to send HTTP requests and handle HTTP responses. The function send-request is based on the EXPath HTTP Client Module. It gives full control over the available request and response parameters. For simple GET requests, the Fetch Module may be sufficient.", - "type": "module", - "override": true - }, - "http://basex.org/modules/index": { - "ns": "http://basex.org/modules/index", - "prefixes": [ - "index" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/index#facets#1": { - "name": "facets", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#facets#1", - "params": [ - "$db as xs:string" - ], - "type": "xs:string", - "description": " Returns information about all facets and facet values of the database $db in document structure format.
If $type is specified as flat, the function returns this information in a flat summarized version. The returned data is derived from the Path Index." - }, - "http://basex.org/modules/index#facets#2": { - "name": "facets", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#facets#2", - "params": [ - "$db as xs:string", - "$type as xs:string" - ], - "type": "xs:string", - "description": " Returns information about all facets and facet values of the database $db in document structure format.
If $type is specified as flat, the function returns this information in a flat summarized version. The returned data is derived from the Path Index." - }, - "http://basex.org/modules/index#texts#1": { - "name": "texts", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#texts#1", - "params": [ - "$db as xs:string" - ], - "type": "element(value)*", - "description": " Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry." - }, - "http://basex.org/modules/index#texts#2": { - "name": "texts", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#texts#2", - "params": [ - "$db as xs:string", - "$prefix as xs:string" - ], - "type": "element(value)*", - "description": " Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry." - }, - "http://basex.org/modules/index#texts#3": { - "name": "texts", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#texts#3", - "params": [ - "$db as xs:string", - "$start as xs:string", - "$ascending as xs:boolean" - ], - "type": "element(value)*", - "description": " Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry." - }, - "http://basex.org/modules/index#attributes#1": { - "name": "attributes", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#attributes#1", - "params": [ - "$db as xs:string" - ], - "type": "element(value)*", - "description": " Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry." - }, - "http://basex.org/modules/index#attributes#2": { - "name": "attributes", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#attributes#2", - "params": [ - "$db as xs:string", - "$prefix as xs:string" - ], - "type": "element(value)*", - "description": " Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry." - }, - "http://basex.org/modules/index#attributes#3": { - "name": "attributes", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#attributes#3", - "params": [ - "$db as xs:string", - "$start as xs:string", - "$ascending as xs:boolean" - ], - "type": "element(value)*", - "description": " Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry." - }, - "http://basex.org/modules/index#tokens#1": { - "name": "tokens", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#tokens#1", - "params": [ - "$db as xs:string" - ], - "type": "element(value)*", - "description": " Returns all strings stored in the Token Index of the database $db, along with their number of occurrences." - }, - "http://basex.org/modules/index#element-names#1": { - "name": "element-names", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#element-names#1", - "params": [ - "$db as xs:string" - ], - "type": "element(value)*", - "description": " Returns all element names stored in the Name Index of the database $db, along with their number of occurrences." - }, - "http://basex.org/modules/index#attribute-names#1": { - "name": "attribute-names", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#attribute-names#1", - "params": [ - "$db as xs:string" - ], - "type": "element(value)*", - "description": " Returns all attribute names stored in the Name Index of the database $db, along with their number of occurrences." - } - }, - "description": " This XQuery Module provides functions for displaying information stored in the database index structures.", - "type": "module", - "override": true - }, - "http://basex.org/modules/inspect": { - "ns": "http://basex.org/modules/inspect", - "prefixes": [ - "inspect" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/inspect#functions#0": { - "name": "functions", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#functions#0", - "params": [], - "type": "function(*)*", - "description": " Returns function items for all user-defined functions (both public and private) that are known in the current query context. If a $uri is specified, the specified resource will be retrieved as string and compiled, and its functions will be added to the query context and returned to the user. A relative URI will be resolved against the static base URI of the query." - }, - "http://basex.org/modules/inspect#functions#1": { - "name": "functions", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#functions#1", - "params": [ - "$uri as xs:string" - ], - "type": "function(*)*", - "description": " Returns function items for all user-defined functions (both public and private) that are known in the current query context. If a $uri is specified, the specified resource will be retrieved as string and compiled, and its functions will be added to the query context and returned to the user. A relative URI will be resolved against the static base URI of the query." - }, - "http://basex.org/modules/inspect#function-annotations#1": { - "name": "function-annotations", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#function-annotations#1", - "params": [ - "$function as function(*)?" - ], - "type": "map(xs:QName, xs:anyAtomicType*)", - "description": " Returns the annotations of the specified $function in a map." - }, - "http://basex.org/modules/inspect#static-context#2": { - "name": "static-context", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#static-context#2", - "params": [ - "$function as function(*)?", - "$name as xs:string" - ], - "type": "item()*", - "description": " Returns a component of the static context of a $function with the specified $name. If no function is supplied, the current static context is considered.
The following components can be requested:
  • base-uri: Static base URI.
  • namespaces: Prefix/URI map with all statically known namespaces.
  • element-namespace: Default element/type namespace URI, or an empty sequence if it is absent.
  • function-namespace: Default function namespace URI, or an empty sequence if it is absent.
  • collation: URI of the default collation.
  • ordering: Ordering mode (ordered/unordered)
  • construction: Construction mode (preserve/strip)
  • default-order-empty: Default order for empty sequences (greatest/least)
  • boundary-space: Boundary-space policy (preserve/strip)
  • copy-namespaces: Copy-namespaces mode (inherit/no-inherit, preserve/no-preserve)
  • decimal-formats: Nested map with all statically known decimal formats
" - }, - "http://basex.org/modules/inspect#type#1": { - "name": "type", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#type#1", - "params": [ - "$value as item()*" - ], - "type": "xs:string", - "description": " Returns a string representation of the type of a $value:
  • The string includes the occurrence indicator.
  • The type of functions and nodes may be stricter than the returned type.
  • For type checking, the standard expressions typeswitch and instance of should be used instead.

The following $options are available:

  • item: If enabled, only the item type is returned and the occurrence indicator is omitted. The default is false().
  • mode: If value is specified, the assigned type of the result value is returned. With expression the type of the input expression is returned (please note that the original expression may already have been rewritten at compile-time). With computed, the exact value is computed at runtime, based on the expression and the result value. The default is computed.
" - }, - "http://basex.org/modules/inspect#type#2": { - "name": "type", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#type#2", - "params": [ - "$value as item()*", - "$options as map(*)" - ], - "type": "xs:string", - "description": " Returns a string representation of the type of a $value:
  • The string includes the occurrence indicator.
  • The type of functions and nodes may be stricter than the returned type.
  • For type checking, the standard expressions typeswitch and instance of should be used instead.

The following $options are available:

  • item: If enabled, only the item type is returned and the occurrence indicator is omitted. The default is false().
  • mode: If value is specified, the assigned type of the result value is returned. With expression the type of the input expression is returned (please note that the original expression may already have been rewritten at compile-time). With computed, the exact value is computed at runtime, based on the expression and the result value. The default is computed.
" - }, - "http://basex.org/modules/inspect#function#1": { - "name": "function", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#function#1", - "params": [ - "$function as function(*)" - ], - "type": "element(function)", - "description": " Inspects the specified $function and returns an element that describes its structure. The output of this function is similar to eXist-db’s inspect:inspect-function function." - }, - "http://basex.org/modules/inspect#context#0": { - "name": "context", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#context#0", - "params": [], - "type": "element(context)", - "description": " Generates an element that describes all variables and functions in the current query context." - }, - "http://basex.org/modules/inspect#module#1": { - "name": "module", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#module#1", - "params": [ - "$uri as xs:string" - ], - "type": "element(module)", - "description": " Retrieves the resource located at the specified $uri, parses it as XQuery module, and generates an element that describes the module's structure. A relative URI will be resolved against the static base URI of the query." - }, - "http://basex.org/modules/inspect#xqdoc#1": { - "name": "xqdoc", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#xqdoc#1", - "params": [ - "$uri as xs:string" - ], - "type": "element(xqdoc:xqdoc)", - "description": " Retrieves the resource located at the specified $uri, parses it as XQuery module, and generates an xqDoc element. A relative URI will be resolved against the static base URI of the query.
xqDoc provides a simple vendor-neutral solution for generating documentation from XQuery modules. The documentation conventions have been inspired by the JavaDoc standard. Documentation comments begin with (:~ and end with :), and tags start with @. xqDoc comments can be specified for main and library modules and variable and function declarations.

We have slightly extended the xqDoc conventions to do justice to more recent versions of XQuery (Schema: xqdoc-1.1.30052013.xsd):

  • an <xqdoc:annotations/> node is added to each variable or function that uses annotations. The xqdoc:annotation child nodes may have additional xqdoc:literal elements with type attributes (xs:string, xs:integer, xs:decimal, xs:double) and values.
  • a single <xqdoc:namespaces/> node is added to the root element, which summarizes all prefixes and namespace URIs used or declared in the module.
  • name and type elements are added to variables.
" - } - }, - "description": " This XQuery Module contains functions for extracting internal information about modules and functions and generating documentation.", - "type": "module", - "override": true - }, - "http://basex.org/modules/job": { - "ns": "http://basex.org/modules/job", - "prefixes": [ - "job" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/job#eval#1": { - "name": "eval", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#eval#1", - "params": [ - "$query as xs:anyAtomicType" - ], - "type": "xs:string", - "description": " Schedules the evaluation of the supplied $query (xs:string, or of type xs:anyURI, pointing to a resource), and returns a query ID. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and the context value can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via job:result , or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time, dateTime or integer can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples of valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
    • If a time is specified, the query will be executed at this time of the day. Examples of valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • An integer will be interpreted as minutes. If the specified number is greater than the elapsed minutes of the current hour, the query will be executed one hour later.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same ID is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job ID. The ID must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service. Registered services must have no variable bindings.
  • log: writes the specified string to the database logs. Two log entries are stored, one at the beginning and another one after the execution of the job.
" - }, - "http://basex.org/modules/job#eval#2": { - "name": "eval", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#eval#2", - "params": [ - "$query as xs:anyAtomicType", - "$bindings as map(*)?" - ], - "type": "xs:string", - "description": " Schedules the evaluation of the supplied $query (xs:string, or of type xs:anyURI, pointing to a resource), and returns a query ID. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and the context value can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via job:result , or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time, dateTime or integer can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples of valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
    • If a time is specified, the query will be executed at this time of the day. Examples of valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • An integer will be interpreted as minutes. If the specified number is greater than the elapsed minutes of the current hour, the query will be executed one hour later.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same ID is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job ID. The ID must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service. Registered services must have no variable bindings.
  • log: writes the specified string to the database logs. Two log entries are stored, one at the beginning and another one after the execution of the job.
" - }, - "http://basex.org/modules/job#eval#3": { - "name": "eval", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#eval#3", - "params": [ - "$query as xs:anyAtomicType", - "$bindings as map(*)?", - "$options as map(*)?" - ], - "type": "xs:string", - "description": " Schedules the evaluation of the supplied $query (xs:string, or of type xs:anyURI, pointing to a resource), and returns a query ID. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and the context value can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via job:result , or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time, dateTime or integer can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples of valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
    • If a time is specified, the query will be executed at this time of the day. Examples of valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • An integer will be interpreted as minutes. If the specified number is greater than the elapsed minutes of the current hour, the query will be executed one hour later.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same ID is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job ID. The ID must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service. Registered services must have no variable bindings.
  • log: writes the specified string to the database logs. Two log entries are stored, one at the beginning and another one after the execution of the job.
" - }, - "http://basex.org/modules/job#result#1": { - "name": "result", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#result#1", - "params": [ - "$id as xs:string" - ], - "type": "item()*", - "description": " Returns the cached result of a job with the specified job $id:
  • If the original job has raised an error, the cached error will be raised instead.
  • The cached result or error will be dropped after it has been retrieved.
  • If the result has not been cached or if it has been dropped, an empty sequence is returned.

The following $options can be supplied:

  • keep: Keep the cached result or error after retrieval.
" - }, - "http://basex.org/modules/job#result#2": { - "name": "result", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#result#2", - "params": [ - "$id as xs:string", - "$options as map(*)" - ], - "type": "item()*", - "description": " Returns the cached result of a job with the specified job $id:
  • If the original job has raised an error, the cached error will be raised instead.
  • The cached result or error will be dropped after it has been retrieved.
  • If the result has not been cached or if it has been dropped, an empty sequence is returned.

The following $options can be supplied:

  • keep: Keep the cached result or error after retrieval.
" - }, - "http://basex.org/modules/job#remove#1": { - "name": "remove", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#remove#1", - "params": [ - "$id as xs:string" - ], - "type": "empty-sequence()", - "description": " Triggers the cancelation of a job with the specified $id, cancels a scheduled job or removes a cached result. Unknown IDs are ignored. All jobs are gracefully stopped; it is up to the process to decide when it is safe to shut down. The following $options can be supplied:
  • service: additionally removes the job from the job services list.
" - }, - "http://basex.org/modules/job#remove#2": { - "name": "remove", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#remove#2", - "params": [ - "$id as xs:string", - "$options as map(*)?" - ], - "type": "empty-sequence()", - "description": " Triggers the cancelation of a job with the specified $id, cancels a scheduled job or removes a cached result. Unknown IDs are ignored. All jobs are gracefully stopped; it is up to the process to decide when it is safe to shut down. The following $options can be supplied:
  • service: additionally removes the job from the job services list.
" - }, - "http://basex.org/modules/job#wait#1": { - "name": "wait", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#wait#1", - "params": [ - "$id as xs:string" - ], - "type": "empty-sequence()", - "description": " Waits for the completion of a job with the specified $id:
  • The function will terminate immediately if the job ID is unknown. This is the case if a future job has not been queued yet, or if the ID has already been discarded after job evaluation.
  • If the function is called with the ID of a queued job, or repeatedly executed job, it may stall and never terminate.
" - }, - "http://basex.org/modules/job#current#0": { - "name": "current", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#current#0", - "params": [], - "type": "xs:string", - "description": " Returns the ID of the current job." - }, - "http://basex.org/modules/job#list#0": { - "name": "list", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#list#0", - "params": [], - "type": "xs:string*", - "description": " Returns the IDs of all jobs that are currently registered. The list includes scheduled, queued, running, stopped, and finished jobs with cached results." - }, - "http://basex.org/modules/job#list-details#0": { - "name": "list-details", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#list-details#0", - "params": [], - "type": "element(job)*", - "description": " Returns information on all jobs that are currently registered, or on a job with the specified $id (or an empty sequence if this job is not found). The list includes scheduled, queued, running jobs, and cached jobs. A string representation of the job, or its URI, will be returned as a value. The returned elements have additional attributes:
  • id: job ID
  • type: type of the job (command, query, REST, RESTXQ, etc.)
  • state: current state of the job: scheduled, queued, running, cached
  • user: user who started the job
  • duration: evaluation time (included if a job is running or if the result was cached)
  • start: next start of job (included if a job will be executed repeatedly)
  • time: time when job was registered
" - }, - "http://basex.org/modules/job#list-details#1": { - "name": "list-details", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#list-details#1", - "params": [ - "$id as xs:string" - ], - "type": "element(job)*", - "description": " Returns information on all jobs that are currently registered, or on a job with the specified $id (or an empty sequence if this job is not found). The list includes scheduled, queued, running jobs, and cached jobs. A string representation of the job, or its URI, will be returned as a value. The returned elements have additional attributes:
  • id: job ID
  • type: type of the job (command, query, REST, RESTXQ, etc.)
  • state: current state of the job: scheduled, queued, running, cached
  • user: user who started the job
  • duration: evaluation time (included if a job is running or if the result was cached)
  • start: next start of job (included if a job will be executed repeatedly)
  • time: time when job was registered
" - }, - "http://basex.org/modules/job#bindings#1": { - "name": "bindings", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#bindings#1", - "params": [ - "$id as xs:string" - ], - "type": "map(*)", - "description": " Returns the variable bindings of an existing job with the specified $id. If no variables have been bound to this job, an empty map is returned." - }, - "http://basex.org/modules/job#finished#1": { - "name": "finished", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#finished#1", - "params": [ - "$id as xs:string" - ], - "type": "xs:boolean", - "description": " Indicates if the evaluation of an already running job with the specified $id has finished. As the IDs of finished jobs will usually be discarded, unless caching is enabled, the function will also return true for unknown jobs.
  • false indicates that the job ID is scheduled, queued, or currently running.
  • true will be returned if the job has either finished, or if the ID is unknown (because the IDs of all finished jobs will not be cached).
" - }, - "http://basex.org/modules/job#services#0": { - "name": "services", - "uri": "http://basex.org/modules/job", - "key": "http://basex.org/modules/job#services#0", - "params": [], - "type": "element(job)*", - "description": " Returns a list of all jobs that have been persistently registered as Services." - } - }, - "description": " Updated with Version 10: Renamed from Jobs Module to Job Module. The namespace URI has been updated as well.", - "type": "module", - "override": true - }, - "http://basex.org/modules/json": { - "ns": "http://basex.org/modules/json", - "prefixes": [ - "json" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/json#doc#1": { - "name": "doc", - "uri": "http://basex.org/modules/json", - "key": "http://basex.org/modules/json#doc#1", - "params": [ - "$uri as xs:string" - ], - "type": "item()?", - "description": " Fetches the JSON document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/json#doc#2": { - "name": "doc", - "uri": "http://basex.org/modules/json", - "key": "http://basex.org/modules/json#doc#2", - "params": [ - "$uri as xs:string", - "$options as map(*)?" - ], - "type": "item()?", - "description": " Fetches the JSON document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/json#parse#1": { - "name": "parse", - "uri": "http://basex.org/modules/json", - "key": "http://basex.org/modules/json#parse#1", - "params": [ - "$string as xs:string?" - ], - "type": "item()?", - "description": " Converts the JSON $string to an XQuery value. If the input can be successfully parsed, it can be serialized back to the original JSON representation. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/json#parse#2": { - "name": "parse", - "uri": "http://basex.org/modules/json", - "key": "http://basex.org/modules/json#parse#2", - "params": [ - "$string as xs:string?", - "$options as map(*)?" - ], - "type": "item()?", - "description": " Converts the JSON $string to an XQuery value. If the input can be successfully parsed, it can be serialized back to the original JSON representation. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/json#serialize#1": { - "name": "serialize", - "uri": "http://basex.org/modules/json", - "key": "http://basex.org/modules/json#serialize#1", - "params": [ - "$input as item()?" - ], - "type": "xs:string", - "description": " Serializes the specified $input as JSON, using the specified $options, and returns the result as string:
  • The input is expected to conform to the results that are created by json:parse .
  • Non-conforming items will be serialized as specified in the json output method of the official recommendation.

Values can also be serialized as JSON with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to json, and
  • the options presented in this article need to be assigned to the json parameter.
" - }, - "http://basex.org/modules/json#serialize#2": { - "name": "serialize", - "uri": "http://basex.org/modules/json", - "key": "http://basex.org/modules/json#serialize#2", - "params": [ - "$input as item()?", - "$options as map(*)?" - ], - "type": "xs:string", - "description": " Serializes the specified $input as JSON, using the specified $options, and returns the result as string:
  • The input is expected to conform to the results that are created by json:parse .
  • Non-conforming items will be serialized as specified in the json output method of the official recommendation.

Values can also be serialized as JSON with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to json, and
  • the options presented in this article need to be assigned to the json parameter.
" - } - }, - "description": " This XQuery Module contains functions to parse and serialize JSON data JSON (JavaScript Object Notation) is a popular data exchange format for applications written in JavaScript. As there are notable differences between JSON and XML, or XQuery data types, no mapping exists that guarantees a lossless, bidirectional conversion between JSON and XML. For this reason, we offer various mappings, all of which are suited to different use cases.", - "type": "module", - "override": true - }, - "http://basex.org/modules/lazy": { - "ns": "http://basex.org/modules/lazy", - "prefixes": [ - "lazy" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/lazy#cache#1": { - "name": "cache", - "uri": "http://basex.org/modules/lazy", - "key": "http://basex.org/modules/lazy#cache#1", - "params": [ - "$items as item()*" - ], - "type": "item()*", - "description": " Caches the data of lazy $items in a sequence:
  • data of lazy items will be retrieved and cached inside the item.
  • non-lazy items, or lazy items with cached data, will simply be passed through.
  • If $lazy is set to true(), caching will be deferred until the data is eventually requested. Streaming will be disabled: Data will always be cached before a stream is returned.

Caching is advisable if an item will be processed more than once, or if the data may not be available anymore at a later stage.

" - }, - "http://basex.org/modules/lazy#cache#2": { - "name": "cache", - "uri": "http://basex.org/modules/lazy", - "key": "http://basex.org/modules/lazy#cache#2", - "params": [ - "$items as item()*", - "$lazy as xs:boolean" - ], - "type": "item()*", - "description": " Caches the data of lazy $items in a sequence:
  • data of lazy items will be retrieved and cached inside the item.
  • non-lazy items, or lazy items with cached data, will simply be passed through.
  • If $lazy is set to true(), caching will be deferred until the data is eventually requested. Streaming will be disabled: Data will always be cached before a stream is returned.

Caching is advisable if an item will be processed more than once, or if the data may not be available anymore at a later stage.

" - }, - "http://basex.org/modules/lazy#is-lazy#1": { - "name": "is-lazy", - "uri": "http://basex.org/modules/lazy", - "key": "http://basex.org/modules/lazy#is-lazy#1", - "params": [ - "$item as item()" - ], - "type": "xs:boolean", - "description": " Checks whether the specified $item is lazy." - }, - "http://basex.org/modules/lazy#is-cached#1": { - "name": "is-cached", - "uri": "http://basex.org/modules/lazy", - "key": "http://basex.org/modules/lazy#is-cached#1", - "params": [ - "$item as item()" - ], - "type": "xs:boolean", - "description": " Checks whether the contents of the specified $item are cached. The function will always return true for non-lazy items." - } - }, - "description": " This XQuery Module contains functions for handling lazy items.", - "type": "module", - "override": true - }, - "http://www.w3.org/2005/xpath-functions/map": { - "ns": "http://www.w3.org/2005/xpath-functions/map", - "prefixes": [ - "map" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://www.w3.org/2005/xpath-functions/map#contains#2": { - "name": "contains", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#contains#2", - "params": [ - "$map as map(*)", - "$key as xs:anyAtomicType" - ], - "type": "xs:boolean", - "description": " Returns true if the supplied $map contains an entry with a key equal to the supplied value of $key; otherwise it returns false. No error is raised if the map contains keys that are not comparable with the supplied $key.

If the supplied key is xs:untypedAtomic, it is compared as an instance of xs:string. If the supplied key is the xs:float or xs:double value NaN, the function returns true if there is an entry whose key is NaN, or false otherwise.

" - }, - "http://www.w3.org/2005/xpath-functions/map#entry#2": { - "name": "entry", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#entry#2", - "params": [ - "$key as xs:anyAtomicType", - "$value as item()*" - ], - "type": "map(*)", - "description": " Creates a new map containing a single entry. The key of the entry in the new map is $key, and its associated value is $value.

The function map:entry is intended primarily for use in conjunction with the function map:merge . For example, a map containing seven entries may be constructed like this:

  map:merge (( map:entry ( \"Sun\" , \"Sunday\" ), map:entry ( \"Mon\" , \"Monday\" ), map:entry ( \"Tue\" , \"Tuesday\" ), map:entry ( \"Wed\" , \"Wednesday\" ), map:entry ( \"Thu\" , \"Thursday\" ), map:entry ( \"Fri\" , \"Friday\" ), map:entry ( \"Sat\" , \"Saturday\" ) )) 

Unlike the map { ... } expression, this technique can be used to construct a map with a variable number of entries, for example:

  map:merge ( for $ b in // book return map:entry ( $ b / isbn , $ b )) 
" - }, - "http://www.w3.org/2005/xpath-functions/map#find#2": { - "name": "find", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#find#2", - "params": [ - "$input as item()*", - "$key as xs:anyAtomicType" - ], - "type": "array(*)", - "description": " Returns all values of maps in the supplied $input with the specified $key. The found values will be returned in an array. Arbitrary input will be processed recursively as follows:
  • In a sequence, each item will be processed in order.
  • In an array, all array members will be processed as sequence.
  • In a map, all entries whose keys match the specified key. Moreover, all values of the map will be processed as sequence.
" - }, - "http://www.w3.org/2005/xpath-functions/map#for-each#2": { - "name": "for-each", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#for-each#2", - "params": [ - "$map as map(*)", - "$function as function(xs:anyAtomicType, item()*) as item()*" - ], - "type": "item()*", - "description": " Applies the specified $function to every key/value pair of the supplied $map and returns the results as a sequence." - }, - "http://www.w3.org/2005/xpath-functions/map#get#2": { - "name": "get", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#get#2", - "params": [ - "$map as map(*)", - "$key as xs:anyAtomicType" - ], - "type": "item()*", - "description": " Returns the value associated with a supplied key in a given map. This function attempts to find an entry within the $map that has a key equal to the supplied value of $key. If there is such an entry, the function returns the associated value; otherwise it returns an empty sequence. No error is raised if the map contains keys that are not comparable with the supplied $key. If the supplied key is xs:untypedAtomic, it is converted to xs:string.

A return value of () from map:get could indicate that the key is present in the map with an associated value of (), or it could indicate that the key is not present in the map. The two cases can be distinguished by calling map:contains. Invoking the map as a function item has the same effect as calling get: that is, when $map is a map, the expression $map($K) is equivalent to get($map, $K). Similarly, the expression get(get(get($map, 'employee'), 'name'), 'first') can be written as $map('employee')('name')('first').

" - }, - "http://www.w3.org/2005/xpath-functions/map#keys#1": { - "name": "keys", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#keys#1", - "params": [ - "$map as map(*)" - ], - "type": "xs:anyAtomicType*", - "description": " Returns a sequence containing all the key values present in a map. The function takes the supplied $map and returns the keys that are present in the map as a sequence of atomic values. The order may differ from the order in which entries were inserted in the map." - }, - "http://www.w3.org/2005/xpath-functions/map#merge#1": { - "name": "merge", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#merge#1", - "params": [ - "$maps as map(*)*" - ], - "type": "map(*)", - "description": " Constructs and returns a new map. The map is formed by combining the contents of the supplied $maps. The maps are combined as follows:
  1. There is one entry in the new map for each distinct key present in the union of the input maps.
  2. The $options argument defines how duplicate keys are handled. Currently, a single option duplicates exists, and its allowed values are use-first, use-last, combine and reject (default: use-first).
" - }, - "http://www.w3.org/2005/xpath-functions/map#merge#2": { - "name": "merge", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#merge#2", - "params": [ - "$maps as map(*)*", - "$options as map(*)" - ], - "type": "map(*)", - "description": " Constructs and returns a new map. The map is formed by combining the contents of the supplied $maps. The maps are combined as follows:
  1. There is one entry in the new map for each distinct key present in the union of the input maps.
  2. The $options argument defines how duplicate keys are handled. Currently, a single option duplicates exists, and its allowed values are use-first, use-last, combine and reject (default: use-first).
" - }, - "http://www.w3.org/2005/xpath-functions/map#put#3": { - "name": "put", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#put#3", - "params": [ - "$map as map(*)", - "$key as xs:anyAtomicType", - "$value as item()*" - ], - "type": "map(*)", - "description": " Creates a new map, containing the entries of the supplied $map and a new entry composed by $key and $value. The semantics of this function are equivalent to map:merge((map { $key, $value }, $map))" - }, - "http://www.w3.org/2005/xpath-functions/map#remove#2": { - "name": "remove", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#remove#2", - "params": [ - "$map as map(*)", - "$keys as xs:anyAtomicType*" - ], - "type": "map(*)", - "description": " Constructs a new map by removing entries from an existing map. The entries in the new map correspond to the entries of $map, excluding entries supplied via $keys.

No failure occurs if the input map contains no entry with the supplied keys; the input map is returned unchanged.

" - }, - "http://www.w3.org/2005/xpath-functions/map#size#1": { - "name": "size", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#size#1", - "params": [ - "$map as map(*)" - ], - "type": "xs:integer", - "description": " Returns a the number of entries in the supplied map. The function takes the supplied $map and returns the number of entries that are present in the map." - } - }, - "description": " This XQuery Module contains functions for manipulating maps. Maps have been introduced with XQuery 3.1.", - "type": "module", - "override": true - }, - "http://www.w3.org/2005/xpath-functions/math": { - "ns": "http://www.w3.org/2005/xpath-functions/math", - "prefixes": [ - "math" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://www.w3.org/2005/xpath-functions/math#pi#0": { - "name": "pi", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#pi#0", - "params": [], - "type": "xs:double", - "description": " Returns the xs:double value of the mathematical constant π whose lexical representation is 3.141592653589793." - }, - "http://www.w3.org/2005/xpath-functions/math#sqrt#1": { - "name": "sqrt", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#sqrt#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the square root of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the xs:double value of the mathematical square root of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#sin#1": { - "name": "sin", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#sin#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the sine of the $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the sine of $arg, treated as an angle in radians." - }, - "http://www.w3.org/2005/xpath-functions/math#cos#1": { - "name": "cos", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#cos#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the cosine of $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the cosine of $arg, treated as an angle in radians." - }, - "http://www.w3.org/2005/xpath-functions/math#tan#1": { - "name": "tan", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#tan#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the tangent of $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the tangent of $arg, treated as an angle in radians." - }, - "http://www.w3.org/2005/xpath-functions/math#asin#1": { - "name": "asin", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#asin#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the arc sine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc sine of $arg, returned as an angle in radians in the range -Ï€/2 to +Ï€/2." - }, - "http://www.w3.org/2005/xpath-functions/math#acos#1": { - "name": "acos", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#acos#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the arc cosine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc cosine of $arg, returned as an angle in radians in the range 0 to +Ï€." - }, - "http://www.w3.org/2005/xpath-functions/math#atan#1": { - "name": "atan", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#atan#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the arc tangent of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc tangent of $arg, returned as an angle in radians in the range -Ï€/2 to +Ï€/2." - }, - "http://www.w3.org/2005/xpath-functions/math#atan2#2": { - "name": "atan2", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#atan2#2", - "params": [ - "$arg1 as xs:double?", - "$arg2 as xs:double" - ], - "type": "xs:double?", - "description": " Returns the arc tangent of $arg1 divided by $arg2, the result being in the range -Ï€/2 to +Ï€/2 radians.
If $arg1 is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc tangent of $arg1 divided by $arg2, returned as an angle in radians in the range -Ï€ to +Ï€." - }, - "http://www.w3.org/2005/xpath-functions/math#pow#2": { - "name": "pow", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#pow#2", - "params": [ - "$arg1 as xs:double?", - "$arg2 as xs:double" - ], - "type": "xs:double?", - "description": " Returns $arg1 raised to the power of $arg2.
If $arg1 is the empty sequence, the empty sequence is returned.
Otherwise the result is the $arg1 raised to the power of $arg2." - }, - "http://www.w3.org/2005/xpath-functions/math#exp#1": { - "name": "exp", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#exp#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns e raised to the power of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the value of e raised to the power of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#log#1": { - "name": "log", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#log#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the natural logarithm of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the natural logarithm (base e) of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#log10#1": { - "name": "log10", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#log10#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the base 10 logarithm of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the base 10 logarithm of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#e#0": { - "name": "e", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#e#0", - "params": [], - "type": "xs:double", - "description": " Returns the xs:double value of the mathematical constant e whose lexical representation is 2.718281828459045." - }, - "http://www.w3.org/2005/xpath-functions/math#sinh#1": { - "name": "sinh", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#sinh#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the hyperbolic sine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic sine of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#cosh#1": { - "name": "cosh", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#cosh#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the hyperbolic cosine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic cosine of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#tanh#1": { - "name": "tanh", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#tanh#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the hyperbolic tangent of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic tangent of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#crc32#1": { - "name": "crc32", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#crc32#1", - "params": [ - "$string as xs:string?" - ], - "type": "xs:hexBinary?", - "description": " Calculates the CRC32 check sum of the given $string.
If an empty sequence is supplied, the empty sequence is returned." - } - }, - "description": " The math XQuery Module defines functions to perform mathematical operations, such as pi, asin and acos. Most functions are specified in the Functions and Operators Specification of the upcoming XQuery 3.0 Recommendation, and some additional ones have been added in this module.", - "type": "module", - "override": true - }, - "http://basex.org/modules/proc": { - "ns": "http://basex.org/modules/proc", - "prefixes": [ - "proc" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/proc#system#1": { - "name": "system", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#system#1", - "params": [ - "$cmd as xs:string" - ], - "type": "xs:string", - "description": " Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
" - }, - "http://basex.org/modules/proc#system#2": { - "name": "system", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#system#2", - "params": [ - "$cmd as xs:string", - "$args as xs:string*" - ], - "type": "xs:string", - "description": " Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
" - }, - "http://basex.org/modules/proc#system#3": { - "name": "system", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#system#3", - "params": [ - "$cmd as xs:string", - "$args as xs:string*", - "$options as map(xs:string, xs:string)" - ], - "type": "xs:string", - "description": " Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
" - }, - "http://basex.org/modules/proc#execute#1": { - "name": "execute", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#execute#1", - "params": [ - "$cmd as xs:string" - ], - "type": "element(result)", - "description": " Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system .
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

  <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
" - }, - "http://basex.org/modules/proc#execute#2": { - "name": "execute", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#execute#2", - "params": [ - "$cmd as xs:string", - "$args as xs:string*" - ], - "type": "element(result)", - "description": " Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system .
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

  <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
" - }, - "http://basex.org/modules/proc#execute#3": { - "name": "execute", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#execute#3", - "params": [ - "$cmd as xs:string", - "$args as xs:string*", - "$options as map(xs:string, xs:string)" - ], - "type": "element(result)", - "description": " Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system .
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

  <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
" - }, - "http://basex.org/modules/proc#fork#1": { - "name": "fork", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#fork#1", - "params": [ - "$cmd as xs:string" - ], - "type": "element(result)", - "description": " Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored)." - }, - "http://basex.org/modules/proc#fork#2": { - "name": "fork", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#fork#2", - "params": [ - "$cmd as xs:string", - "$args as xs:string*" - ], - "type": "element(result)", - "description": " Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored)." - }, - "http://basex.org/modules/proc#fork#3": { - "name": "fork", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#fork#3", - "params": [ - "$cmd as xs:string", - "$args as xs:string*", - "$options as map(xs:string, xs:string)" - ], - "type": "element(result)", - "description": " Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored)." - }, - "http://basex.org/modules/proc#property#1": { - "name": "property", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#property#1", - "params": [ - "$name as xs:string" - ], - "type": "xs:string?", - "description": " Returns the system property, specified by $name, or a context parameter of the web.xml file with that name (see Web Applications). An empty sequence is returned if the property does not exist. For environment variables of the operating system, please use fn:environment-variable." - }, - "http://basex.org/modules/proc#property-names#0": { - "name": "property-names", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#property-names#0", - "params": [], - "type": "xs:string*", - "description": " Returns the names of all Java system properties and context parameters of the web.xml file (see Web Applications). For environment variables of the operating system, please use fn:available-environment-variables." - } - }, - "description": " This XQuery Module provides functions for executing system commands from XQuery.", - "type": "module", - "override": true - }, - "http://basex.org/modules/random": { - "ns": "http://basex.org/modules/random", - "prefixes": [ - "random" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/random#double#0": { - "name": "double", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#double#0", - "params": [], - "type": "xs:double", - "description": " Returns a double value between 0.0 (inclusive) and 1.0 (exclusive).
" - }, - "http://basex.org/modules/random#integer#0": { - "name": "integer", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#integer#0", - "params": [], - "type": "xs:integer", - "description": " Returns an integer value, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive)
" - }, - "http://basex.org/modules/random#integer#1": { - "name": "integer", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#integer#1", - "params": [ - "$max as xs:integer" - ], - "type": "xs:integer", - "description": " Returns an integer value, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive)
" - }, - "http://basex.org/modules/random#seeded-double#2": { - "name": "seeded-double", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#seeded-double#2", - "params": [ - "$seed as xs:integer", - "$num as xs:integer" - ], - "type": "xs:double*", - "description": " Returns a sequence with $num double values between 0.0 (inclusive) and 1.0 (exclusive). The random values are created using the initial seed given in $seed.
" - }, - "http://basex.org/modules/random#seeded-integer#2": { - "name": "seeded-integer", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#seeded-integer#2", - "params": [ - "$seed as xs:integer", - "$num as xs:integer" - ], - "type": "xs:integer*", - "description": " Returns a sequence with $num integer values, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive). The random values are created using the initial seed given in $seed.
" - }, - "http://basex.org/modules/random#seeded-integer#3": { - "name": "seeded-integer", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#seeded-integer#3", - "params": [ - "$seed as xs:integer", - "$num as xs:integer", - "$max as xs:integer" - ], - "type": "xs:integer*", - "description": " Returns a sequence with $num integer values, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive). The random values are created using the initial seed given in $seed.
" - }, - "http://basex.org/modules/random#gaussian#1": { - "name": "gaussian", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#gaussian#1", - "params": [ - "$num as xs:integer" - ], - "type": "xs:double*", - "description": " Returns a sequence with $num double values. The random values are Gaussian (i.e. normally) distributed with the mean 0.0. and the derivation 1.0.
" - }, - "http://basex.org/modules/random#seeded-permutation#2": { - "name": "seeded-permutation", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#seeded-permutation#2", - "params": [ - "$seed as xs:integer", - "$items as item()*" - ], - "type": "item()*", - "description": " Returns a random permutation of the specified $items. The random order is created using the initial seed given in $seed.
" - }, - "http://basex.org/modules/random#uuid#0": { - "name": "uuid", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#uuid#0", - "params": [], - "type": "xs:string", - "description": " Creates a random universally unique identifier (UUID), represented as 128-bit value." - } - }, - "description": " This XQuery Module contains functions for computing random values. All functions except for random:seeded-double and random:seeded-integer are non-deterministic, i. e., they return different values for each call.", - "type": "module", - "override": true - }, - "http://basex.org/modules/repo": { - "ns": "http://basex.org/modules/repo", - "prefixes": [ - "repo" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/repo#install#1": { - "name": "install", - "uri": "http://basex.org/modules/repo", - "key": "http://basex.org/modules/repo#install#1", - "params": [ - "$uri as xs:string" - ], - "type": "empty-sequence()", - "description": " Retrieves and installs a package from the given $uri. Existing packages are replaced." - }, - "http://basex.org/modules/repo#delete#1": { - "name": "delete", - "uri": "http://basex.org/modules/repo", - "key": "http://basex.org/modules/repo#delete#1", - "params": [ - "$package as xs:string" - ], - "type": "empty-sequence()", - "description": " Deletes a $package. The argument contains the package name, optionally suffixed with a dash and the package version.
" - }, - "http://basex.org/modules/repo#list#0": { - "name": "list", - "uri": "http://basex.org/modules/repo", - "key": "http://basex.org/modules/repo#list#0", - "params": [], - "type": "element(package)*", - "description": " Lists the names and versions of all currently installed packages.
" - } - }, - "description": " This XQuery Module contains functions for installing, listing and deleting modules contained in the Repository.", - "type": "module", - "override": true - }, - "http://exquery.org/ns/request": { - "ns": "http://exquery.org/ns/request", - "prefixes": [ - "request" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://exquery.org/ns/request#method#0": { - "name": "method", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#method#0", - "params": [], - "type": "xs:string", - "description": " Returns the Method of the HTTP request." - }, - "http://exquery.org/ns/request#scheme#0": { - "name": "scheme", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#scheme#0", - "params": [], - "type": "xs:string", - "description": " Returns the Scheme component of the URI of an HTTP request." - }, - "http://exquery.org/ns/request#hostname#0": { - "name": "hostname", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#hostname#0", - "params": [], - "type": "xs:string", - "description": " Returns the Hostname component of the URI of an HTTP request." - }, - "http://exquery.org/ns/request#port#0": { - "name": "port", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#port#0", - "params": [], - "type": "xs:integer", - "description": " Returns the Port component of the URI of an HTTP request, or a default port if it has not been explicitly specified in the URI." - }, - "http://exquery.org/ns/request#path#0": { - "name": "path", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#path#0", - "params": [], - "type": "xs:string", - "description": " Returns the Path component of the URI of an HTTP request." - }, - "http://exquery.org/ns/request#query#0": { - "name": "query", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#query#0", - "params": [], - "type": "xs:string?", - "description": " Returns the Query component of the URI of an HTTP request. If no query component exists, an empty sequence is returned." - }, - "http://exquery.org/ns/request#uri#0": { - "name": "uri", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#uri#0", - "params": [], - "type": "xs:anyURI", - "description": " Returns the complete URI of an HTTP request as it has been specified by the client." - }, - "http://exquery.org/ns/request#context-path#0": { - "name": "context-path", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#context-path#0", - "params": [], - "type": "xs:string", - "description": " Returns the context of the request. For servlets in the default (root) context, this method returns an empty string." - }, - "http://exquery.org/ns/request#address#0": { - "name": "address", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#address#0", - "params": [], - "type": "xs:string", - "description": " Returns the IP address of the server." - }, - "http://exquery.org/ns/request#remote-hostname#0": { - "name": "remote-hostname", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#remote-hostname#0", - "params": [], - "type": "xs:string", - "description": " Returns the fully qualified hostname of the client that sent the request." - }, - "http://exquery.org/ns/request#remote-address#0": { - "name": "remote-address", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#remote-address#0", - "params": [], - "type": "xs:string", - "description": " Returns the IP address of the client that sent the request." - }, - "http://exquery.org/ns/request#remote-port#0": { - "name": "remote-port", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#remote-port#0", - "params": [], - "type": "xs:string", - "description": " Returns the TCP port of the client socket that triggered the request." - }, - "http://exquery.org/ns/request#parameter-names#0": { - "name": "parameter-names", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#parameter-names#0", - "params": [], - "type": "xs:string*", - "description": " Returns the names of all query and form field parameters available from the HTTP request. With RESTXQ, this function can be used to access parameters that have not been statically bound by %rest:query-param." - }, - "http://exquery.org/ns/request#parameter#1": { - "name": "parameter", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#parameter#1", - "params": [ - "$name as xs:string" - ], - "type": "xs:string*", - "description": " Returns the value of the named query or form field parameter in an HTTP request. If the parameter does not exist, an empty sequence or the optionally specified default value is returned instead. If both query and form field parameters with the same name exist, the form field values will be attached to the query values." - }, - "http://exquery.org/ns/request#parameter#2": { - "name": "parameter", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#parameter#2", - "params": [ - "$name as xs:string", - "$default as xs:string" - ], - "type": "xs:string*", - "description": " Returns the value of the named query or form field parameter in an HTTP request. If the parameter does not exist, an empty sequence or the optionally specified default value is returned instead. If both query and form field parameters with the same name exist, the form field values will be attached to the query values." - }, - "http://exquery.org/ns/request#header-names#0": { - "name": "header-names", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#header-names#0", - "params": [], - "type": "xs:string*", - "description": " Returns the names of all headers available from the HTTP request. If RESTXQ is used, this function can be used to access headers that have not been statically bound by %rest:header-param." - }, - "http://exquery.org/ns/request#header#1": { - "name": "header", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#header#1", - "params": [ - "$name as xs:string" - ], - "type": "xs:string?", - "description": " Returns the value of the named header in an HTTP request. If the header does not exist, an empty sequence or the optionally specified default value is returned instead." - }, - "http://exquery.org/ns/request#header#2": { - "name": "header", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#header#2", - "params": [ - "$name as xs:string", - "$default as xs:string" - ], - "type": "xs:string", - "description": " Returns the value of the named header in an HTTP request. If the header does not exist, an empty sequence or the optionally specified default value is returned instead." - }, - "http://exquery.org/ns/request#cookie-names#0": { - "name": "cookie-names", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#cookie-names#0", - "params": [], - "type": "xs:string*", - "description": " Returns the names of all cookies in the HTTP headers available from the HTTP request. If RESTXQ is used, this function can be used to access cookies that have not been statically bound by %rest:cookie-param." - }, - "http://exquery.org/ns/request#cookie#1": { - "name": "cookie", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#cookie#1", - "params": [ - "$name as xs:string" - ], - "type": "xs:string?", - "description": " Returns the value of the named Cookie in an HTTP request. If there is no such cookie, an empty sequence or the optionally specified default value is returned instead." - }, - "http://exquery.org/ns/request#cookie#2": { - "name": "cookie", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#cookie#2", - "params": [ - "$name as xs:string", - "$default as xs:string" - ], - "type": "xs:string", - "description": " Returns the value of the named Cookie in an HTTP request. If there is no such cookie, an empty sequence or the optionally specified default value is returned instead." - }, - "http://exquery.org/ns/request#attribute-names#0": { - "name": "attribute-names", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#attribute-names#0", - "params": [], - "type": "xs:string*", - "description": " Returns the names of all HTTP request attributes." - }, - "http://exquery.org/ns/request#attribute#1": { - "name": "attribute", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#attribute#1", - "params": [ - "$name as xs:string" - ], - "type": "item()*", - "description": " Returns the value of an attribute of the HTTP request. If the attribute does not exist, an empty sequence or the optionally specified default value is returned instead." - }, - "http://exquery.org/ns/request#attribute#2": { - "name": "attribute", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#attribute#2", - "params": [ - "$name as xs:string", - "$default as item()*" - ], - "type": "item()*", - "description": " Returns the value of an attribute of the HTTP request. If the attribute does not exist, an empty sequence or the optionally specified default value is returned instead." - }, - "http://exquery.org/ns/request#set-attribute#2": { - "name": "set-attribute", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#set-attribute#2", - "params": [ - "$name as xs:string", - "$value as item()*" - ], - "type": "empty-sequence()", - "description": " Binds the specified $value to the request attribute with the specified $name." - } - }, - "description": " This XQuery Module contains functions for retrieving information on an HTTP request that has triggered the query. It is mostly useful when building Web Applications.", - "type": "module", - "override": true - }, - "http://exquery.org/ns/restxq": { - "ns": "http://exquery.org/ns/restxq", - "prefixes": [ - "rest" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://exquery.org/ns/restxq#base-uri#0": { - "name": "base-uri", - "uri": "http://exquery.org/ns/restxq", - "key": "http://exquery.org/ns/restxq#base-uri#0", - "params": [], - "type": "xs:anyURI", - "description": " Returns the implementation-defined base URI of the resource function." - }, - "http://exquery.org/ns/restxq#uri#0": { - "name": "uri", - "uri": "http://exquery.org/ns/restxq", - "key": "http://exquery.org/ns/restxq#uri#0", - "params": [], - "type": "xs:anyURI", - "description": " Returns the complete URI that addresses the Resource Function. This is the result of rest:base-uri appended with the path from the path annotation of the resource function." - }, - "http://exquery.org/ns/restxq#wadl#0": { - "name": "wadl", - "uri": "http://exquery.org/ns/restxq", - "key": "http://exquery.org/ns/restxq#wadl#0", - "params": [], - "type": "element(wadl:application)", - "description": " Returns a WADL description of all available REST services." - }, - "http://exquery.org/ns/restxq#init#0": { - "name": "init", - "uri": "http://exquery.org/ns/restxq", - "key": "http://exquery.org/ns/restxq#init#0", - "params": [], - "type": "empty-sequence()", - "description": " Initializes the RESTXQ module cache:
  • By default, the cache will be discarded, and all modules will be parsed and cached again.
  • If $update is enabled, the background caching behavior is simulated (see PARSERESTXQ ): Only updated modules will be parsed.
  • This function should be called if new RESTXQ code is deployed at runtime.
" - }, - "http://exquery.org/ns/restxq#init#1": { - "name": "init", - "uri": "http://exquery.org/ns/restxq", - "key": "http://exquery.org/ns/restxq#init#1", - "params": [ - "$update as xs:boolean" - ], - "type": "empty-sequence()", - "description": " Initializes the RESTXQ module cache:
  • By default, the cache will be discarded, and all modules will be parsed and cached again.
  • If $update is enabled, the background caching behavior is simulated (see PARSERESTXQ ): Only updated modules will be parsed.
  • This function should be called if new RESTXQ code is deployed at runtime.
" - } - }, - "description": " This XQuery Module contains helper functions for the RESTXQ API, some of which are defined in the RESTXQ Draft.", - "type": "module", - "override": true - }, - "http://basex.org/modules/session": { - "ns": "http://basex.org/modules/session", - "prefixes": [ - "session" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/session#id#0": { - "name": "id", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#id#0", - "params": [], - "type": "xs:string", - "description": " Returns the session ID of a servlet request." - }, - "http://basex.org/modules/session#created#0": { - "name": "created", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#created#0", - "params": [], - "type": "xs:dateTime", - "description": " Returns the creation time of a session." - }, - "http://basex.org/modules/session#accessed#0": { - "name": "accessed", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#accessed#0", - "params": [], - "type": "xs:dateTime", - "description": " Returns the last access time of a session." - }, - "http://basex.org/modules/session#names#0": { - "name": "names", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#names#0", - "params": [], - "type": "xs:string*", - "description": " Returns the names of all attributes bound to the current session." - }, - "http://basex.org/modules/session#get#1": { - "name": "get", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#get#1", - "params": [ - "$name as xs:string" - ], - "type": "item()*", - "description": " Returns the value of a session attribute with the specified $name. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead." - }, - "http://basex.org/modules/session#get#2": { - "name": "get", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#get#2", - "params": [ - "$name as xs:string", - "$default as item()*" - ], - "type": "item()*", - "description": " Returns the value of a session attribute with the specified $name. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead." - }, - "http://basex.org/modules/session#set#2": { - "name": "set", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#set#2", - "params": [ - "$name as xs:string", - "$value as item()*" - ], - "type": "empty-sequence()", - "description": " Binds the specified $value to the session attribute with the specified $name." - }, - "http://basex.org/modules/session#delete#1": { - "name": "delete", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#delete#1", - "params": [ - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Deletes a session attribute with the specified $name." - }, - "http://basex.org/modules/session#close#0": { - "name": "close", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#close#0", - "params": [], - "type": "empty-sequence()", - "description": " Unregisters a session and all data associated with it." - } - }, - "description": " This XQuery Module contains functions for accessing and modifying server-side session information. This module is mainly useful in the context of Web Applications.", - "type": "module", - "override": true - }, - "http://basex.org/modules/sessions": { - "ns": "http://basex.org/modules/sessions", - "prefixes": [ - "sessions" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/sessions#ids#0": { - "name": "ids", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#ids#0", - "params": [], - "type": "xs:string*", - "description": " Returns the IDs of all registered sessions." - }, - "http://basex.org/modules/sessions#created#1": { - "name": "created", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#created#1", - "params": [ - "$id as xs:string" - ], - "type": "xs:dateTime", - "description": " Returns the creation time of the session specified by $id." - }, - "http://basex.org/modules/sessions#accessed#1": { - "name": "accessed", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#accessed#1", - "params": [ - "$id as xs:string" - ], - "type": "xs:dateTime", - "description": " Returns the last access time of the session specified by $id." - }, - "http://basex.org/modules/sessions#names#1": { - "name": "names", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#names#1", - "params": [ - "$id as xs:string" - ], - "type": "xs:string*", - "description": " Returns the names of all attributes bound to the session specified by $id." - }, - "http://basex.org/modules/sessions#get#2": { - "name": "get", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#get#2", - "params": [ - "$id as xs:string", - "$name as xs:string" - ], - "type": "item()*", - "description": " Returns the value of an attribute with the specified $name from the session with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead." - }, - "http://basex.org/modules/sessions#get#3": { - "name": "get", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#get#3", - "params": [ - "$id as xs:string", - "$name as xs:string", - "$default as item()*" - ], - "type": "item()*", - "description": " Returns the value of an attribute with the specified $name from the session with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead." - }, - "http://basex.org/modules/sessions#set#3": { - "name": "set", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#set#3", - "params": [ - "$id as xs:string", - "$name as xs:string", - "$value as item()*" - ], - "type": "empty-sequence()", - "description": " Returns the specified value to the attribute with the specified $name from the session with the specified $id." - }, - "http://basex.org/modules/sessions#delete#2": { - "name": "delete", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#delete#2", - "params": [ - "$id as xs:string", - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Deletes an attribute with the specified $name from the session with the specified $id." - }, - "http://basex.org/modules/sessions#close#1": { - "name": "close", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#close#1", - "params": [ - "$id as xs:string" - ], - "type": "empty-sequence()", - "description": " Unregisters the session specified by $id." - } - }, - "description": " This XQuery Module can only be called from users with Admin permissions. It contains functions for accessing and modifying all registered server-side sessions. This module is mainly useful in the context of Web Applications.", - "type": "module", - "override": true - }, - "http://basex.org/modules/sql": { - "ns": "http://basex.org/modules/sql", - "prefixes": [ - "sql" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/sql#init#1": { - "name": "init", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#init#1", - "params": [ - "$class as xs:string" - ], - "type": "empty-sequence()", - "description": " This function initializes a JDBC driver specified via $class. This step might be superfluous if the SQL database is not embedded.
" - }, - "http://basex.org/modules/sql#connect#1": { - "name": "connect", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#connect#1", - "params": [ - "$url as xs:string" - ], - "type": "xs:anyURI", - "description": " This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:<server> [/<database>]. If $username and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options." - }, - "http://basex.org/modules/sql#connect#3": { - "name": "connect", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#connect#3", - "params": [ - "$url as xs:string", - "$username as xs:string", - "$password as xs:string" - ], - "type": "xs:anyURI", - "description": " This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:<server> [/<database>]. If $username and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options." - }, - "http://basex.org/modules/sql#connect#4": { - "name": "connect", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#connect#4", - "params": [ - "$url as xs:string", - "$username as xs:string", - "$password as xs:string", - "$options as map(*)?" - ], - "type": "xs:anyURI", - "description": " This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:<server> [/<database>]. If $username and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options." - }, - "http://basex.org/modules/sql#execute#2": { - "name": "execute", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#execute#2", - "params": [ - "$id as xs:anyURI", - "$statement as xs:string" - ], - "type": "item()*", - "description": " This function executes an SQL $statement, using the connection with the specified $id. The returned result depends on the kind of statement:
  • If an update statement was executed, the number of updated rows will be returned as integer.
  • Otherwise, an XML representation of all results will be returned.

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
" - }, - "http://basex.org/modules/sql#execute#3": { - "name": "execute", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#execute#3", - "params": [ - "$id as xs:anyURI", - "$statement as xs:string", - "$options as map(*)?" - ], - "type": "item()*", - "description": " This function executes an SQL $statement, using the connection with the specified $id. The returned result depends on the kind of statement:
  • If an update statement was executed, the number of updated rows will be returned as integer.
  • Otherwise, an XML representation of all results will be returned.

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
" - }, - "http://basex.org/modules/sql#execute-prepared#2": { - "name": "execute-prepared", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#execute-prepared#2", - "params": [ - "$id as xs:anyURI", - "$params as element(sql:parameters)" - ], - "type": "item()*", - "description": " This function executes a prepared statement with the specified $id. The output format is identical to sql:execute . The optional parameter $params is an element <sql:parameters/> representing the parameters for a prepared statement along with their types and values. The following schema shall be used:
  element sql:parameters { element sql:parameter { attribute type { \"bigdecimal\" | \"boolean\" | \"byte\" | \"date\" | \"double\" | \"float\" | \"int\" | \"long\" | \"short\" | \"sqlxml\" | \"string\" | \"time\" | \"timestamp\" }, attribute null { \"true\" | \"false\" }?, text } + } ? 

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
" - }, - "http://basex.org/modules/sql#execute-prepared#3": { - "name": "execute-prepared", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#execute-prepared#3", - "params": [ - "$id as xs:anyURI", - "$params as element(sql:parameters)", - "$options as map(*)?" - ], - "type": "item()*", - "description": " This function executes a prepared statement with the specified $id. The output format is identical to sql:execute . The optional parameter $params is an element <sql:parameters/> representing the parameters for a prepared statement along with their types and values. The following schema shall be used:
  element sql:parameters { element sql:parameter { attribute type { \"bigdecimal\" | \"boolean\" | \"byte\" | \"date\" | \"double\" | \"float\" | \"int\" | \"long\" | \"short\" | \"sqlxml\" | \"string\" | \"time\" | \"timestamp\" }, attribute null { \"true\" | \"false\" }?, text } + } ? 

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
" - }, - "http://basex.org/modules/sql#prepare#2": { - "name": "prepare", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#prepare#2", - "params": [ - "$id as xs:anyURI", - "$statement as xs:string" - ], - "type": "xs:anyURI", - "description": " This function prepares an SQL $statement, using the specified connection $id, and returns the id reference to this statement. The statement is a string with one or more '?' placeholders. If the value of a field has to be set to NULL, then the attribute null of the <sql:parameter/> element must be true." - }, - "http://basex.org/modules/sql#commit#1": { - "name": "commit", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#commit#1", - "params": [ - "$id as xs:anyURI" - ], - "type": "empty-sequence()", - "description": " This function commits the changes made to a relational database, using the specified connection $id." - }, - "http://basex.org/modules/sql#rollback#1": { - "name": "rollback", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#rollback#1", - "params": [ - "$id as xs:anyURI" - ], - "type": "empty-sequence()", - "description": " This function rolls back the changes made to a relational database, using the specified connection $id." - }, - "http://basex.org/modules/sql#close#1": { - "name": "close", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#close#1", - "params": [ - "$id as xs:anyURI" - ], - "type": "empty-sequence()", - "description": " This function closes a database connection with the specified $id.
Opened connections will automatically be closed after the XQuery expression has been evaluated, but in order to save memory, it is always recommendable to close connections that are not used anymore." - } - }, - "description": " This XQuery Module contains functions to access relational databases from XQuery using SQL. With this module, you can execute query, update and prepared statements, and the result sets are returned as sequences of XML elements representing tuples. Each element has children representing the columns returned by the SQL statement.", - "type": "module", - "override": true - }, - "http://basex.org/modules/store": { - "ns": "http://basex.org/modules/store", - "prefixes": [ - "store" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/store#get#1": { - "name": "get", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#get#1", - "params": [ - "$key as xs:string" - ], - "type": "item()*", - "description": " Retrieves an entry from the store with the given $key. If the addressed entry does not exist, an empty sequence is returned." - }, - "http://basex.org/modules/store#put#2": { - "name": "put", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#put#2", - "params": [ - "$key as xs:string", - "$value as item()*" - ], - "type": "empty-sequence()", - "description": " Stores an entry with the given $key and $value in the store:
  • If the value is an empty sequence, the entry is removed.
  • If a value refers to an opened database or is a lazy item, its contents are materialized in main memory.
  • Values with function items are rejected.
" - }, - "http://basex.org/modules/store#get-or-put#2": { - "name": "get-or-put", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#get-or-put#2", - "params": [ - "$key as xs:string", - "$put as function() as item()*" - ], - "type": "item()*", - "description": " Retrieves an entry from the store with the given $key. The $put function will only be invoked if the entry does not exist, and its result will be stored and returned instead." - }, - "http://basex.org/modules/store#remove#1": { - "name": "remove", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#remove#1", - "params": [ - "$key as xs:string" - ], - "type": "empty-sequence()", - "description": " Removes an entry with the given $key from the store. No error will be raised if an addressed entry does not exist." - }, - "http://basex.org/modules/store#keys#0": { - "name": "keys", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#keys#0", - "params": [], - "type": "xs:string*", - "description": " Lists the names of all keys." - }, - "http://basex.org/modules/store#clear#0": { - "name": "clear", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#clear#0", - "params": [], - "type": "empty-sequence()", - "description": " Resets the store by removing all its entries." - }, - "http://basex.org/modules/store#read#0": { - "name": "read", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#read#0", - "params": [], - "type": "empty-sequence()", - "description": " Retrieves the standard store from disk, or a custom store if a $name is supplied." - }, - "http://basex.org/modules/store#read#1": { - "name": "read", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#read#1", - "params": [ - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Retrieves the standard store from disk, or a custom store if a $name is supplied." - }, - "http://basex.org/modules/store#write#0": { - "name": "write", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#write#0", - "params": [], - "type": "empty-sequence()", - "description": " Writes the standard store to disk, or to a custom store file if a $name is supplied. If the standard store is empty, the store file will be deleted." - }, - "http://basex.org/modules/store#write#1": { - "name": "write", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#write#1", - "params": [ - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Writes the standard store to disk, or to a custom store file if a $name is supplied. If the standard store is empty, the store file will be deleted." - }, - "http://basex.org/modules/store#list#0": { - "name": "list", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#list#0", - "params": [], - "type": "xs:string*", - "description": " Lists the names of all custom stores." - }, - "http://basex.org/modules/store#delete#1": { - "name": "delete", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#delete#1", - "params": [ - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Deletes a custom store from disk." - } - }, - "description": " This XQuery Module provides functions to organize values in a persistent main-memory key-value store.", - "type": "module", - "override": true - }, - "http://basex.org/modules/string": { - "ns": "http://basex.org/modules/string", - "prefixes": [ - "string" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/string#levenshtein#2": { - "name": "levenshtein", - "uri": "http://basex.org/modules/string", - "key": "http://basex.org/modules/string#levenshtein#2", - "params": [ - "$string1 as xs:string", - "$string2 as xs:string" - ], - "type": "xs:double", - "description": " Computes the Damerau-Levenshtein Distance for two strings and returns a double value (0.0 - 1.0). The returned value is computed as follows:
  • 1.0 – distance / max(length of strings)
  • 1.0 is returned if the strings are equal; 0.0 is returned if the strings are too different.
" - }, - "http://basex.org/modules/string#soundex#1": { - "name": "soundex", - "uri": "http://basex.org/modules/string", - "key": "http://basex.org/modules/string#soundex#1", - "params": [ - "$string as xs:string" - ], - "type": "xs:string", - "description": " Computes the Soundex value for the specified string. The algorithm can be used to find and index English words with similar pronouncation." - }, - "http://basex.org/modules/string#cologne-phonetic#1": { - "name": "cologne-phonetic", - "uri": "http://basex.org/modules/string", - "key": "http://basex.org/modules/string#cologne-phonetic#1", - "params": [ - "$string as xs:string" - ], - "type": "xs:string", - "description": " Computes the Kölner Phonetik value for the specified string. Similar to Soundex, the algorithm is used to find similarly pronounced words, but for the German language. As the first returned digit can be 0, the value is returned as string." - }, - "http://basex.org/modules/string#format#2": { - "name": "format", - "uri": "http://basex.org/modules/string", - "key": "http://basex.org/modules/string#format#2", - "params": [ - "$format as xs:string", - "$items as item()" - ], - "type": "xs:string", - "description": " Returns a formatted string. The remaining arguments specified by $items are applied to the $format string, according to Java’s printf syntax." - }, - "http://basex.org/modules/string#cr#0": { - "name": "cr", - "uri": "http://basex.org/modules/string", - "key": "http://basex.org/modules/string#cr#0", - "params": [], - "type": "xs:string", - "description": " Returns a single carriage return character (&#13;)." - }, - "http://basex.org/modules/string#nl#0": { - "name": "nl", - "uri": "http://basex.org/modules/string", - "key": "http://basex.org/modules/string#nl#0", - "params": [], - "type": "xs:string", - "description": " Returns a single newline character (&#10;)." - }, - "http://basex.org/modules/string#tab#0": { - "name": "tab", - "uri": "http://basex.org/modules/string", - "key": "http://basex.org/modules/string#tab#0", - "params": [], - "type": "xs:string", - "description": " Returns a single tabulator character (&#9;)." - } - }, - "description": " Updated with Version 10: Renamed from Strings Module to String Module. The namespace URI has been updated as well.", - "type": "module", - "override": true - }, - "http://basex.org/modules/unit": { - "ns": "http://basex.org/modules/unit", - "prefixes": [ - "unit" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/unit#assert#1": { - "name": "assert", - "uri": "http://basex.org/modules/unit", - "key": "http://basex.org/modules/unit#assert#1", - "params": [ - "$test as item()*" - ], - "type": "empty-sequence()", - "description": " Asserts that the effective boolean value of the specified $test is true and returns an empty sequence. Otherwise, raises an error. The effective boolean value of an expression can be explicitly computed by using the fn:boolean function.
The default failure message can be overridden with the $info argument." - }, - "http://basex.org/modules/unit#assert#2": { - "name": "assert", - "uri": "http://basex.org/modules/unit", - "key": "http://basex.org/modules/unit#assert#2", - "params": [ - "$test as item()*", - "$info as item()" - ], - "type": "empty-sequence()", - "description": " Asserts that the effective boolean value of the specified $test is true and returns an empty sequence. Otherwise, raises an error. The effective boolean value of an expression can be explicitly computed by using the fn:boolean function.
The default failure message can be overridden with the $info argument." - }, - "http://basex.org/modules/unit#assert-equals#2": { - "name": "assert-equals", - "uri": "http://basex.org/modules/unit", - "key": "http://basex.org/modules/unit#assert-equals#2", - "params": [ - "$returned as item()*", - "$expected as item()*" - ], - "type": "empty-sequence()", - "description": " Asserts that the specified arguments are equal according to the rules of the fn:deep-equal function. Otherwise, raises an error.
The default failure message can be overridden with the $info argument." - }, - "http://basex.org/modules/unit#assert-equals#3": { - "name": "assert-equals", - "uri": "http://basex.org/modules/unit", - "key": "http://basex.org/modules/unit#assert-equals#3", - "params": [ - "$returned as item()*", - "$expected as item()*", - "$info as item()" - ], - "type": "empty-sequence()", - "description": " Asserts that the specified arguments are equal according to the rules of the fn:deep-equal function. Otherwise, raises an error.
The default failure message can be overridden with the $info argument." - }, - "http://basex.org/modules/unit#fail#0": { - "name": "fail", - "uri": "http://basex.org/modules/unit", - "key": "http://basex.org/modules/unit#fail#0", - "params": [], - "type": "empty-sequence()", - "description": " Raises a unit error. The default failure message can be overridden with the $info argument." - }, - "http://basex.org/modules/unit#fail#1": { - "name": "fail", - "uri": "http://basex.org/modules/unit", - "key": "http://basex.org/modules/unit#fail#1", - "params": [ - "$info as item()" - ], - "type": "empty-sequence()", - "description": " Raises a unit error. The default failure message can be overridden with the $info argument." - } - }, - "description": " This XQuery Module contains annotations and functions for performing XQUnit tests.", - "type": "module", - "override": true - }, - "http://basex.org/modules/update": { - "ns": "http://basex.org/modules/update", - "prefixes": [ - "update" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/update#apply#2": { - "name": "apply", - "uri": "http://basex.org/modules/update", - "key": "http://basex.org/modules/update#apply#2", - "params": [ - "$function as function(*)", - "$arguments as array(*)" - ], - "type": "empty-sequence()", - "description": " The updating variant of fn:apply applies the specified updating $function to the specified $arguments." - }, - "http://basex.org/modules/update#for-each#2": { - "name": "for-each", - "uri": "http://basex.org/modules/update", - "key": "http://basex.org/modules/update#for-each#2", - "params": [ - "$seq as item()*", - "$function as function(item()) as item()*" - ], - "type": "empty-sequence()", - "description": " The updating variant of fn:for-each applies the specified updating $function to every item of $seq." - }, - "http://basex.org/modules/update#for-each-pair#2": { - "name": "for-each-pair", - "uri": "http://basex.org/modules/update", - "key": "http://basex.org/modules/update#for-each-pair#2", - "params": [ - "$seq1 as item()*", - "$function as function(item()) as item()*" - ], - "type": "empty-sequence()", - "description": " The updating variant of fn:for-each-pair applies the specified updating $function to the successive pairs of items of $seq1 and $seq2. Evaluation is stopped if one sequence yields no more items." - }, - "http://basex.org/modules/update#map-for-each#2": { - "name": "map-for-each", - "uri": "http://basex.org/modules/update", - "key": "http://basex.org/modules/update#map-for-each#2", - "params": [ - "$map as map(*)", - "$function as function(xs:anyAtomicType, item()*) as item()*" - ], - "type": "item()*", - "description": " The updating variant of map:for-each applies the specified $function to every key/value pair of the supplied $map and returns the results as a sequence." - }, - "http://basex.org/modules/update#output#1": { - "name": "output", - "uri": "http://basex.org/modules/update", - "key": "http://basex.org/modules/update#output#1", - "params": [ - "$items as item()*" - ], - "type": "empty-sequence()", - "description": " This function can be used if MIXUPDATES is not enabled, and if values need to returned within an updating expression: The supplied $items will be cached and returned at the very end, i.e., after all updates on the pending update list have been processed. If one of the supplied items is affected by an update, a copy will be created and cached instead." - }, - "http://basex.org/modules/update#cache#0": { - "name": "cache", - "uri": "http://basex.org/modules/update", - "key": "http://basex.org/modules/update#cache#0", - "params": [], - "type": "item()*", - "description": " Returns the items that have been cached by update:output . The output cache can optionally be $reset. The function can be used to check which items will eventually be returned as result of an updating function.
This function is non-deterministic: It will return different results before and after items have been cached. It is e. g. useful when writing unit tests." - }, - "http://basex.org/modules/update#cache#1": { - "name": "cache", - "uri": "http://basex.org/modules/update", - "key": "http://basex.org/modules/update#cache#1", - "params": [ - "$reset as xs:boolean" - ], - "type": "item()*", - "description": " Returns the items that have been cached by update:output . The output cache can optionally be $reset. The function can be used to check which items will eventually be returned as result of an updating function.
This function is non-deterministic: It will return different results before and after items have been cached. It is e. g. useful when writing unit tests." - } - }, - "description": " This XQuery Module provides additional functions for performing updates and returning results in updating expressions.", - "type": "module", - "override": true - }, - "http://basex.org/modules/user": { - "ns": "http://basex.org/modules/user", - "prefixes": [ - "user" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/user#current#0": { - "name": "current", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#current#0", - "params": [], - "type": "xs:string", - "description": " Returns the name of the currently logged in user." - }, - "http://basex.org/modules/user#list#0": { - "name": "list", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#list#0", - "params": [], - "type": "xs:string*", - "description": " Returns the names of all registered users that are visible to the current user." - }, - "http://basex.org/modules/user#list-details#0": { - "name": "list-details", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#list-details#0", - "params": [], - "type": "element(user)*", - "description": " Returns an element sequence, containing all registered users that are visible to the current user.
In addition to the SHOW USERS command, encoded password strings and database permissions will be output. A user $name can be specified to filter the results in advance." - }, - "http://basex.org/modules/user#list-details#1": { - "name": "list-details", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#list-details#1", - "params": [ - "$name as xs:string" - ], - "type": "element(user)*", - "description": " Returns an element sequence, containing all registered users that are visible to the current user.
In addition to the SHOW USERS command, encoded password strings and database permissions will be output. A user $name can be specified to filter the results in advance." - }, - "http://basex.org/modules/user#exists#1": { - "name": "exists", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#exists#1", - "params": [ - "$name as xs:string" - ], - "type": "xs:boolean", - "description": " Checks if a user with the specified $name exists." - }, - "http://basex.org/modules/user#check#2": { - "name": "check", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#check#2", - "params": [ - "$name as xs:string", - "$password as xs:string" - ], - "type": "empty-sequence()", - "description": " Checks if the specified user and password is correct. Raises errors otherwise." - }, - "http://basex.org/modules/user#info#0": { - "name": "info", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#info#0", - "params": [], - "type": "element(info)", - "description": " Returns an info element, which may contain application-specific data. If a user $name is supplied, a user-specific element is returned. By default, the returned element has no contents. It can be modified via user:update-info ." - }, - "http://basex.org/modules/user#info#1": { - "name": "info", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#info#1", - "params": [ - "$name as xs:string" - ], - "type": "element(info)", - "description": " Returns an info element, which may contain application-specific data. If a user $name is supplied, a user-specific element is returned. By default, the returned element has no contents. It can be modified via user:update-info ." - }, - "http://basex.org/modules/user#create#2": { - "name": "create", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#create#2", - "params": [ - "$name as xs:string", - "$password as xs:string" - ], - "type": "empty-sequence()", - "description": " Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
" - }, - "http://basex.org/modules/user#create#3": { - "name": "create", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#create#3", - "params": [ - "$name as xs:string", - "$password as xs:string", - "$permissions as xs:string*" - ], - "type": "empty-sequence()", - "description": " Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
" - }, - "http://basex.org/modules/user#create#4": { - "name": "create", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#create#4", - "params": [ - "$name as xs:string", - "$password as xs:string", - "$permissions as xs:string*", - "$patterns as xs:string*" - ], - "type": "empty-sequence()", - "description": " Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
" - }, - "http://basex.org/modules/user#create#5": { - "name": "create", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#create#5", - "params": [ - "$name as xs:string", - "$password as xs:string", - "$permissions as xs:string*", - "$patterns as xs:string*", - "$info as element(info)" - ], - "type": "empty-sequence()", - "description": " Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
" - }, - "http://basex.org/modules/user#grant#2": { - "name": "grant", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#grant#2", - "params": [ - "$name as xs:string", - "$permissions as xs:string*" - ], - "type": "empty-sequence()", - "description": " Grants global or local $permissions to a user with the specified $name. Local permissions are granted with non-empty glob $patterns." - }, - "http://basex.org/modules/user#grant#3": { - "name": "grant", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#grant#3", - "params": [ - "$name as xs:string", - "$permissions as xs:string*", - "$patterns as xs:string*" - ], - "type": "empty-sequence()", - "description": " Grants global or local $permissions to a user with the specified $name. Local permissions are granted with non-empty glob $patterns." - }, - "http://basex.org/modules/user#drop#1": { - "name": "drop", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#drop#1", - "params": [ - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Drops a user with the specified $name. If non-empty glob $patterns are specified, only the database patterns will be removed." - }, - "http://basex.org/modules/user#drop#2": { - "name": "drop", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#drop#2", - "params": [ - "$name as xs:string", - "$patterns as xs:string*" - ], - "type": "empty-sequence()", - "description": " Drops a user with the specified $name. If non-empty glob $patterns are specified, only the database patterns will be removed." - }, - "http://basex.org/modules/user#alter#2": { - "name": "alter", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#alter#2", - "params": [ - "$name as xs:string", - "$newname as xs:string" - ], - "type": "empty-sequence()", - "description": " Renames a user with the specified $name to $newname." - }, - "http://basex.org/modules/user#password#2": { - "name": "password", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#password#2", - "params": [ - "$name as xs:string", - "$password as xs:string" - ], - "type": "empty-sequence()", - "description": " Changes the password of a user with the specified $name." - }, - "http://basex.org/modules/user#update-info#1": { - "name": "update-info", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#update-info#1", - "params": [ - "$info as element(info)" - ], - "type": "empty-sequence()", - "description": " Assigns the specified $info element to the user management or, if $name is supplied, to a specific user. This function can be used to manage application-specific data (groups, enhanced user info, etc.)." - }, - "http://basex.org/modules/user#update-info#2": { - "name": "update-info", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#update-info#2", - "params": [ - "$info as element(info)", - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Assigns the specified $info element to the user management or, if $name is supplied, to a specific user. This function can be used to manage application-specific data (groups, enhanced user info, etc.)." - } - }, - "description": " This XQuery Module contains functions for creating and administering database users. The User Management article gives more information on database users and permissions.", - "type": "module", - "override": true - }, - "http://basex.org/modules/util": { - "ns": "http://basex.org/modules/util", - "prefixes": [ - "util" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/util#if#2": { - "name": "if", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#if#2", - "params": [ - "$condition as item()*", - "$then as item()*" - ], - "type": "item()*", - "description": " Alternative writing for the if/then/else expression:
  • If the effective boolean value of $condition is true, the $then branch will be evaluated.
  • Otherwise, $else will be evaluated. If no third argument is supplied, an empty sequence will be returned.
" - }, - "http://basex.org/modules/util#if#3": { - "name": "if", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#if#3", - "params": [ - "$condition as item()*", - "$then as item()*", - "$else as item()*" - ], - "type": "item()*", - "description": " Alternative writing for the if/then/else expression:
  • If the effective boolean value of $condition is true, the $then branch will be evaluated.
  • Otherwise, $else will be evaluated. If no third argument is supplied, an empty sequence will be returned.
" - }, - "http://basex.org/modules/util#or#2": { - "name": "or", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#or#2", - "params": [ - "$items as item()*", - "$default as item()*" - ], - "type": "item()*", - "description": " Returns $items if it is a non-empty sequence. Otherwise, returns $default. Equivalent to the following expressions:
  if ( exists ( $ items )) then $ items else $ default , (: Elvis operator :) $ items ?: $ default 
" - }, - "http://basex.org/modules/util#count-within#2": { - "name": "count-within", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#count-within#2", - "params": [ - "$sequence as item()*", - "$min as xs:integer" - ], - "type": "xs:boolean", - "description": " Checks if the specified $sequence has at least $min and, optionally, at most $max items. Equivalent to:
  let $ count := count ( $ sequence ) return $ count >= $ min and $ count <= $ max 
" - }, - "http://basex.org/modules/util#count-within#3": { - "name": "count-within", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#count-within#3", - "params": [ - "$sequence as item()*", - "$min as xs:integer", - "$max as xs:integer" - ], - "type": "xs:boolean", - "description": " Checks if the specified $sequence has at least $min and, optionally, at most $max items. Equivalent to:
  let $ count := count ( $ sequence ) return $ count >= $ min and $ count <= $ max 
" - }, - "http://basex.org/modules/util#item#2": { - "name": "item", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#item#2", - "params": [ - "$sequence as item()*", - "$position as xs:double" - ], - "type": "item()?", - "description": " Returns the item from $sequence at the specified $position. Equivalent to:
  $ sequence [ $ position ] 
" - }, - "http://basex.org/modules/util#range#3": { - "name": "range", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#range#3", - "params": [ - "$sequence as item()*", - "$first as xs:double", - "$last as xs:double" - ], - "type": "item()*", - "description": " Returns items from $sequence, starting at position $first and ending at $last. Equivalent to:
  subsequence ( $ sequence , $ first , $ last - $ first + 1 ) 
" - }, - "http://basex.org/modules/util#last#1": { - "name": "last", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#last#1", - "params": [ - "$sequence as item()*" - ], - "type": "item()?", - "description": " Returns last item of a $sequence. Equivalent to:
  $ sequence [ last ()] 
" - }, - "http://basex.org/modules/util#init#1": { - "name": "init", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#init#1", - "params": [ - "$sequence as item()*" - ], - "type": "item()*", - "description": " Returns all items of a $sequence except for the last one. Equivalent to:
  $ sequence [ position () < last ()] 
" - }, - "http://basex.org/modules/util#ddo#1": { - "name": "ddo", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#ddo#1", - "params": [ - "$nodes as node()*" - ], - "type": "node()*", - "description": " Returns nodes in distinct document order: duplicate nodes will be removed, and the remaining nodes will be returned in document order. As results of path expressions are brought distinct document order before they are returned, the function is equivalent to:
  $ nodes / self :: node () 
" - }, - "http://basex.org/modules/util#root#1": { - "name": "root", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#root#1", - "params": [ - "$nodes as node()*" - ], - "type": "document-node()*", - "description": " Returns the document nodes of the specified $nodes. The path expression /abc is internally represented as util:root(.)/abc. Equivalent to:
  $ nodes ! / 
" - }, - "http://basex.org/modules/util#strip-namespaces#1": { - "name": "strip-namespaces", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#strip-namespaces#1", - "params": [ - "$node as node()" - ], - "type": "node()", - "description": " Removes namespaces with the specified $prefixes from the supplied $node. An empty string can be supplied to remove the default namespace. If no prefixes are specified, all namespaces will be removed." - }, - "http://basex.org/modules/util#strip-namespaces#2": { - "name": "strip-namespaces", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#strip-namespaces#2", - "params": [ - "$node as node()", - "$prefixes as xs:string*" - ], - "type": "node()", - "description": " Removes namespaces with the specified $prefixes from the supplied $node. An empty string can be supplied to remove the default namespace. If no prefixes are specified, all namespaces will be removed." - }, - "http://basex.org/modules/util#array-members#1": { - "name": "array-members", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#array-members#1", - "params": [ - "$array as array(*)" - ], - "type": "array(*)*", - "description": " Returns each member of an $array as a new array. Equivalent to:
  for $ a in 1 to array:size ( $ array ) return [ $ array ( $ a ) ] 
" - }, - "http://basex.org/modules/util#array-values#1": { - "name": "array-values", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#array-values#1", - "params": [ - "$array as array(*)" - ], - "type": "item()*", - "description": " Returns all members of an $array as a sequence. Equivalent to:
  $ array ? * 
" - }, - "http://basex.org/modules/util#map-entries#1": { - "name": "map-entries", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#map-entries#1", - "params": [ - "$map as map(*)" - ], - "type": "map(xs:string, item()*)*", - "description": " Returns each entry of a $map as a new map, each with a key and value entry. Equivalent to:
  map:for-each ( $ map , function ( $ key , $ value ) { map { \"key\" : $ key , \"value\" : $ value } }) 
" - }, - "http://basex.org/modules/util#map-values#1": { - "name": "map-values", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#map-values#1", - "params": [ - "$map as map(*)" - ], - "type": "item()*", - "description": " Returns all values of a $map as a sequence. Equivalent to:
  $ map ? * 
" - }, - "http://basex.org/modules/util#replicate#2": { - "name": "replicate", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#replicate#2", - "params": [ - "$input as item()*", - "$count as xs:integer" - ], - "type": "item()*", - "description": " Evaluates $input and returns the result $count times. Unless $multiple is enabled, the input expression is only evaluated once. Equivalent expressions:
  util:replicate ( $ input , $ count , true ()), ( 1 to $ count ) ! $ input 
" - }, - "http://basex.org/modules/util#replicate#3": { - "name": "replicate", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#replicate#3", - "params": [ - "$input as item()*", - "$count as xs:integer", - "$multiple as xs:boolean" - ], - "type": "item()*", - "description": " Evaluates $input and returns the result $count times. Unless $multiple is enabled, the input expression is only evaluated once. Equivalent expressions:
  util:replicate ( $ input , $ count , true ()), ( 1 to $ count ) ! $ input 
" - }, - "http://basex.org/modules/util#intersperse#2": { - "name": "intersperse", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#intersperse#2", - "params": [ - "$items as item()*", - "$separator as item()*" - ], - "type": "item()*", - "description": " Inserts the defined $separator between the $items of a sequence and returns the resulting sequence. Equivalent to:
  head ( $ items ), for $ item in tail ( $ items ) return ( $ separator , $ item ) 
" - }, - "http://basex.org/modules/util#duplicates#1": { - "name": "duplicates", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#duplicates#1", - "params": [ - "$sequence as item()*" - ], - "type": "xs:anyAtomicType*", - "description": " Returns duplicate values in a $sequence. See fn:distinct-values for the applied equality rules and the usage of the $collation argument." - }, - "http://basex.org/modules/util#duplicates#2": { - "name": "duplicates", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#duplicates#2", - "params": [ - "$sequence as item()*", - "$collation as xs:string" - ], - "type": "xs:anyAtomicType*", - "description": " Returns duplicate values in a $sequence. See fn:distinct-values for the applied equality rules and the usage of the $collation argument." - }, - "http://basex.org/modules/util#chars#1": { - "name": "chars", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#chars#1", - "params": [ - "$string as xs:string?" - ], - "type": "xs:string*", - "description": " Returns all characters of a $string as a sequence. Equivalent to:
  for $ cp in string-to-codepoints ( $ string ) return codepoints-to-string ( $ cp ) 
" - } - }, - "description": " This XQuery Module contains various utility and helper functions.", - "type": "module", - "override": true - }, - "http://basex.org/modules/validate": { - "ns": "http://basex.org/modules/validate", - "prefixes": [ - "validate" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/validate#dtd#1": { - "name": "dtd", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#dtd#1", - "params": [ - "$input as item()" - ], - "type": "empty-sequence()", - "description": " Validates the XML $input document against a $schema and returns an empty sequence or an error." - }, - "http://basex.org/modules/validate#dtd#2": { - "name": "dtd", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#dtd#2", - "params": [ - "$input as item()", - "$schema as xs:string?" - ], - "type": "empty-sequence()", - "description": " Validates the XML $input document against a $schema and returns an empty sequence or an error." - }, - "http://basex.org/modules/validate#dtd-info#1": { - "name": "dtd-info", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#dtd-info#1", - "params": [ - "$input as item()" - ], - "type": "xs:string*", - "description": " Validates the XML $input document against a $schema and returns warnings, errors and fatal errors in a string sequence." - }, - "http://basex.org/modules/validate#dtd-info#2": { - "name": "dtd-info", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#dtd-info#2", - "params": [ - "$input as item()", - "$schema as xs:string?" - ], - "type": "xs:string*", - "description": " Validates the XML $input document against a $schema and returns warnings, errors and fatal errors in a string sequence." - }, - "http://basex.org/modules/validate#dtd-report#1": { - "name": "dtd-report", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#dtd-report#1", - "params": [ - "$input as item()" - ], - "type": "element(report)", - "description": " Validates the XML $input document against a $schema and returns warnings, errors and fatal errors as XML." - }, - "http://basex.org/modules/validate#dtd-report#2": { - "name": "dtd-report", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#dtd-report#2", - "params": [ - "$input as item()", - "$schema as xs:string?" - ], - "type": "element(report)", - "description": " Validates the XML $input document against a $schema and returns warnings, errors and fatal errors as XML." - }, - "http://basex.org/modules/validate#xsd#1": { - "name": "xsd", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd#1", - "params": [ - "$input as item()" - ], - "type": "empty-sequence()", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features." - }, - "http://basex.org/modules/validate#xsd#2": { - "name": "xsd", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd#2", - "params": [ - "$input as item()", - "$schema as item()?" - ], - "type": "empty-sequence()", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features." - }, - "http://basex.org/modules/validate#xsd#3": { - "name": "xsd", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd#3", - "params": [ - "$input as item()", - "$schema as item()?", - "$features as map(*)" - ], - "type": "empty-sequence()", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features." - }, - "http://basex.org/modules/validate#xsd-info#1": { - "name": "xsd-info", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-info#1", - "params": [ - "$input as item()" - ], - "type": "xs:string*", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors in a string sequence." - }, - "http://basex.org/modules/validate#xsd-info#2": { - "name": "xsd-info", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-info#2", - "params": [ - "$input as item()", - "$schema as item()?" - ], - "type": "xs:string*", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors in a string sequence." - }, - "http://basex.org/modules/validate#xsd-info#3": { - "name": "xsd-info", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-info#3", - "params": [ - "$input as item()", - "$schema as item()?", - "$features as map(*)" - ], - "type": "xs:string*", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors in a string sequence." - }, - "http://basex.org/modules/validate#xsd-report#1": { - "name": "xsd-report", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-report#1", - "params": [ - "$input as item()" - ], - "type": "element(report)", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors as XML." - }, - "http://basex.org/modules/validate#xsd-report#2": { - "name": "xsd-report", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-report#2", - "params": [ - "$input as item()", - "$schema as xs:string?" - ], - "type": "element(report)", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors as XML." - }, - "http://basex.org/modules/validate#xsd-report#3": { - "name": "xsd-report", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-report#3", - "params": [ - "$input as item()", - "$schema as xs:string?", - "$features as map(*)" - ], - "type": "element(report)", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors as XML." - }, - "http://basex.org/modules/validate#xsd-processor#0": { - "name": "xsd-processor", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-processor#0", - "params": [], - "type": "xs:string", - "description": " Returns the name of the applied XSD processor." - }, - "http://basex.org/modules/validate#xsd-version#0": { - "name": "xsd-version", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-version#0", - "params": [], - "type": "xs:string", - "description": " Returns the supported version of XSD Schema." - }, - "http://basex.org/modules/validate#rng#2": { - "name": "rng", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#rng#2", - "params": [ - "$input as item()", - "$schema as item()" - ], - "type": "empty-sequence()", - "description": " Validates the XML $input document against a $schema, using the XML or $compact notation." - }, - "http://basex.org/modules/validate#rng#3": { - "name": "rng", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#rng#3", - "params": [ - "$input as item()", - "$schema as item()", - "$compact as xs:boolean" - ], - "type": "empty-sequence()", - "description": " Validates the XML $input document against a $schema, using the XML or $compact notation." - }, - "http://basex.org/modules/validate#rng-info#2": { - "name": "rng-info", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#rng-info#2", - "params": [ - "$input as item()", - "$schema as item()" - ], - "type": "xs:string*", - "description": " Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors in a string sequence." - }, - "http://basex.org/modules/validate#rng-info#3": { - "name": "rng-info", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#rng-info#3", - "params": [ - "$input as item()", - "$schema as item()", - "$compact as xs:boolean" - ], - "type": "xs:string*", - "description": " Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors in a string sequence." - }, - "http://basex.org/modules/validate#rng-report#2": { - "name": "rng-report", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#rng-report#2", - "params": [ - "$input as item()", - "$schema as xs:string" - ], - "type": "element(report)", - "description": " Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors as XML." - }, - "http://basex.org/modules/validate#rng-report#3": { - "name": "rng-report", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#rng-report#3", - "params": [ - "$input as item()", - "$schema as xs:string", - "$compact as xs:boolean" - ], - "type": "element(report)", - "description": " Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors as XML." - } - }, - "description": " This XQuery Module contains functions to perform validations against DTDs, XML Schema and RelaxNG. The documentation further describes how to use Schematron validation with BaseX.", - "type": "module", - "override": true - }, - "http://basex.org/modules/web": { - "ns": "http://basex.org/modules/web", - "prefixes": [ - "web" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/web#content-type#1": { - "name": "content-type", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#content-type#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string", - "description": " Returns the content type of a path by analyzing its file suffix. application/octet-stream is returned if the file suffix is unknown." - }, - "http://basex.org/modules/web#create-url#2": { - "name": "create-url", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#create-url#2", - "params": [ - "$url as xs:string", - "$parameters as map(*)" - ], - "type": "xs:string", - "description": " Creates a new URL from the specified $url string, query string $parameters and an optional $anchor reference. The keys and values of the map entries will be converted to strings, URL-encoded (see web:encode-url ), and appended to the URL as query parameters. If a map entry has more than a single item, all of them will be appended as single parameters." - }, - "http://basex.org/modules/web#create-url#3": { - "name": "create-url", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#create-url#3", - "params": [ - "$url as xs:string", - "$parameters as map(*)", - "$anchor as xs:string" - ], - "type": "xs:string", - "description": " Creates a new URL from the specified $url string, query string $parameters and an optional $anchor reference. The keys and values of the map entries will be converted to strings, URL-encoded (see web:encode-url ), and appended to the URL as query parameters. If a map entry has more than a single item, all of them will be appended as single parameters." - }, - "http://basex.org/modules/web#encode-url#1": { - "name": "encode-url", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#encode-url#1", - "params": [ - "$string as xs:string" - ], - "type": "xs:string", - "description": " Encodes a string to a URL. Spaces are rewritten to +; *, -, . and _ are adopted; and all other non-ASCII characters and special characters are percent-encoded." - }, - "http://basex.org/modules/web#decode-url#1": { - "name": "decode-url", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#decode-url#1", - "params": [ - "$string as xs:string" - ], - "type": "xs:string", - "description": " Decodes a URL to the original string. Percent-encoded characters are decoded to their UTF8 codepoints, and + characters are rewritten to spaces." - }, - "http://basex.org/modules/web#forward#1": { - "name": "forward", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#forward#1", - "params": [ - "$path as xs:string" - ], - "type": "element(rest:forward)", - "description": " Creates a server-side RESTXQ forward request to the specified $path:
  • The client will not get notified of this forwarding.
  • Supplied query parameters will be attached to parameters of the current request.
  • The $parameter argument is processed as described in web:create-url .
" - }, - "http://basex.org/modules/web#forward#2": { - "name": "forward", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#forward#2", - "params": [ - "$path as xs:string", - "$parameters as map(*)" - ], - "type": "element(rest:forward)", - "description": " Creates a server-side RESTXQ forward request to the specified $path:
  • The client will not get notified of this forwarding.
  • Supplied query parameters will be attached to parameters of the current request.
  • The $parameter argument is processed as described in web:create-url .
" - }, - "http://basex.org/modules/web#redirect#1": { - "name": "redirect", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#redirect#1", - "params": [ - "$url as xs:string" - ], - "type": "element(rest:response)", - "description": " Creates a RESTXQ redirection to the specified $url. The returned response will only work if no other items are returned by the RESTXQ function.
The $parameters and $anchor arguments are processed as described in (see web:create-url )." - }, - "http://basex.org/modules/web#redirect#2": { - "name": "redirect", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#redirect#2", - "params": [ - "$url as xs:string", - "$parameters as map(*)" - ], - "type": "element(rest:response)", - "description": " Creates a RESTXQ redirection to the specified $url. The returned response will only work if no other items are returned by the RESTXQ function.
The $parameters and $anchor arguments are processed as described in (see web:create-url )." - }, - "http://basex.org/modules/web#redirect#3": { - "name": "redirect", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#redirect#3", - "params": [ - "$url as xs:string", - "$parameters as map(*)", - "$anchor as xs:string" - ], - "type": "element(rest:response)", - "description": " Creates a RESTXQ redirection to the specified $url. The returned response will only work if no other items are returned by the RESTXQ function.
The $parameters and $anchor arguments are processed as described in (see web:create-url )." - }, - "http://basex.org/modules/web#response-header#0": { - "name": "response-header", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#response-header#0", - "params": [], - "type": "element(rest:response)", - "description": " Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
" - }, - "http://basex.org/modules/web#response-header#1": { - "name": "response-header", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#response-header#1", - "params": [ - "$output as map(*)?" - ], - "type": "element(rest:response)", - "description": " Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
" - }, - "http://basex.org/modules/web#response-header#2": { - "name": "response-header", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#response-header#2", - "params": [ - "$output as map(*)?", - "$headers as map(*)?" - ], - "type": "element(rest:response)", - "description": " Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
" - }, - "http://basex.org/modules/web#response-header#3": { - "name": "response-header", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#response-header#3", - "params": [ - "$output as map(*)?", - "$headers as map(*)?", - "$atts as map(*)?" - ], - "type": "element(rest:response)", - "description": " Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
" - }, - "http://basex.org/modules/web#error#2": { - "name": "error", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#error#2", - "params": [ - "$status as xs:integer", - "$message as xs:string" - ], - "type": "none", - "description": " Raises an error with the QName rest:error, the specified $message and the specified $status as error value.
Calls to this function are equivalent to fn:error(xs:QName('rest:error'), $message, $status).

See RESTXQ: Raise Errors to learn how the function is helpful in web applications.

" - } - }, - "description": " This XQuery Module provides convenience functions for building web applications with RESTXQ.", - "type": "module", - "override": true - }, - "http://basex.org/modules/ws": { - "ns": "http://basex.org/modules/ws", - "prefixes": [ - "ws" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/ws#id#0": { - "name": "id", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#id#0", - "params": [], - "type": "xs:string", - "description": " Returns the ID of the current WebSocket." - }, - "http://basex.org/modules/ws#ids#0": { - "name": "ids", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#ids#0", - "params": [], - "type": "xs:string*", - "description": " Returns the ids of all currently registered WebSockets." - }, - "http://basex.org/modules/ws#path#1": { - "name": "path", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#path#1", - "params": [ - "$id as xs:string" - ], - "type": "xs:string", - "description": " Returns the path of the WebSocket with the specified $id." - }, - "http://basex.org/modules/ws#close#1": { - "name": "close", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#close#1", - "params": [ - "$id as xs:string" - ], - "type": "empty-sequence()", - "description": " Closes the connection of the WebSocket with the specified $id." - }, - "http://basex.org/modules/ws#send#2": { - "name": "send", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#send#2", - "params": [ - "$message as item()", - "$ids as xs:string*" - ], - "type": "empty-sequence()", - "description": " Sends a $message to the clients with the specified $ids. Ids that cannot be assigned to clients will be ignored. The message will be handled as follows:
  • Items of type xs:base64Binary and xs:hexBinary will be transmitted as binary messages.
  • Function items (maps, arrays) will be serialized as JSON and transmitted as string messages.
  • All other items will be serialized with the default serialization options and transmitted as string messages.
" - }, - "http://basex.org/modules/ws#broadcast#1": { - "name": "broadcast", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#broadcast#1", - "params": [ - "$message as xs:anyAtomicType" - ], - "type": "empty-sequence()", - "description": " Broadcasts a $message to all connected clients except to the caller. Invocations of this convenience function are equivalent to ws:send($message, ws:ids()[. != ws:id()]). See ws:send for more details on the message handling." - }, - "http://basex.org/modules/ws#emit#1": { - "name": "emit", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#emit#1", - "params": [ - "$message as xs:anyAtomicType" - ], - "type": "empty-sequence()", - "description": " Emits a $message to all connected clients. Invocations of this function are equivalent to ws:send($message, ws:ids()). See ws:send for more details on the message handling." - }, - "http://basex.org/modules/ws#eval#1": { - "name": "eval", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#eval#1", - "params": [ - "$query as xs:anyAtomicType" - ], - "type": "xs:string", - "description": " Schedules the evaluation of the supplied $query and returns the result to the calling WebSocket client. The query can be a URI or a string, and variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.

Query scheduling is recommendable if the immediate query execution might be too time consuming and lead to a timeout.

" - }, - "http://basex.org/modules/ws#eval#2": { - "name": "eval", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#eval#2", - "params": [ - "$query as xs:anyAtomicType", - "$bindings as map(*)?" - ], - "type": "xs:string", - "description": " Schedules the evaluation of the supplied $query and returns the result to the calling WebSocket client. The query can be a URI or a string, and variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.

Query scheduling is recommendable if the immediate query execution might be too time consuming and lead to a timeout.

" - }, - "http://basex.org/modules/ws#eval#3": { - "name": "eval", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#eval#3", - "params": [ - "$query as xs:anyAtomicType", - "$bindings as map(*)?", - "$options as map(*)?" - ], - "type": "xs:string", - "description": " Schedules the evaluation of the supplied $query and returns the result to the calling WebSocket client. The query can be a URI or a string, and variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.

Query scheduling is recommendable if the immediate query execution might be too time consuming and lead to a timeout.

" - }, - "http://basex.org/modules/ws#get#2": { - "name": "get", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#get#2", - "params": [ - "$id as xs:string", - "$name as xs:string" - ], - "type": "item()*", - "description": " Returns the value of an attribute with the specified $name from the WebSocket with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead." - }, - "http://basex.org/modules/ws#get#3": { - "name": "get", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#get#3", - "params": [ - "$id as xs:string", - "$name as xs:string", - "$default as item()*" - ], - "type": "item()*", - "description": " Returns the value of an attribute with the specified $name from the WebSocket with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead." - }, - "http://basex.org/modules/ws#set#3": { - "name": "set", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#set#3", - "params": [ - "$id as xs:string", - "$name as xs:string", - "$value as item()*" - ], - "type": "empty-sequence()", - "description": " Returns the specified value of the attribute with the specified $name from the WebSocket with the specified $id." - }, - "http://basex.org/modules/ws#delete#2": { - "name": "delete", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#delete#2", - "params": [ - "$id as xs:string", - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Deletes an attribute with the specified $name from the WebSocket with the specified $id." - } - }, - "description": " This XQuery Module contains functions for accessing specific WebSocket functions. This module is mainly useful in the context of WebSockets.", - "type": "module", - "override": true - }, - "http://basex.org/modules/xquery": { - "ns": "http://basex.org/modules/xquery", - "prefixes": [ - "xquery" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/xquery#eval#1": { - "name": "eval", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#eval#1", - "params": [ - "$query as xs:anyAtomicType" - ], - "type": "item()*", - "description": " Evaluates the supplied $query and returns the resulting items. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string.

Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:

  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. Overwrites the base URI of the query; will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
" - }, - "http://basex.org/modules/xquery#eval#2": { - "name": "eval", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#eval#2", - "params": [ - "$query as xs:anyAtomicType", - "$bindings as map(*)?" - ], - "type": "item()*", - "description": " Evaluates the supplied $query and returns the resulting items. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string.

Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:

  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. Overwrites the base URI of the query; will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
" - }, - "http://basex.org/modules/xquery#eval#3": { - "name": "eval", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#eval#3", - "params": [ - "$query as xs:anyAtomicType", - "$bindings as map(*)?", - "$options as map(*)?" - ], - "type": "item()*", - "description": " Evaluates the supplied $query and returns the resulting items. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string.

Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:

  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. Overwrites the base URI of the query; will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
" - }, - "http://basex.org/modules/xquery#eval-update#1": { - "name": "eval-update", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#eval-update#1", - "params": [ - "$query as xs:anyAtomicType" - ], - "type": "item()*", - "description": " Evaluates a query as updating expression. All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules for all arguments are the same as for xquery:eval ." - }, - "http://basex.org/modules/xquery#eval-update#2": { - "name": "eval-update", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#eval-update#2", - "params": [ - "$query as xs:anyAtomicType", - "$bindings as map(*)?" - ], - "type": "item()*", - "description": " Evaluates a query as updating expression. All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules for all arguments are the same as for xquery:eval ." - }, - "http://basex.org/modules/xquery#eval-update#3": { - "name": "eval-update", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#eval-update#3", - "params": [ - "$query as xs:anyAtomicType", - "$bindings as map(*)?", - "$options as map(*)?" - ], - "type": "item()*", - "description": " Evaluates a query as updating expression. All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules for all arguments are the same as for xquery:eval ." - }, - "http://basex.org/modules/xquery#parse#1": { - "name": "parse", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#parse#1", - "params": [ - "$query as xs:anyAtomicType" - ], - "type": "item()?", - "description": " Parses the specified $query as XQuery module and returns the resulting query plan. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string. The $options parameter influences the output:
  • compile: additionally compiles the query after parsing it. By default, this option is false.
  • plan: returns an XML representation of the internal query plan. By default, this option is true. The naming of the expressions in the query plan may change over time
  • pass: by default, the option is false. If an error is raised, the line/column number and the optional file uri will refer to the location of the function call. If the option is enabled, the line/column and file uri will be adopted from the raised error.
  • base-uri: set base-uri property for the query. This URI will be used when resolving relative URIs by functions such as fn:doc.
" - }, - "http://basex.org/modules/xquery#parse#2": { - "name": "parse", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#parse#2", - "params": [ - "$query as xs:anyAtomicType", - "$options as map(*)?" - ], - "type": "item()?", - "description": " Parses the specified $query as XQuery module and returns the resulting query plan. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string. The $options parameter influences the output:
  • compile: additionally compiles the query after parsing it. By default, this option is false.
  • plan: returns an XML representation of the internal query plan. By default, this option is true. The naming of the expressions in the query plan may change over time
  • pass: by default, the option is false. If an error is raised, the line/column number and the optional file uri will refer to the location of the function call. If the option is enabled, the line/column and file uri will be adopted from the raised error.
  • base-uri: set base-uri property for the query. This URI will be used when resolving relative URIs by functions such as fn:doc.
" - }, - "http://basex.org/modules/xquery#fork-join#1": { - "name": "fork-join", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#fork-join#1", - "params": [ - "$functions as function(*)*" - ], - "type": "item()*", - "description": " This function executes the supplied (non-updating) functions in parallel." - } - }, - "description": " This XQuery Module contains functions for parsing and evaluating XQuery strings at runtime, and to run code in parallel.", - "type": "module", - "override": true - }, - "http://basex.org/modules/xslt": { - "ns": "http://basex.org/modules/xslt", - "prefixes": [ - "xslt" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/xslt#processor#0": { - "name": "processor", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#processor#0", - "params": [], - "type": "xs:string", - "description": " Returns the name of the applied XSLT processor, or the path to a custom implementation (currently: \"Java\", \"Saxon EE\", \"Saxon PE\", or \"Saxon HE\").
" - }, - "http://basex.org/modules/xslt#version#0": { - "name": "version", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#version#0", - "params": [], - "type": "xs:string", - "description": " Returns the supported XSLT version (currently: \"1.0\" or \"3.0\"). \"Unknown\" is returned if a custom implementation was chosen.
" - }, - "http://basex.org/modules/xslt#transform#2": { - "name": "transform", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform#2", - "params": [ - "$input as item()", - "$stylesheet as item()" - ], - "type": "node()", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

XML Catalog files will be considered when resolving URIs. Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available:

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
" - }, - "http://basex.org/modules/xslt#transform#3": { - "name": "transform", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform#3", - "params": [ - "$input as item()", - "$stylesheet as item()", - "$params as map(*)?" - ], - "type": "node()", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

XML Catalog files will be considered when resolving URIs. Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available:

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
" - }, - "http://basex.org/modules/xslt#transform#4": { - "name": "transform", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform#4", - "params": [ - "$input as item()", - "$stylesheet as item()", - "$args as map(*)?", - "$options as map(*)?" - ], - "type": "node()", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

XML Catalog files will be considered when resolving URIs. Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available:

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
" - }, - "http://basex.org/modules/xslt#transform-text#2": { - "name": "transform-text", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform-text#2", - "params": [ - "$input as item()", - "$stylesheet as item()" - ], - "type": "xs:string", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform .
" - }, - "http://basex.org/modules/xslt#transform-text#3": { - "name": "transform-text", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform-text#3", - "params": [ - "$input as item()", - "$stylesheet as item()", - "$params as map(*)?" - ], - "type": "xs:string", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform .
" - }, - "http://basex.org/modules/xslt#transform-text#4": { - "name": "transform-text", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform-text#4", - "params": [ - "$input as item()", - "$stylesheet as item()", - "$params as map(*)?", - "$options as map(*)?" - ], - "type": "xs:string", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform .
" - }, - "http://basex.org/modules/xslt#transform-report#2": { - "name": "transform-report", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform-report#2", - "params": [ - "$input as item()", - "$stylesheet as item()" - ], - "type": "xs:string", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns a map with the following keys:
  • result: The transformation result: One or more document nodes, or (if the result cannot be converted to XML) an item of type xs:untypedAtomic.
  • messages: Informational output generated by xsl:message elements: A sequence of arrays. The arrays consist of XML elements, or (for those messages that cannot be converted to XML) items of type xs:untypedAtomic.

The semantics of $params and $options is the same as for xslt:transform .
For the moment, messages can only be returned with recent versions of Saxon.

  • error (optional): An error string, which would be raised as an error by the other functions of this module.
" - }, - "http://basex.org/modules/xslt#transform-report#3": { - "name": "transform-report", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform-report#3", - "params": [ - "$input as item()", - "$stylesheet as item()", - "$params as map(*)?" - ], - "type": "xs:string", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns a map with the following keys:
  • result: The transformation result: One or more document nodes, or (if the result cannot be converted to XML) an item of type xs:untypedAtomic.
  • messages: Informational output generated by xsl:message elements: A sequence of arrays. The arrays consist of XML elements, or (for those messages that cannot be converted to XML) items of type xs:untypedAtomic.

The semantics of $params and $options is the same as for xslt:transform .
For the moment, messages can only be returned with recent versions of Saxon.

  • error (optional): An error string, which would be raised as an error by the other functions of this module.
" - }, - "http://basex.org/modules/xslt#transform-report#4": { - "name": "transform-report", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform-report#4", - "params": [ - "$input as item()", - "$stylesheet as item()", - "$params as map(*)?", - "$options as map(*)?" - ], - "type": "xs:string", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns a map with the following keys:
  • result: The transformation result: One or more document nodes, or (if the result cannot be converted to XML) an item of type xs:untypedAtomic.
  • messages: Informational output generated by xsl:message elements: A sequence of arrays. The arrays consist of XML elements, or (for those messages that cannot be converted to XML) items of type xs:untypedAtomic.

The semantics of $params and $options is the same as for xslt:transform .
For the moment, messages can only be returned with recent versions of Saxon.

  • error (optional): An error string, which would be raised as an error by the other functions of this module.
" - } - }, - "description": " This XQuery Module contains functions and variables to perform XSL transformations.", - "type": "module", - "override": true - } -} \ No newline at end of file diff --git a/packages/basex-9.7.json b/packages/basex-9.7.json deleted file mode 100644 index 7f798b4..0000000 --- a/packages/basex-9.7.json +++ /dev/null @@ -1,7530 +0,0 @@ -{ - "http://basex.org/modules/admin": { - "ns": "http://basex.org/modules/admin", - "prefixes": [ - "admin" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/admin#logs#0": { - "name": "logs", - "uri": "http://basex.org/modules/admin", - "key": "http://basex.org/modules/admin#logs#0", - "params": [], - "type": "element(file)*", - "description": " Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
" - }, - "http://basex.org/modules/admin#logs#1": { - "name": "logs", - "uri": "http://basex.org/modules/admin", - "key": "http://basex.org/modules/admin#logs#1", - "params": [ - "$date as xs:string" - ], - "type": "element(entry)*", - "description": " Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
" - }, - "http://basex.org/modules/admin#logs#2": { - "name": "logs", - "uri": "http://basex.org/modules/admin", - "key": "http://basex.org/modules/admin#logs#2", - "params": [ - "$date as xs:string", - "$merge as xs:boolean" - ], - "type": "element(entry)*", - "description": " Returns Logging data compiled by the database or HTTP server:
  • If no argument is specified, a list of all log files will be returned, including the file size and date.
  • If a $date is specified, the contents of a single log file will be returned.
  • If $merge is set to true, related log entries will be merged. Please note that the merge might not be 100% successful, as log entries may be ambiguous.
" - }, - "http://basex.org/modules/admin#write-log#1": { - "name": "write-log", - "uri": "http://basex.org/modules/admin", - "key": "http://basex.org/modules/admin#write-log#1", - "params": [ - "$text as xs:string" - ], - "type": "empty-sequence()", - "description": " Writes a string to the database logs, along with current user data (timestamp, user name). An optional log $type can be specified. If omitted, the log type is INFO.
If the function is called from a database client, the IP will be logged. Otherwise, the string SERVER will be logged." - }, - "http://basex.org/modules/admin#write-log#2": { - "name": "write-log", - "uri": "http://basex.org/modules/admin", - "key": "http://basex.org/modules/admin#write-log#2", - "params": [ - "$text as xs:string", - "$type as xs:string" - ], - "type": "empty-sequence()", - "description": " Writes a string to the database logs, along with current user data (timestamp, user name). An optional log $type can be specified. If omitted, the log type is INFO.
If the function is called from a database client, the IP will be logged. Otherwise, the string SERVER will be logged." - }, - "http://basex.org/modules/admin#delete-logs#1": { - "name": "delete-logs", - "uri": "http://basex.org/modules/admin", - "key": "http://basex.org/modules/admin#delete-logs#1", - "params": [ - "$date as xs:string" - ], - "type": "empty-sequence()", - "description": " Deletes the log entries from the specified $date" - }, - "http://basex.org/modules/admin#sessions#0": { - "name": "sessions", - "uri": "http://basex.org/modules/admin", - "key": "http://basex.org/modules/admin#sessions#0", - "params": [], - "type": "element(session)*", - "description": " Returns an element sequence with all currently opened database sessions, including the user name, address (IP:port) and an optionally opened database.
The output of this function and the SHOW SESSIONS command is similar." - } - }, - "description": " This XQuery Module contains functions for performing admin-centric operations such as managing database users and log data.", - "type": "module", - "override": true - }, - "http://basex.org/modules/archive": { - "ns": "http://basex.org/modules/archive", - "prefixes": [ - "archive" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/archive#create#2": { - "name": "create", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#create#2", - "params": [ - "$entries as item()", - "$contents as item()*" - ], - "type": "xs:base64Binary", - "description": " Creates a new archive from the specified entries and contents.
The $entries argument contains meta information required to create new entries. All items may either be of type xs:string, representing the entry name, or element(archive:entry), containing the name as text node and additional, optional attributes:
  • last-modified: timestamp, specified as xs:dateTime (default: current time)
  • compression-level: 0-9, 0 = uncompressed (default: 8)
  • encoding: for textual entries (default: UTF-8)

An example:

  <archive:entry last-modified= '2011-11-11T11:11:11' compression-level= '8' encoding= 'US-ASCII' >hello.txt</archive:entry> 

The actual $contents must be xs:string or xs:base64Binary items.
The $options parameter contains archiving options:

  • format: allowed values are zip and gzip. zip is the default.
  • algorithm: allowed values are deflate and stored (for the zip format). deflate is the default.
" - }, - "http://basex.org/modules/archive#create#3": { - "name": "create", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#create#3", - "params": [ - "$entries as item()", - "$contents as item()*", - "$options as map(*)?" - ], - "type": "xs:base64Binary", - "description": " Creates a new archive from the specified entries and contents.
The $entries argument contains meta information required to create new entries. All items may either be of type xs:string, representing the entry name, or element(archive:entry), containing the name as text node and additional, optional attributes:
  • last-modified: timestamp, specified as xs:dateTime (default: current time)
  • compression-level: 0-9, 0 = uncompressed (default: 8)
  • encoding: for textual entries (default: UTF-8)

An example:

  <archive:entry last-modified= '2011-11-11T11:11:11' compression-level= '8' encoding= 'US-ASCII' >hello.txt</archive:entry> 

The actual $contents must be xs:string or xs:base64Binary items.
The $options parameter contains archiving options:

  • format: allowed values are zip and gzip. zip is the default.
  • algorithm: allowed values are deflate and stored (for the zip format). deflate is the default.
" - }, - "http://basex.org/modules/archive#create-from#1": { - "name": "create-from", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#create-from#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:base64Binary", - "description": " This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is identical to archive:create, but two additional options are available:
  • recursive: parse all files recursively (default: true; ignored if entries are specified via the last argument).
  • root-dir: use name of supplied directory as archive root directory (default: false).
" - }, - "http://basex.org/modules/archive#create-from#2": { - "name": "create-from", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#create-from#2", - "params": [ - "$path as xs:string", - "$options as map(*)?" - ], - "type": "xs:base64Binary", - "description": " This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is identical to archive:create, but two additional options are available:
  • recursive: parse all files recursively (default: true; ignored if entries are specified via the last argument).
  • root-dir: use name of supplied directory as archive root directory (default: false).
" - }, - "http://basex.org/modules/archive#create-from#3": { - "name": "create-from", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#create-from#3", - "params": [ - "$path as xs:string", - "$options as map(*)?", - "$entries as item()*" - ], - "type": "xs:base64Binary", - "description": " This convenience function creates an archive from all files in the specified directory $path.
The $options parameter contains archiving options, and the files to be archived can be limited via $entries. The format of the two last arguments is identical to archive:create, but two additional options are available:
  • recursive: parse all files recursively (default: true; ignored if entries are specified via the last argument).
  • root-dir: use name of supplied directory as archive root directory (default: false).
" - }, - "http://basex.org/modules/archive#entries#1": { - "name": "entries", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#entries#1", - "params": [ - "$archive as xs:base64Binary" - ], - "type": "element(archive:entry)*", - "description": " Returns the entry descriptors of the specified $archive. A descriptor contains the following attributes, provided that they are available in the archive format:
  • size: original file size
  • last-modified: timestamp, formatted as xs:dateTime
  • compressed-size: compressed file size

An example:

  <archive:entry size= \"1840\" last-modified= \"2009-03-20T03:30:32\" compressed-size= \"672\" > doc/index.html </archive:entry> 
" - }, - "http://basex.org/modules/archive#options#1": { - "name": "options", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#options#1", - "params": [ - "$archive as xs:base64Binary" - ], - "type": "map(*)", - "description": " Returns the options of the specified $archive in the format specified by archive:create." - }, - "http://basex.org/modules/archive#extract-text#1": { - "name": "extract-text", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#extract-text#1", - "params": [ - "$archive as xs:base64Binary" - ], - "type": "xs:string*", - "description": " Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding." - }, - "http://basex.org/modules/archive#extract-text#2": { - "name": "extract-text", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#extract-text#2", - "params": [ - "$archive as xs:base64Binary", - "$entries as item()*" - ], - "type": "xs:string*", - "description": " Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding." - }, - "http://basex.org/modules/archive#extract-text#3": { - "name": "extract-text", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#extract-text#3", - "params": [ - "$archive as xs:base64Binary", - "$entries as item()*", - "$encoding as xs:string" - ], - "type": "xs:string*", - "description": " Extracts entries of the specified $archive and returns them as texts.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored).
The encoding of the input files can be specified via $encoding." - }, - "http://basex.org/modules/archive#extract-binary#1": { - "name": "extract-binary", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#extract-binary#1", - "params": [ - "$archive as xs:base64Binary" - ], - "type": "xs:base64Binary*", - "description": " Extracts entries of the specified $archive and returns them as binaries.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored)." - }, - "http://basex.org/modules/archive#extract-binary#2": { - "name": "extract-binary", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#extract-binary#2", - "params": [ - "$archive as xs:base64Binary", - "$entries as item()*" - ], - "type": "xs:base64Binary*", - "description": " Extracts entries of the specified $archive and returns them as binaries.
The returned entries can be limited via $entries. The format of the argument is the same as for archive:create (attributes will be ignored)." - }, - "http://basex.org/modules/archive#extract-to#2": { - "name": "extract-to", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#extract-to#2", - "params": [ - "$path as xs:string", - "$archive as xs:base64Binary" - ], - "type": "empty-sequence()", - "description": " This convenience function writes files of an $archive directly to the specified directory $path.
The archive entries to be written can be restricted via $entries. The format of the argument is the same as for archive:create (attributes will be ignored)." - }, - "http://basex.org/modules/archive#extract-to#3": { - "name": "extract-to", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#extract-to#3", - "params": [ - "$path as xs:string", - "$archive as xs:base64Binary", - "$entries as item()*" - ], - "type": "empty-sequence()", - "description": " This convenience function writes files of an $archive directly to the specified directory $path.
The archive entries to be written can be restricted via $entries. The format of the argument is the same as for archive:create (attributes will be ignored)." - }, - "http://basex.org/modules/archive#update#3": { - "name": "update", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#update#3", - "params": [ - "$archive as xs:base64Binary", - "$entries as item()*", - "$contents as item()*" - ], - "type": "xs:base64Binary", - "description": " Creates an updated version of the specified $archive with new or replaced entries.
The format of $entries and $contents is the same as for archive:create." - }, - "http://basex.org/modules/archive#delete#2": { - "name": "delete", - "uri": "http://basex.org/modules/archive", - "key": "http://basex.org/modules/archive#delete#2", - "params": [ - "$archive as xs:base64Binary", - "$entries as item()*" - ], - "type": "xs:base64Binary", - "description": " Deletes entries from an $archive.
The format of $entries is the same as for archive:create." - } - }, - "description": " This XQuery Module contains functions to handle archives (including ePub, Open Office, JAR, and many other formats). New ZIP and GZIP archives can be created, existing archives can be updated, and the archive entries can be listed and extracted. The archive:extract-binary function includes an example for writing the contents of an archive to disk.", - "type": "module", - "override": true - }, - "http://www.w3.org/2005/xpath-functions/array": { - "ns": "http://www.w3.org/2005/xpath-functions/array", - "prefixes": [ - "array" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://www.w3.org/2005/xpath-functions/array#size#1": { - "name": "size", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#size#1", - "params": [ - "$input as array(*)" - ], - "type": "xs:integer", - "description": " Returns the number of members in $array. Note that because an array is an item, the fn:count function when applied to an array always returns 1." - }, - "http://www.w3.org/2005/xpath-functions/array#get#2": { - "name": "get", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#get#2", - "params": [ - "$array as array(*)", - "$position as xs:integer" - ], - "type": "item()*", - "description": " Returns the $array member at the specified $position." - }, - "http://www.w3.org/2005/xpath-functions/array#append#2": { - "name": "append", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#append#2", - "params": [ - "$array as array(*)", - "$member as item()*" - ], - "type": "array(*)", - "description": " Returns a copy of $array with a new $member attached." - }, - "http://www.w3.org/2005/xpath-functions/array#subarray#2": { - "name": "subarray", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#subarray#2", - "params": [ - "$array as array(*)", - "$position as xs:integer" - ], - "type": "array(*)", - "description": " Constructs a new array with with $length members of $array beginning from the specified $position.
The two-argument version of the function returns the same result as the three-argument version when called with $length equal to the value of array:size($array) - $position + 1." - }, - "http://www.w3.org/2005/xpath-functions/array#subarray#3": { - "name": "subarray", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#subarray#3", - "params": [ - "$array as array(*)", - "$position as xs:integer", - "$length as xs:integer" - ], - "type": "array(*)", - "description": " Constructs a new array with with $length members of $array beginning from the specified $position.
The two-argument version of the function returns the same result as the three-argument version when called with $length equal to the value of array:size($array) - $position + 1." - }, - "http://www.w3.org/2005/xpath-functions/array#put#3": { - "name": "put", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#put#3", - "params": [ - "$array as array(*)", - "$position as xs:integer", - "$member as item()*" - ], - "type": "array(*)", - "description": " Returns a copy of $array with $member replaced at the specified $position. Equivalent to $array => array:remove($position) => array:insert-before($position, $member)." - }, - "http://www.w3.org/2005/xpath-functions/array#remove#2": { - "name": "remove", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#remove#2", - "params": [ - "$array as array(*)", - "$positions as xs:integer*" - ], - "type": "array(*)", - "description": " Returns a copy of $array without the member at the specified $positions." - }, - "http://www.w3.org/2005/xpath-functions/array#insert-before#3": { - "name": "insert-before", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#insert-before#3", - "params": [ - "$array as array(*)", - "$position as xs:integer", - "$member as item()*" - ], - "type": "array(*)", - "description": " Returns a copy of $array with one new $member at the specified $position. Setting $position to the value array:size($array) + 1 yields the same result as array:append($array, $insert)." - }, - "http://www.w3.org/2005/xpath-functions/array#head#1": { - "name": "head", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#head#1", - "params": [ - "$array as array(*)" - ], - "type": "item()*", - "description": " Returns the first member of $array. This function is equivalent to the expression $array(1)." - }, - "http://www.w3.org/2005/xpath-functions/array#tail#1": { - "name": "tail", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#tail#1", - "params": [ - "$array as array(*)" - ], - "type": "array(*)", - "description": " Returns a new array with all members except the first from $array. This function is equivalent to the expression array:remove($array, 1)." - }, - "http://www.w3.org/2005/xpath-functions/array#reverse#1": { - "name": "reverse", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#reverse#1", - "params": [ - "$array as array(*)" - ], - "type": "array(*)", - "description": " Returns a new array with all members of $array in reverse order." - }, - "http://www.w3.org/2005/xpath-functions/array#join#1": { - "name": "join", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#join#1", - "params": [ - "$arrays as array(*)*" - ], - "type": "array(*)", - "description": " Concatenates the contents of several $arrays into a single array." - }, - "http://www.w3.org/2005/xpath-functions/array#flatten#1": { - "name": "flatten", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#flatten#1", - "params": [ - "$items as item()*" - ], - "type": "item()*", - "description": " Recursively flattens all arrays that occur in the supplied $items." - }, - "http://www.w3.org/2005/xpath-functions/array#for-each#2": { - "name": "for-each", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#for-each#2", - "params": [ - "$array as array(*)", - "$function as function(item()*) as item()*" - ], - "type": "array(*)", - "description": " Returns a new array, in which each member is computed by applying $function to the corresponding member of $array." - }, - "http://www.w3.org/2005/xpath-functions/array#filter#2": { - "name": "filter", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#filter#2", - "params": [ - "$array as array(*)", - "$function as function(item()*) as xs:boolean" - ], - "type": "array(*)", - "description": " Returns a new array with those members of $array for which $function returns true." - }, - "http://www.w3.org/2005/xpath-functions/array#fold-left#3": { - "name": "fold-left", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#fold-left#3", - "params": [ - "$array as array(*)", - "$zero as item()*", - "$function as function(item()*, item()*) as item()*" - ], - "type": "item()*", - "description": " Evaluates the supplied $function cumulatively on successive members of the supplied $array from left to right and using $zero as first argument." - }, - "http://www.w3.org/2005/xpath-functions/array#fold-right#3": { - "name": "fold-right", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#fold-right#3", - "params": [ - "$array as array(*)", - "$zero as item()*", - "$function as function(item()*, item()*) as item()*" - ], - "type": "item()*", - "description": " Evaluates the supplied $function cumulatively on successive members of the supplied $array from right to left and using $zero as first argument." - }, - "http://www.w3.org/2005/xpath-functions/array#for-each-pair#3": { - "name": "for-each-pair", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#for-each-pair#3", - "params": [ - "$array1 as array(*)", - "$array2 as array(*)", - "$function as function(item()*) as item()*" - ], - "type": "array(*)", - "description": " Returns a new array obtained by evaluating the supplied $function for each pair of members at the same position in $array1 and $array2." - }, - "http://www.w3.org/2005/xpath-functions/array#sort#1": { - "name": "sort", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#sort#1", - "params": [ - "$array as array(*)" - ], - "type": "array(*)", - "description": " Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression." - }, - "http://www.w3.org/2005/xpath-functions/array#sort#2": { - "name": "sort", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#sort#2", - "params": [ - "$array as array(*)", - "$collation as xs:string?" - ], - "type": "array(*)", - "description": " Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression." - }, - "http://www.w3.org/2005/xpath-functions/array#sort#3": { - "name": "sort", - "uri": "http://www.w3.org/2005/xpath-functions/array", - "key": "http://www.w3.org/2005/xpath-functions/array#sort#3", - "params": [ - "$array as array(*)", - "$collation as xs:string?", - "$key as function(item()*) as xs:anyAtomicType*" - ], - "type": "array(*)", - "description": " Returns a new array with sorted $array members, using an optional $collation. If a $key function is supplied, it will be applied on all array members. The items of the resulting values will be sorted using the semantics of the lt expression." - } - }, - "description": " This XQuery Module contains functions for manipulating arrays, which has been introduced with XQuery 3.1.", - "type": "module", - "override": true - }, - "http://expath.org/ns/binary": { - "ns": "http://expath.org/ns/binary", - "prefixes": [ - "bin" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://expath.org/ns/binary#hex#1": { - "name": "hex", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#hex#1", - "params": [ - "$in as xs:string?" - ], - "type": "xs:base64Binary?", - "description": " Returns the binary form of the set of octets written as a sequence of (ASCII) hex digits ([0-9A-Fa-f]).
$in will be effectively zero-padded from the left to generate an integral number of octets, i.e. an even number of hexadecimal digits. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#bin#1": { - "name": "bin", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#bin#1", - "params": [ - "$in as xs:string?" - ], - "type": "xs:base64Binary?", - "description": " Returns the binary form of the set of octets written as a sequence of (8-wise) (ASCII) binary digits ([01]).
$in will be effectively zero-padded from the left to generate an integral number of octets. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#octal#1": { - "name": "octal", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#octal#1", - "params": [ - "$in as xs:string?" - ], - "type": "xs:base64Binary?", - "description": " Returns the binary form of the set of octets written as a sequence of (ASCII) octal digits ([0-7]).
$in will be effectively zero-padded from the left to generate an integral number of octets. If $in is an empty string, then the result will be an xs:base64Binary with no embedded data. Byte order in the result follows (per-octet) character order in the string. If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#to-octets#1": { - "name": "to-octets", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#to-octets#1", - "params": [ - "$in as xs:base64Binary" - ], - "type": "xs:integer*", - "description": " Returns binary data as a sequence of octets.
If $in is a zero length binary data then the empty sequence is returned. Octets are returned as integers from 0 to 255." - }, - "http://expath.org/ns/binary#from-octets#1": { - "name": "from-octets", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#from-octets#1", - "params": [ - "$in as xs:integer*" - ], - "type": "xs:base64Binary", - "description": " Converts a sequence of octets into binary data.
Octets are integers from 0 to 255. If the value of $in is the empty sequence, the function returns zero-sized binary data." - }, - "http://expath.org/ns/binary#length#1": { - "name": "length", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#length#1", - "params": [ - "$in as xs:base64Binary" - ], - "type": "xs:integer", - "description": " Returns the size of binary data in octets." - }, - "http://expath.org/ns/binary#part#2": { - "name": "part", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#part#2", - "params": [ - "$in as xs:base64Binary?", - "$offset as xs:integer" - ], - "type": "xs:base64Binary?", - "description": " Returns a section of binary data starting at the $offset octet.
If $size is specified, the size of the returned binary data is $size octets. If $size is absent, all remaining data from $offset is returned. The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#part#3": { - "name": "part", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#part#3", - "params": [ - "$in as xs:base64Binary?", - "$offset as xs:integer", - "$size as xs:integer" - ], - "type": "xs:base64Binary?", - "description": " Returns a section of binary data starting at the $offset octet.
If $size is specified, the size of the returned binary data is $size octets. If $size is absent, all remaining data from $offset is returned. The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#join#1": { - "name": "join", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#join#1", - "params": [ - "$in as xs:base64Binary*" - ], - "type": "xs:base64Binary", - "description": " Returns an xs:base64Binary created by concatenating the items in the sequence $in, in order. If the value of $in is the empty sequence, the function returns a binary item containing no data bytes." - }, - "http://expath.org/ns/binary#insert-before#3": { - "name": "insert-before", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#insert-before#3", - "params": [ - "$in as xs:base64Binary?", - "$offset as xs:integer", - "$extra as xs:base64Binary?" - ], - "type": "xs:base64Binary?", - "description": " Returns binary data consisting sequentially of the data from $in up to and including the $offset - 1 octet, followed by all the data from $extra, and then the remaining data from $in.
The $offset is zero based. If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#pad-left#2": { - "name": "pad-left", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pad-left#2", - "params": [ - "$in as xs:base64Binary?", - "$size as xs:integer" - ], - "type": "xs:base64Binary?", - "description": " Returns an xs:base64Binary created by padding the input with $size octets in front of the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#pad-left#3": { - "name": "pad-left", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pad-left#3", - "params": [ - "$in as xs:base64Binary?", - "$size as xs:integer", - "$octet as xs:integer" - ], - "type": "xs:base64Binary?", - "description": " Returns an xs:base64Binary created by padding the input with $size octets in front of the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#pad-right#2": { - "name": "pad-right", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pad-right#2", - "params": [ - "$in as xs:base64Binary?", - "$size as xs:integer" - ], - "type": "xs:base64Binary?", - "description": " Returns an xs:base64Binary created by padding the input with $size octets after the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#pad-right#3": { - "name": "pad-right", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pad-right#3", - "params": [ - "$in as xs:base64Binary?", - "$size as xs:integer", - "$octet as xs:integer" - ], - "type": "xs:base64Binary?", - "description": " Returns an xs:base64Binary created by padding the input with $size octets after the input. If $octet is specified, the padding octets each have that value, otherwise they are zero.
If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#find#3": { - "name": "find", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#find#3", - "params": [ - "$in as xs:base64Binary?", - "$offset as xs:integer", - "$search as xs:base64Binary" - ], - "type": "xs:integer?", - "description": " Returns the first location of the binary search sequence in the input, or if not found, the empty sequence.
The $offset and the returned location are zero based. If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#decode-string#2": { - "name": "decode-string", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#decode-string#2", - "params": [ - "$in as xs:base64Binary?", - "$encoding as xs:string" - ], - "type": "xs:string?", - "description": " Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#decode-string#3": { - "name": "decode-string", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#decode-string#3", - "params": [ - "$in as xs:base64Binary?", - "$encoding as xs:string", - "$offset as xs:integer" - ], - "type": "xs:string?", - "description": " Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#decode-string#4": { - "name": "decode-string", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#decode-string#4", - "params": [ - "$in as xs:base64Binary?", - "$encoding as xs:string", - "$offset as xs:integer", - "$size as xs:integer" - ], - "type": "xs:string?", - "description": " Decodes binary data as a string in a given $encoding.
If $offset and $size are provided, the $size octets from $offset are decoded. If $offset alone is provided, octets from $offset to the end are decoded.If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#encode-string#2": { - "name": "encode-string", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#encode-string#2", - "params": [ - "$in as xs:string?", - "$encoding as xs:string" - ], - "type": "xs:base64Binary?", - "description": " Encodes a string into binary data using a given $encoding.
If the value of $in is the empty sequence, the function returns an empty sequence." - }, - "http://expath.org/ns/binary#pack-double#1": { - "name": "pack-double", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pack-double#1", - "params": [ - "$in as xs:double" - ], - "type": "xs:base64Binary", - "description": " Returns the 8-octet binary representation of a double value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified." - }, - "http://expath.org/ns/binary#pack-double#2": { - "name": "pack-double", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pack-double#2", - "params": [ - "$in as xs:double", - "$octet-order as xs:string" - ], - "type": "xs:base64Binary", - "description": " Returns the 8-octet binary representation of a double value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified." - }, - "http://expath.org/ns/binary#pack-float#1": { - "name": "pack-float", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pack-float#1", - "params": [ - "$in as xs:float" - ], - "type": "xs:base64Binary", - "description": " Returns the 4-octet binary representation of a float value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified." - }, - "http://expath.org/ns/binary#pack-float#2": { - "name": "pack-float", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pack-float#2", - "params": [ - "$in as xs:float", - "$octet-order as xs:string" - ], - "type": "xs:base64Binary", - "description": " Returns the 4-octet binary representation of a float value.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified." - }, - "http://expath.org/ns/binary#pack-integer#2": { - "name": "pack-integer", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pack-integer#2", - "params": [ - "$in as xs:integer", - "$size as xs:integer" - ], - "type": "xs:base64Binary", - "description": " Returns the twos-complement binary representation of an integer value treated as $size octets long. Any 'excess' high-order bits are discarded.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. Specifying a $size of zero yields an empty binary data." - }, - "http://expath.org/ns/binary#pack-integer#3": { - "name": "pack-integer", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#pack-integer#3", - "params": [ - "$in as xs:integer", - "$size as xs:integer", - "$octet-order as xs:string" - ], - "type": "xs:base64Binary", - "description": " Returns the twos-complement binary representation of an integer value treated as $size octets long. Any 'excess' high-order bits are discarded.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. Specifying a $size of zero yields an empty binary data." - }, - "http://expath.org/ns/binary#unpack-double#2": { - "name": "unpack-double", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-double#2", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer" - ], - "type": "xs:double", - "description": " Extracts the double value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based." - }, - "http://expath.org/ns/binary#unpack-double#3": { - "name": "unpack-double", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-double#3", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer", - "$octet-order as xs:string" - ], - "type": "xs:double", - "description": " Extracts the double value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based." - }, - "http://expath.org/ns/binary#unpack-float#2": { - "name": "unpack-float", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-float#2", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer" - ], - "type": "xs:float", - "description": " Extracts the float value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based." - }, - "http://expath.org/ns/binary#unpack-float#3": { - "name": "unpack-float", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-float#3", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer", - "$octet-order as xs:string" - ], - "type": "xs:float", - "description": " Extracts the float value stored at the particular offset in binary data.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based." - }, - "http://expath.org/ns/binary#unpack-integer#3": { - "name": "unpack-integer", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-integer#3", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer", - "$size as xs:integer" - ], - "type": "xs:integer", - "description": " Returns a signed integer value represented by the $size octets starting from $offset in the input binary representation. Necessary sign extension is performed (i.e. the result is negative if the high order bit is '1').
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0." - }, - "http://expath.org/ns/binary#unpack-integer#4": { - "name": "unpack-integer", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-integer#4", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer", - "$size as xs:integer", - "$octet-order as xs:string" - ], - "type": "xs:integer", - "description": " Returns a signed integer value represented by the $size octets starting from $offset in the input binary representation. Necessary sign extension is performed (i.e. the result is negative if the high order bit is '1').
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0." - }, - "http://expath.org/ns/binary#unpack-unsigned-integer#3": { - "name": "unpack-unsigned-integer", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-unsigned-integer#3", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer", - "$size as xs:integer" - ], - "type": "xs:integer", - "description": " Returns an unsigned integer value represented by the $size octets starting from $offset in the input binary representation.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0." - }, - "http://expath.org/ns/binary#unpack-unsigned-integer#4": { - "name": "unpack-unsigned-integer", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#unpack-unsigned-integer#4", - "params": [ - "$in as xs:base64Binary", - "$offset as xs:integer", - "$size as xs:integer", - "$octet-order as xs:string" - ], - "type": "xs:integer", - "description": " Returns an unsigned integer value represented by the $size octets starting from $offset in the input binary representation.
Most-significant-octet-first number representation is assumed unless the $octet-order parameter is specified. The $offset is zero based. Specifying a $size of zero yields the integer 0." - }, - "http://expath.org/ns/binary#or#2": { - "name": "or", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#or#2", - "params": [ - "$a as xs:base64Binary?", - "$b as xs:base64Binary?" - ], - "type": "xs:base64Binary?", - "description": " Returns the \"bitwise or\" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned." - }, - "http://expath.org/ns/binary#xor#2": { - "name": "xor", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#xor#2", - "params": [ - "$a as xs:base64Binary?", - "$b as xs:base64Binary?" - ], - "type": "xs:base64Binary?", - "description": " Returns the \"bitwise xor\" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned." - }, - "http://expath.org/ns/binary#and#2": { - "name": "and", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#and#2", - "params": [ - "$a as xs:base64Binary?", - "$b as xs:base64Binary?" - ], - "type": "xs:base64Binary?", - "description": " Returns the \"bitwise and\" of two binary arguments.
If either argument is the empty sequence, an empty sequence is returned." - }, - "http://expath.org/ns/binary#not#1": { - "name": "not", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#not#1", - "params": [ - "$in as xs:base64Binary?" - ], - "type": "xs:base64Binary?", - "description": " Returns the \"bitwise not\" of a binary argument.
If the argument is the empty sequence, an empty sequence is returned." - }, - "http://expath.org/ns/binary#shift#2": { - "name": "shift", - "uri": "http://expath.org/ns/binary", - "key": "http://expath.org/ns/binary#shift#2", - "params": [ - "$in as xs:base64Binary?", - "$by as xs:integer" - ], - "type": "xs:base64Binary?", - "description": " Shifts bits in binary data.
If $by is zero, the result is identical to $in. If $by is positive then bits are shifted to the left. Otherwise, bits are shifted to the right. If the absolute value of $by is greater than the bit-length of $in then an all-zeros result is returned. The result always has the same size as $in. The shifting is logical: zeros are placed into discarded bits. If the value of $in is the empty sequence, the function returns an empty sequence." - } - }, - "description": " This XQuery Module contains functions to process binary data, including extracting subparts, searching, basic binary operations and conversion between binary and structured forms.", - "type": "module", - "override": true - }, - "http://basex.org/modules/client": { - "ns": "http://basex.org/modules/client", - "prefixes": [ - "client" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/client#connect#4": { - "name": "connect", - "uri": "http://basex.org/modules/client", - "key": "http://basex.org/modules/client#connect#4", - "params": [ - "$host as xs:string", - "$port as xs:integer", - "$user as xs:string", - "$password as xs:string" - ], - "type": "xs:anyURI", - "description": " This function establishes a connection to a remote BaseX server, creates a new client session, and returns a session id. The parameter $host is the name of the database server, $port specifies the server port, and $user and $password represent the login data." - }, - "http://basex.org/modules/client#execute#2": { - "name": "execute", - "uri": "http://basex.org/modules/client", - "key": "http://basex.org/modules/client#execute#2", - "params": [ - "$id as xs:anyURI", - "$command as xs:string" - ], - "type": "xs:string", - "description": " This function executes a command and returns the result as string. The parameter $id contains the session id returned by client:connect. The $command argument represents a single command, which will be executed by the server." - }, - "http://basex.org/modules/client#info#1": { - "name": "info", - "uri": "http://basex.org/modules/client", - "key": "http://basex.org/modules/client#info#1", - "params": [ - "$id as xs:anyURI" - ], - "type": "xs:string", - "description": " This function returns an information string, created by the last call of client:execute. $id specifies the session id." - }, - "http://basex.org/modules/client#query#2": { - "name": "query", - "uri": "http://basex.org/modules/client", - "key": "http://basex.org/modules/client#query#2", - "params": [ - "$id as xs:anyURI", - "$query as xs:string" - ], - "type": "item()*", - "description": " Evaluates a query and returns the result as sequence. The parameter $id contains the session id returned by client:connect, and $query represents the query string, which will be evaluated by the server.
Variables and the context item can be declared via $bindings. The specified keys must be QNames or strings:
  • If a key is a QName, it will be directly adopted as variable name.
  • If a key is a string, it may be prefixed with a dollar sign. A namespace can be specified using the Clark Notation. If the specified string is empty, the value will be bound to the context item.
" - }, - "http://basex.org/modules/client#query#3": { - "name": "query", - "uri": "http://basex.org/modules/client", - "key": "http://basex.org/modules/client#query#3", - "params": [ - "$id as xs:anyURI", - "$query as xs:string", - "$bindings as map(*)?" - ], - "type": "item()*", - "description": " Evaluates a query and returns the result as sequence. The parameter $id contains the session id returned by client:connect, and $query represents the query string, which will be evaluated by the server.
Variables and the context item can be declared via $bindings. The specified keys must be QNames or strings:
  • If a key is a QName, it will be directly adopted as variable name.
  • If a key is a string, it may be prefixed with a dollar sign. A namespace can be specified using the Clark Notation. If the specified string is empty, the value will be bound to the context item.
" - }, - "http://basex.org/modules/client#close#1": { - "name": "close", - "uri": "http://basex.org/modules/client", - "key": "http://basex.org/modules/client#close#1", - "params": [ - "$id as xs:anyURI" - ], - "type": "empty-sequence()", - "description": " This function closes a client session. $id specifies the session id.
Opened connections will automatically be closed after the XQuery expression has been evaluated, but it is recommendable to explicitly close them with this function if you open many connections." - } - }, - "description": " This XQuery Module contains functions to access BaseX server instances from XQuery. With this module, you can execute database commands and evaluate XQuery expressions.", - "type": "module", - "override": true - }, - "http://basex.org/modules/convert": { - "ns": "http://basex.org/modules/convert", - "prefixes": [ - "convert" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/convert#binary-to-string#1": { - "name": "binary-to-string", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#binary-to-string#1", - "params": [ - "$bytes as xs:anyAtomicType" - ], - "type": "xs:string", - "description": " Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://basex.org/modules/convert#binary-to-string#2": { - "name": "binary-to-string", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#binary-to-string#2", - "params": [ - "$bytes as xs:anyAtomicType", - "$encoding as xs:string" - ], - "type": "xs:string", - "description": " Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://basex.org/modules/convert#binary-to-string#3": { - "name": "binary-to-string", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#binary-to-string#3", - "params": [ - "$bytes as xs:anyAtomicType", - "$encoding as xs:string", - "$fallback as xs:boolean" - ], - "type": "xs:string", - "description": " Converts the specifed $bytes (xs:base64Binary, xs:hexBinary) to a string:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://basex.org/modules/convert#string-to-base64#1": { - "name": "string-to-base64", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#string-to-base64#1", - "params": [ - "$string as xs:string" - ], - "type": "xs:base64Binary", - "description": " Converts the specified $string to an xs:base64Binary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument." - }, - "http://basex.org/modules/convert#string-to-base64#2": { - "name": "string-to-base64", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#string-to-base64#2", - "params": [ - "$string as xs:string", - "$encoding as xs:string" - ], - "type": "xs:base64Binary", - "description": " Converts the specified $string to an xs:base64Binary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument." - }, - "http://basex.org/modules/convert#string-to-hex#1": { - "name": "string-to-hex", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#string-to-hex#1", - "params": [ - "$string as xs:string" - ], - "type": "xs:hexBinary", - "description": " Converts the specified $string to an xs:hexBinary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument." - }, - "http://basex.org/modules/convert#string-to-hex#2": { - "name": "string-to-hex", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#string-to-hex#2", - "params": [ - "$string as xs:string", - "$encoding as xs:string" - ], - "type": "xs:hexBinary", - "description": " Converts the specified $string to an xs:hexBinary item. If the default encoding is chosen, conversion will be cheap, as strings and binaries are both internally represented as byte arrays.
The UTF-8 default encoding can be overwritten with the optional $encoding argument." - }, - "http://basex.org/modules/convert#integers-to-base64#1": { - "name": "integers-to-base64", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#integers-to-base64#1", - "params": [ - "$integers as xs:integer*" - ], - "type": "xs:base64Binary", - "description": " Converts the specified $integers to an item of type xs:base64Binary:
  • Only the first 8 bits of the supplied integers will be considered.
  • Conversion of byte sequences is very efficient, as items of binary type are internally represented as byte arrays.
" - }, - "http://basex.org/modules/convert#integers-to-hex#1": { - "name": "integers-to-hex", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#integers-to-hex#1", - "params": [ - "$integers as xs:integer*" - ], - "type": "xs:hexBinary", - "description": " Converts the specified $integers to an item of type xs:hexBinary:
  • Only the first 8 bits of the supplied integers will be considered.
  • Conversion of byte sequences is very efficient, as items of binary type are internally represented as byte arrays.
" - }, - "http://basex.org/modules/convert#binary-to-integers#1": { - "name": "binary-to-integers", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#binary-to-integers#1", - "params": [ - "$binary as xs:anyAtomicType" - ], - "type": "xs:integer*", - "description": " Returns the specified $binary (xs:base64Binary, xs:hexBinary) as a sequence of unsigned integers (octets)." - }, - "http://basex.org/modules/convert#binary-to-bytes#1": { - "name": "binary-to-bytes", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#binary-to-bytes#1", - "params": [ - "$binary as xs:anyAtomicType" - ], - "type": "xs:byte*", - "description": " Returns the specified $binary (xs:base64Binary, xs:hexBinary) as a sequence of bytes. The conversion is very cheap and takes no additional memory, as items of binary type are internally represented as byte arrays." - }, - "http://basex.org/modules/convert#integer-to-base#2": { - "name": "integer-to-base", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#integer-to-base#2", - "params": [ - "$number as xs:integer", - "$base as xs:integer" - ], - "type": "xs:string", - "description": " Converts $number to a string, using the specified $base, interpreting it as a 64-bit unsigned integer.
The first base elements of the sequence '0',..,'9','a',..,'z' are used as digits.
Valid bases are 2, .., 36.
" - }, - "http://basex.org/modules/convert#integer-from-base#2": { - "name": "integer-from-base", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#integer-from-base#2", - "params": [ - "$string as xs:string", - "$base as xs:integer" - ], - "type": "xs:integer", - "description": " Decodes an integer from $string, using the specified $base.
The first base elements of the sequence '0',..,'9','a',..,'z' are allowed as digits; case does not matter.
Valid bases are 2 - 36.
If the supplied string contains more than 64 bits of information, the result will be truncated." - }, - "http://basex.org/modules/convert#integer-to-dateTime#1": { - "name": "integer-to-dateTime", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#integer-to-dateTime#1", - "params": [ - "$milliseconds as xs:integer" - ], - "type": "xs:dateTime", - "description": " Converts the specified number of $milliseconds since 1 Jan 1970 to an item of type xs:dateTime.
" - }, - "http://basex.org/modules/convert#dateTime-to-integer#1": { - "name": "dateTime-to-integer", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#dateTime-to-integer#1", - "params": [ - "$dateTime as xs:dateTime" - ], - "type": "xs:integer", - "description": " Converts the specified $dateTime item to the number of milliseconds since 1 Jan 1970.
" - }, - "http://basex.org/modules/convert#integer-to-dayTime#1": { - "name": "integer-to-dayTime", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#integer-to-dayTime#1", - "params": [ - "$milliseconds as xs:integer" - ], - "type": "xs:dayTimeDuration", - "description": " Converts the specified number of $milliseconds to an item of type xs:dayTimeDuration.
" - }, - "http://basex.org/modules/convert#dayTime-to-integer#1": { - "name": "dayTime-to-integer", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#dayTime-to-integer#1", - "params": [ - "$dayTime as xs:dayTimeDuration" - ], - "type": "xs:integer", - "description": " Converts the specified $dayTime duration to milliseconds represented by an integer.
" - }, - "http://basex.org/modules/convert#encode-key#1": { - "name": "encode-key", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#encode-key#1", - "params": [ - "$key as xs:string" - ], - "type": "xs:string", - "description": " Encodes the specified $key (with the optional $lax conversion method) to a valid NCName representation, which can be used to create an element node:
  • An empty string is converted to a single underscore (_).
  • Existing underscores are rewritten to two underscores (__).
  • Characters that are no valid NCName characters are rewritten to an underscore and the character’s four-digit Unicode. For example, the exclamation mark ? is transformed to _003f.
  • If lax conversion is chosen, invalid characters are replaced with underscores or (when invalid as first character of an element name) prefixed with an underscore. The resulting string may be better readable, but it cannot necessarily be converted back to the original form.

This encoding is employed by the direct conversion format in the JSON Module and the CSV Module.

" - }, - "http://basex.org/modules/convert#encode-key#2": { - "name": "encode-key", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#encode-key#2", - "params": [ - "$key as xs:string", - "$lax as xs:boolean" - ], - "type": "xs:string", - "description": " Encodes the specified $key (with the optional $lax conversion method) to a valid NCName representation, which can be used to create an element node:
  • An empty string is converted to a single underscore (_).
  • Existing underscores are rewritten to two underscores (__).
  • Characters that are no valid NCName characters are rewritten to an underscore and the character’s four-digit Unicode. For example, the exclamation mark ? is transformed to _003f.
  • If lax conversion is chosen, invalid characters are replaced with underscores or (when invalid as first character of an element name) prefixed with an underscore. The resulting string may be better readable, but it cannot necessarily be converted back to the original form.

This encoding is employed by the direct conversion format in the JSON Module and the CSV Module.

" - }, - "http://basex.org/modules/convert#decode-key#1": { - "name": "decode-key", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#decode-key#1", - "params": [ - "$key as xs:string" - ], - "type": "xs:string", - "description": " Decodes the specified $key (with the optional $lax conversion method) to the original string representation.
Keys supplied to this function are usually element names from documents that have been created with the JSON Module or CSV Module." - }, - "http://basex.org/modules/convert#decode-key#2": { - "name": "decode-key", - "uri": "http://basex.org/modules/convert", - "key": "http://basex.org/modules/convert#decode-key#2", - "params": [ - "$key as xs:string", - "$lax as xs:boolean" - ], - "type": "xs:string", - "description": " Decodes the specified $key (with the optional $lax conversion method) to the original string representation.
Keys supplied to this function are usually element names from documents that have been created with the JSON Module or CSV Module." - } - }, - "description": " This XQuery Module contains functions to convert data between different formats.", - "type": "module", - "override": true - }, - "http://expath.org/ns/crypto": { - "ns": "http://expath.org/ns/crypto", - "prefixes": [ - "crypto" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://expath.org/ns/crypto#hmac#3": { - "name": "hmac", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#hmac#3", - "params": [ - "$data as xs:anyAtomicType", - "$key as xs:anyAtomicType", - "$algorithm as xs:string" - ], - "type": "xs:string", - "description": " Creates an authentication code for the specified $data via a cryptographic hash function:
  • $key must not be empty.
  • $algorithm describes the hash algorithm which is used for encryption. Currently supported are md5, sha1, sha256, sha384, sha512. Default is md5.
  • $encoding must either be hex or base64; it specifies the encoding of the returned authentication code. Default is base64.
" - }, - "http://expath.org/ns/crypto#hmac#4": { - "name": "hmac", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#hmac#4", - "params": [ - "$data as xs:anyAtomicType", - "$key as xs:anyAtomicType", - "$algorithm as xs:string", - "$encoding as xs:string" - ], - "type": "xs:string", - "description": " Creates an authentication code for the specified $data via a cryptographic hash function:
  • $key must not be empty.
  • $algorithm describes the hash algorithm which is used for encryption. Currently supported are md5, sha1, sha256, sha384, sha512. Default is md5.
  • $encoding must either be hex or base64; it specifies the encoding of the returned authentication code. Default is base64.
" - }, - "http://expath.org/ns/crypto#encrypt#4": { - "name": "encrypt", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#encrypt#4", - "params": [ - "$data as xs:anyAtomicType", - "$type as xs:string", - "$key as xs:anyAtomicType", - "$algorithm as xs:string" - ], - "type": "xs:base64Binary", - "description": " Encrypts data with the specified key:
  • $data must be a string or binary item.
  • $type must be symmetric.
  • $key is the secret key which is used for both encryption and decryption of input data. It must be a string or binary item. Its length is fixed and depends on the chosen algorithm: 8 bytes for DES, 16 bytes for AES.
  • $algorithm must either be DES or AES. Default is DES.
" - }, - "http://expath.org/ns/crypto#decrypt#4": { - "name": "decrypt", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#decrypt#4", - "params": [ - "$data as xs:anyAtomicType", - "$type as xs:string", - "$key as xs:anyAtomicType", - "$algorithm as xs:string" - ], - "type": "xs:string", - "description": " Encrypts data with the specified key:
  • $data must be a string or binary item.
  • $type must be symmetric.
  • $key is the secret key which is used for both encryption and decryption of input data. It must be a string or binary item. Its length is fixed and depends on the chosen algorithm: 8 bytes for DES, 16 bytes for AES.
  • $algorithm must either be DES or AES. Default is DES.
" - }, - "http://expath.org/ns/crypto#generate-signature#6": { - "name": "generate-signature", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#generate-signature#6", - "params": [ - "$input as node()", - "$canonicalization as xs:string", - "$digest as xs:string", - "$signature as xs:string", - "$prefix as xs:string", - "$type as xs:string" - ], - "type": "node()", - "description": " $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

" - }, - "http://expath.org/ns/crypto#generate-signature#8": { - "name": "generate-signature", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#generate-signature#8", - "params": [ - "$input as node()", - "$canonicalization as xs:string", - "$digest as xs:string", - "$signature as xs:string", - "$prefix as xs:string", - "$type as xs:string", - "$xpath as xs:string", - "$certificate as node()" - ], - "type": "node()", - "description": " $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

" - }, - "http://expath.org/ns/crypto#generate-signature#7": { - "name": "generate-signature", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#generate-signature#7", - "params": [ - "$input as node()", - "$canonicalization as xs:string", - "$digest as xs:string", - "$signature as xs:string", - "$prefix as xs:string", - "$type as xs:string", - "$ext as item()" - ], - "type": "node()", - "description": " $canonicalization must either be inclusive-with-comments, inclusive, exclusive-with-comments or exclusive. Default is inclusive-with-comments .

$digest must be one of the following: SHA1, SHA256 or SHA512. Default is SHA1 .
$signature must either be RSA_SHA1 or DSA_SHA1. Default is RSA_SHA1 .
$prefix may be empty and prefixes the Signature element accordingly.
$type is the signature type. It must either be enveloped or enveloping (detached signatures are not supported so far). Default is enveloped .
$xpath is an arbitrary XPath expression which specifies a subset of the document that is to be signed.
$certificate is the digitial certificate used to sign the input document.
$ext may either be an $xpath expression or a $certificate.

" - }, - "http://expath.org/ns/crypto#validate-signature#1": { - "name": "validate-signature", - "uri": "http://expath.org/ns/crypto", - "key": "http://expath.org/ns/crypto#validate-signature#1", - "params": [ - "$input-doc as node()" - ], - "type": "xs:boolean", - "description": " Checks if the given node contains a Signature element and whether the signature is valid. In this case true is returned. If the signature is invalid the function returns false." - } - }, - "description": " This XQuery Module contains functions to perform cryptographic operations in XQuery. The cryptographic module is based on an early draft of the EXPath Cryptographic Module and provides the following functionality: creation of message authentication codes (HMAC), encryption and decryption, and creation and validation of XML Digital Signatures.", - "type": "module", - "override": true - }, - "http://basex.org/modules/csv": { - "ns": "http://basex.org/modules/csv", - "prefixes": [ - "csv" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/csv#parse#1": { - "name": "parse", - "uri": "http://basex.org/modules/csv", - "key": "http://basex.org/modules/csv#parse#1", - "params": [ - "$string as xs:string?" - ], - "type": "item()?", - "description": " Converts the CSV $string to an XQuery value. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/csv#parse#2": { - "name": "parse", - "uri": "http://basex.org/modules/csv", - "key": "http://basex.org/modules/csv#parse#2", - "params": [ - "$string as xs:string?", - "$options as map(*)?" - ], - "type": "item()?", - "description": " Converts the CSV $string to an XQuery value. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/csv#doc#1": { - "name": "doc", - "uri": "http://basex.org/modules/csv", - "key": "http://basex.org/modules/csv#doc#1", - "params": [ - "$uri as xs:string?" - ], - "type": "item()?", - "description": " Fetches the CSV document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/csv#doc#2": { - "name": "doc", - "uri": "http://basex.org/modules/csv", - "key": "http://basex.org/modules/csv#doc#2", - "params": [ - "$uri as xs:string?", - "$options as map(*)?" - ], - "type": "item()?", - "description": " Fetches the CSV document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/csv#serialize#1": { - "name": "serialize", - "uri": "http://basex.org/modules/csv", - "key": "http://basex.org/modules/csv#serialize#1", - "params": [ - "$input as item()?" - ], - "type": "xs:string", - "description": " Serializes the specified $input as CSV, using the specified $options, and returns the result as string.

Values can also be serialized as CSV with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to csv, and
  • the options presented in this article need to be assigned to the csv parameter.
" - }, - "http://basex.org/modules/csv#serialize#2": { - "name": "serialize", - "uri": "http://basex.org/modules/csv", - "key": "http://basex.org/modules/csv#serialize#2", - "params": [ - "$input as item()?", - "$options as map(*)?" - ], - "type": "xs:string", - "description": " Serializes the specified $input as CSV, using the specified $options, and returns the result as string.

Values can also be serialized as CSV with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to csv, and
  • the options presented in this article need to be assigned to the csv parameter.
" - } - }, - "description": " This XQuery Module contains a single function to parse CSV input. CSV (comma-separated values) is a popular representation for tabular data, exported e. g. from Excel.", - "type": "module", - "override": true - }, - "http://basex.org/modules/db": { - "ns": "http://basex.org/modules/db", - "prefixes": [ - "db" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/db#system#0": { - "name": "system", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#system#0", - "params": [], - "type": "element(system)", - "description": " Returns general information on the database system the current values of all global and local Options. The INFO command returns similar output." - }, - "http://basex.org/modules/db#option#1": { - "name": "option", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#option#1", - "params": [ - "$name as xs:string" - ], - "type": "xs:string", - "description": " Returns the current value (string, integer, boolean, map) of a global or local Option with the specified $name. The GET command works similar." - }, - "http://basex.org/modules/db#info#1": { - "name": "info", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#info#1", - "params": [ - "$db as xs:string" - ], - "type": "element(database)", - "description": " Returns meta information on the database $db. The output is similar to the INFO DB command." - }, - "http://basex.org/modules/db#property#2": { - "name": "property", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#property#2", - "params": [ - "$db as xs:string", - "$name as xs:string" - ], - "type": "xs:anyAtomicType", - "description": " Returns the value (string, boolean, integer) of a property with the specified $name in the database $db. The available properties are the ones returned by db:info." - }, - "http://basex.org/modules/db#list#0": { - "name": "list", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#list#0", - "params": [], - "type": "xs:string*", - "description": " The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
" - }, - "http://basex.org/modules/db#list#1": { - "name": "list", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#list#1", - "params": [ - "$db as xs:string" - ], - "type": "xs:string*", - "description": " The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
" - }, - "http://basex.org/modules/db#list#2": { - "name": "list", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#list#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "xs:string*", - "description": " The result of this function is dependent on the number of arguments:
  • Without arguments, the names of all databases are returned that are accessible to the current user.
  • If a database $db is specified, all documents and raw files of the specified database are returned.
  • The list of returned resources can be restricted by the $path argument.
" - }, - "http://basex.org/modules/db#list-details#0": { - "name": "list-details", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#list-details#0", - "params": [], - "type": "element(database)*", - "description": " Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
" - }, - "http://basex.org/modules/db#list-details#1": { - "name": "list-details", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#list-details#1", - "params": [ - "$db as xs:string" - ], - "type": "element(resource)*", - "description": " Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
" - }, - "http://basex.org/modules/db#list-details#2": { - "name": "list-details", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#list-details#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "element(resource)*", - "description": " Without arguments, an element is returned for each database that is accessible to the current user:
  • An element has a value, which is the name of the database, and several attributes, which contain the number of stored resources, the modification date, the database size on disk (measured in bytes), and a path to the original database input.

If a database $db is specified, an element for each documents and raw file of the specified database is returned:

  • An element has a value, which is the name of the resource, and several attributes, which contain the content type, the modification date, the raw flag (which indicates if the resource is binary or XML), and the size of a resource.
  • The value of the size attribute depends on the resource type: for documents, it represents the number of nodes; for binary data, it represents the file size (measured in bytes).
  • Returned databases resources can be further restricted by the $path argument.
" - }, - "http://basex.org/modules/db#dir#2": { - "name": "dir", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#dir#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "element()*", - "description": " Returns meta data on all directories and resources of the database $db in the specified directory $path. Two types of elements are returned:
  • resource represents a resource. The element value is the directory path; content type, modification date, raw flag (which indicates if the resource is binary or XML), and size of the resource are returned as attributes.
  • dir represents a directory. The element value is the directory path; the modification date is returned as attribute.

Please note that directories are not stored in BaseX. Instead, they result implicitly from the paths of stored resources.

" - }, - "http://basex.org/modules/db#open#1": { - "name": "open", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#open#1", - "params": [ - "$db as xs:string" - ], - "type": "document-node()*", - "description": " Opens the database $db and returns all document nodes.
The document nodes to be returned can be filtered with the $path argument." - }, - "http://basex.org/modules/db#open#2": { - "name": "open", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#open#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "document-node()*", - "description": " Opens the database $db and returns all document nodes.
The document nodes to be returned can be filtered with the $path argument." - }, - "http://basex.org/modules/db#open-pre#2": { - "name": "open-pre", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#open-pre#2", - "params": [ - "$db as xs:string", - "$pres as xs:integer*" - ], - "type": "node()*", - "description": " Opens the database $db and returns all distinct nodes with the pre values $pres in document order.
The PRE value provides very fast access to an existing database node, but it will change whenever a node with a smaller pre values is added to or deleted from a database." - }, - "http://basex.org/modules/db#open-id#2": { - "name": "open-id", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#open-id#2", - "params": [ - "$db as xs:string", - "$ids as xs:integer*" - ], - "type": "node()*", - "description": " Opens the database $db and returns all distinct nodes with the specified $ids in document order.
Each database node has a persistent ID value. Access to the node id can be sped up by turning on the UPDINDEX option." - }, - "http://basex.org/modules/db#node-pre#1": { - "name": "node-pre", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#node-pre#1", - "params": [ - "$nodes as node()*" - ], - "type": "xs:integer*", - "description": " Returns the pre values of the specified $nodes, which must all be database nodes.
The PRE value provides very fast access to an existing database node, but it will change whenever a node with a smaller pre values is added to or deleted from a database." - }, - "http://basex.org/modules/db#node-id#1": { - "name": "node-id", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#node-id#1", - "params": [ - "$nodes as node()*" - ], - "type": "xs:integer*", - "description": " Returns the id values of the specified $nodes, which must all be database nodes.
Each database node has a persistent ID value. Access to the node id can be sped up by turning on the UPDINDEX option." - }, - "http://basex.org/modules/db#retrieve#2": { - "name": "retrieve", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#retrieve#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "xs:base64Binary", - "description": " Returns a binary resource addressed by the database $db and $path as streamable xs:base64Binary." - }, - "http://basex.org/modules/db#export#2": { - "name": "export", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#export#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "empty-sequence()", - "description": " Exports the specified database $db to the specified file $path. Existing files will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= \"div\" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { \"method\" : \"xml\" , \"cdata-section-elements\" : \"div\" , .. . } 
" - }, - "http://basex.org/modules/db#export#3": { - "name": "export", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#export#3", - "params": [ - "$db as xs:string", - "$path as xs:string", - "$params as item()" - ], - "type": "empty-sequence()", - "description": " Exports the specified database $db to the specified file $path. Existing files will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= \"div\" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { \"method\" : \"xml\" , \"cdata-section-elements\" : \"div\" , .. . } 
" - }, - "http://basex.org/modules/db#text#2": { - "name": "text", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#text#2", - "params": [ - "$db as xs:string", - "$strings as xs:string*" - ], - "type": "text()*", - "description": " Returns all text nodes of the database $db that have one of the specified $strings as values and that are stored in the text index." - }, - "http://basex.org/modules/db#text-range#3": { - "name": "text-range", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#text-range#3", - "params": [ - "$db as xs:string", - "$min as xs:string", - "$max as xs:string" - ], - "type": "text()*", - "description": " Returns all text nodes of the database $db whose values are between $min and $max and that are stored in the text index." - }, - "http://basex.org/modules/db#attribute#2": { - "name": "attribute", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#attribute#2", - "params": [ - "$db as xs:string", - "$strings as xs:string*" - ], - "type": "attribute()*", - "description": " Returns all attribute nodes of the database $db that have one of the specified $strings as values and that are stored in the attribute index.
If $name is specified, the resulting attribute nodes are filtered by their attribute name." - }, - "http://basex.org/modules/db#attribute#3": { - "name": "attribute", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#attribute#3", - "params": [ - "$db as xs:string", - "$strings as xs:string*", - "$name as xs:string" - ], - "type": "attribute()*", - "description": " Returns all attribute nodes of the database $db that have one of the specified $strings as values and that are stored in the attribute index.
If $name is specified, the resulting attribute nodes are filtered by their attribute name." - }, - "http://basex.org/modules/db#attribute-range#3": { - "name": "attribute-range", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#attribute-range#3", - "params": [ - "$db as xs:string", - "$min as xs:string", - "$max as xs:string" - ], - "type": "attribute()*", - "description": " Returns all attributes of the database $db, the string values of which are larger than or equal to $min and smaller than or equal to $max and that are stored in the attribute index." - }, - "http://basex.org/modules/db#attribute-range#4": { - "name": "attribute-range", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#attribute-range#4", - "params": [ - "$db as xs:string", - "$min as xs:string", - "$max as xs:string", - "$name as xs:string" - ], - "type": "attribute()*", - "description": " Returns all attributes of the database $db, the string values of which are larger than or equal to $min and smaller than or equal to $max and that are stored in the attribute index." - }, - "http://basex.org/modules/db#token#2": { - "name": "token", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#token#2", - "params": [ - "$db as xs:string", - "$tokens as xs:string*" - ], - "type": "attribute()*", - "description": " Returns all attribute nodes of the database $db the values of which contain one of the specified $tokens.
If $name is specified, the resulting attribute nodes are filtered by their attribute name." - }, - "http://basex.org/modules/db#token#3": { - "name": "token", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#token#3", - "params": [ - "$db as xs:string", - "$tokens as xs:string*", - "$name as xs:string" - ], - "type": "attribute()*", - "description": " Returns all attribute nodes of the database $db the values of which contain one of the specified $tokens.
If $name is specified, the resulting attribute nodes are filtered by their attribute name." - }, - "http://basex.org/modules/db#create#1": { - "name": "create", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#create#1", - "params": [ - "$db as xs:string" - ], - "type": "empty-sequence()", - "description": " Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
" - }, - "http://basex.org/modules/db#create#2": { - "name": "create", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#create#2", - "params": [ - "$db as xs:string", - "$inputs as item()*" - ], - "type": "empty-sequence()", - "description": " Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
" - }, - "http://basex.org/modules/db#create#3": { - "name": "create", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#create#3", - "params": [ - "$db as xs:string", - "$inputs as item()*", - "$paths as xs:string*" - ], - "type": "empty-sequence()", - "description": " Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
" - }, - "http://basex.org/modules/db#create#4": { - "name": "create", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#create#4", - "params": [ - "$db as xs:string", - "$inputs as item()*", - "$paths as xs:string*", - "$options as map(*)?" - ], - "type": "empty-sequence()", - "description": " Creates a new database with name $db and adds initial documents specified via $inputs to the specified $paths:
  • $inputs may be strings or nodes:
    • nodes may be of any type except for attributes
    • strings can be a URI pointing to a file/directory or an XML string (which is detected by the leading < character)
    • a path must be specified if the input is not a file or directory reference
  • The parsing and indexing behavior can be controlled via $options:
  • An existing database will be overwritten.
  • Database creation takes place after most other update operations (see Pending Update List). As a consequence, a newly created database cannot be addressed in the same query.
" - }, - "http://basex.org/modules/db#drop#1": { - "name": "drop", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#drop#1", - "params": [ - "$db as xs:string" - ], - "type": "empty-sequence()", - "description": " Drops the database $db and all connected resources." - }, - "http://basex.org/modules/db#add#2": { - "name": "add", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#add#2", - "params": [ - "$db as xs:string", - "$input as item()" - ], - "type": "empty-sequence()", - "description": " Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:replace instead.
  • See db:create for more details on the input and path arguments.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
" - }, - "http://basex.org/modules/db#add#3": { - "name": "add", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#add#3", - "params": [ - "$db as xs:string", - "$input as item()", - "$path as xs:string?" - ], - "type": "empty-sequence()", - "description": " Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:replace instead.
  • See db:create for more details on the input and path arguments.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
" - }, - "http://basex.org/modules/db#add#4": { - "name": "add", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#add#4", - "params": [ - "$db as xs:string", - "$input as item()", - "$path as xs:string?", - "$options as map(*)?" - ], - "type": "empty-sequence()", - "description": " Adds documents specified by $input to the database $db with the specified $path:
  • A document with the same path may occur more than once in a database. If you want to enforce single instances, use db:replace instead.
  • See db:create for more details on the input and path arguments.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
" - }, - "http://basex.org/modules/db#delete#2": { - "name": "delete", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#delete#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "empty-sequence()", - "description": " Deletes resource(s), specified by $path, from the database $db." - }, - "http://basex.org/modules/db#copy#2": { - "name": "copy", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#copy#2", - "params": [ - "$db as xs:string", - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Creates a copy of the database $db, which will be called $name." - }, - "http://basex.org/modules/db#alter#2": { - "name": "alter", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#alter#2", - "params": [ - "$db as xs:string", - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Renames the database $db to $name." - }, - "http://basex.org/modules/db#optimize#1": { - "name": "optimize", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#optimize#1", - "params": [ - "$db as xs:string" - ], - "type": "empty-sequence()", - "description": " Optimizes the meta data and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true." - }, - "http://basex.org/modules/db#optimize#2": { - "name": "optimize", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#optimize#2", - "params": [ - "$db as xs:string", - "$all as xs:boolean" - ], - "type": "empty-sequence()", - "description": " Optimizes the meta data and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true." - }, - "http://basex.org/modules/db#optimize#3": { - "name": "optimize", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#optimize#3", - "params": [ - "$db as xs:string", - "$all as xs:boolean", - "$options as map(*)?" - ], - "type": "empty-sequence()", - "description": " Optimizes the meta data and indexes of the database $db.
If $all is true, the complete database will be rebuilt.
The $options argument can be used to control indexing. The syntax is identical to the db:create function: Allowed options are all indexing and full-text options. UPDINDEX is only supported if $all is true." - }, - "http://basex.org/modules/db#rename#3": { - "name": "rename", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#rename#3", - "params": [ - "$db as xs:string", - "$source as xs:string", - "$target as xs:string" - ], - "type": "empty-sequence()", - "description": " Moves all resources(s) of database $db, which are found in the supplied $source path, to the supplied $target path. The paths may point to single resources or directories. No updates will take place if a non-existing source path is supplied." - }, - "http://basex.org/modules/db#replace#3": { - "name": "replace", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#replace#3", - "params": [ - "$db as xs:string", - "$path as xs:string", - "$input as item()" - ], - "type": "empty-sequence()", - "description": " Replaces a resource, specified by $path, in the database $db with the contents of $input, or adds it as a new resource:
  • See db:create for more details on the input argument.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
  • For historical reasons, the order of the 2nd and 3rd argument is different to db:add and db:create
" - }, - "http://basex.org/modules/db#replace#4": { - "name": "replace", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#replace#4", - "params": [ - "$db as xs:string", - "$path as xs:string", - "$input as item()", - "$options as map(*)?" - ], - "type": "empty-sequence()", - "description": " Replaces a resource, specified by $path, in the database $db with the contents of $input, or adds it as a new resource:
  • See db:create for more details on the input argument.
  • The parsing behavior can be controlled via $options:
    • allowed options are ADDCACHE and the parsing and XML parsing options, all in lower case
    • parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed
  • For historical reasons, the order of the 2nd and 3rd argument is different to db:add and db:create
" - }, - "http://basex.org/modules/db#store#3": { - "name": "store", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#store#3", - "params": [ - "$db as xs:string", - "$path as xs:string", - "$input as item()" - ], - "type": "empty-sequence()", - "description": " Replaces a binary resource specified by $input in the database $db and the location specified by $path, or adds it as new resource." - }, - "http://basex.org/modules/db#flush#1": { - "name": "flush", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#flush#1", - "params": [ - "$db as xs:string" - ], - "type": "empty-sequence()", - "description": " Explicitly flushes the buffers of the database $db. This command is only useful if AUTOFLUSH has been set to false." - }, - "http://basex.org/modules/db#create-backup#1": { - "name": "create-backup", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#create-backup#1", - "params": [ - "$db as xs:string" - ], - "type": "empty-sequence()", - "description": " Creates a backup of the database $db. If no name is supplied, general data will be backed up. The following $options are available:
  • With comment, a comment string can be attached to the backup.
  • By setting compress to false, the backup will be created faster, but it will take more space on disk.
" - }, - "http://basex.org/modules/db#create-backup#2": { - "name": "create-backup", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#create-backup#2", - "params": [ - "$db as xs:string", - "$options as map(*)" - ], - "type": "empty-sequence()", - "description": " Creates a backup of the database $db. If no name is supplied, general data will be backed up. The following $options are available:
  • With comment, a comment string can be attached to the backup.
  • By setting compress to false, the backup will be created faster, but it will take more space on disk.
" - }, - "http://basex.org/modules/db#drop-backup#1": { - "name": "drop-backup", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#drop-backup#1", - "params": [ - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Drops all backups of the database with the specified $name. If the name ends with a timestamp, only the specified backup file will be deleted. If no name is supplied, backups with general data are addressed." - }, - "http://basex.org/modules/db#alter-backup#2": { - "name": "alter-backup", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#alter-backup#2", - "params": [ - "$name as xs:string", - "$new-name as xs:string" - ], - "type": "empty-sequence()", - "description": " Renames all backups of the database with the specified $name to $new-name. If the name ends with a date, only the specified backup file will be renamed." - }, - "http://basex.org/modules/db#restore#1": { - "name": "restore", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#restore#1", - "params": [ - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Restores the database with the specified $name. The $name may include the timestamp of the backup file. If no name is supplied, general data will be restored. If general data is restored, it will only be available after BaseX has been restarted." - }, - "http://basex.org/modules/db#backups#0": { - "name": "backups", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#backups#0", - "params": [], - "type": "element(backup)*", - "description": " Returns an element sequence containing all available database backups with timestamp, file size and comment.
If a database $db is specified, the sequence will be restricted to the backups matching this database." - }, - "http://basex.org/modules/db#backups#1": { - "name": "backups", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#backups#1", - "params": [ - "$db as xs:string" - ], - "type": "element(backup)*", - "description": " Returns an element sequence containing all available database backups with timestamp, file size and comment.
If a database $db is specified, the sequence will be restricted to the backups matching this database." - }, - "http://basex.org/modules/db#name#1": { - "name": "name", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#name#1", - "params": [ - "$node as node()" - ], - "type": "xs:string", - "description": " Returns the name of the database in which the specified database node $node is stored." - }, - "http://basex.org/modules/db#path#1": { - "name": "path", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#path#1", - "params": [ - "$node as node()" - ], - "type": "xs:string", - "description": " Returns the path of the database document in which the specified database node $node is stored." - }, - "http://basex.org/modules/db#exists#1": { - "name": "exists", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#exists#1", - "params": [ - "$db as xs:string" - ], - "type": "xs:boolean", - "description": " Checks if the database $db or the resource specified by $path exists. false is returned if a database directory has been addressed." - }, - "http://basex.org/modules/db#exists#2": { - "name": "exists", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#exists#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "xs:boolean", - "description": " Checks if the database $db or the resource specified by $path exists. false is returned if a database directory has been addressed." - }, - "http://basex.org/modules/db#is-raw#2": { - "name": "is-raw", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#is-raw#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "xs:boolean", - "description": " Checks if the specified resource in the database $db and the path $path exists, and if it is a binary resource." - }, - "http://basex.org/modules/db#is-xml#2": { - "name": "is-xml", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#is-xml#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "xs:boolean", - "description": " Checks if the specified resource in the database $db and the path $path exists, and if it is an XML document." - }, - "http://basex.org/modules/db#content-type#2": { - "name": "content-type", - "uri": "http://basex.org/modules/db", - "key": "http://basex.org/modules/db#content-type#2", - "params": [ - "$db as xs:string", - "$path as xs:string" - ], - "type": "xs:string", - "description": " Retrieves the content type of a resource in the database $db and the path $path.
The file extension is used to recognize the content-type of a resource stored in the database. Content-type application/xml will be returned for any XML document stored in the database, regardless of its file name extension." - } - }, - "description": " This XQuery Module contains functions for processing databases from within XQuery. Existing databases can be opened and listed, its contents can be directly accessed, documents can be added to and removed, etc.", - "type": "module", - "override": true - }, - "http://basex.org/modules/fetch": { - "ns": "http://basex.org/modules/fetch", - "prefixes": [ - "fetch" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/fetch#binary#1": { - "name": "binary", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#binary#1", - "params": [ - "$uri as xs:string" - ], - "type": "xs:base64Binary", - "description": " Fetches the resource referred to by the given URI and returns it as lazy xs:base64Binary item." - }, - "http://basex.org/modules/fetch#text#1": { - "name": "text", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#text#1", - "params": [ - "$uri as xs:string" - ], - "type": "xs:string", - "description": " Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://basex.org/modules/fetch#text#2": { - "name": "text", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#text#2", - "params": [ - "$uri as xs:string", - "$encoding as xs:string" - ], - "type": "xs:string", - "description": " Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://basex.org/modules/fetch#text#3": { - "name": "text", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#text#3", - "params": [ - "$uri as xs:string", - "$encoding as xs:string", - "$fallback as xs:boolean" - ], - "type": "xs:string", - "description": " Fetches the resource referred to by the given $uri and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://basex.org/modules/fetch#xml#1": { - "name": "xml", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#xml#1", - "params": [ - "$uri as xs:string" - ], - "type": "document-node()", - "description": " Fetches the resource referred to by the given $uri and returns it as document node.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case.
The function is different to fn:doc in various aspects:
  • As it is non-deterministic, a new document node will be created by each call of this function.
  • A document created by this function will be garbage-collected as soon as it is not referenced anymore.
  • URIs will not be resolved against existing databases. As a result, it will not trigger any locks (see limitations of database locking for more details).
" - }, - "http://basex.org/modules/fetch#xml#2": { - "name": "xml", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#xml#2", - "params": [ - "$uri as xs:string", - "$options as map(*)?" - ], - "type": "document-node()", - "description": " Fetches the resource referred to by the given $uri and returns it as document node.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case.
The function is different to fn:doc in various aspects:
  • As it is non-deterministic, a new document node will be created by each call of this function.
  • A document created by this function will be garbage-collected as soon as it is not referenced anymore.
  • URIs will not be resolved against existing databases. As a result, it will not trigger any locks (see limitations of database locking for more details).
" - }, - "http://basex.org/modules/fetch#xml-binary#1": { - "name": "xml-binary", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#xml-binary#1", - "params": [ - "$data as xs:base64Binary" - ], - "type": "document-node()", - "description": " Parses binary $data and returns it as document node.
In contrast to fn:parse-xml, which expects an XQuery string, the input of this function can be arbitrarily encoded. The encoding will be derived from the XML declaration or (in case of UTF16 or UTF32) from the first bytes of the input.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case." - }, - "http://basex.org/modules/fetch#xml-binary#2": { - "name": "xml-binary", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#xml-binary#2", - "params": [ - "$data as xs:base64Binary", - "$options as map(*)?" - ], - "type": "document-node()", - "description": " Parses binary $data and returns it as document node.
In contrast to fn:parse-xml, which expects an XQuery string, the input of this function can be arbitrarily encoded. The encoding will be derived from the XML declaration or (in case of UTF16 or UTF32) from the first bytes of the input.
The $options argument can be used to change the parsing behavior. Allowed options are all parsing and XML parsing options in lower case." - }, - "http://basex.org/modules/fetch#content-type#1": { - "name": "content-type", - "uri": "http://basex.org/modules/fetch", - "key": "http://basex.org/modules/fetch#content-type#1", - "params": [ - "$uri as xs:string" - ], - "type": "xs:string", - "description": " Returns the content-type (also called mime-type) of the resource specified by $uri:
  • If a remote resource is addressed, the request header will be evaluated.
  • If the addressed resource is locally stored, the content-type will be guessed based on the file extension.
" - } - }, - "description": " This XQuery Module provides simple functions to fetch the content of resources identified by URIs. Resources can be stored locally or remotely and e.g. use the file:// or http:// scheme. If more control over HTTP requests is required, the HTTP Client Module can be used. With the HTML Module, retrieved HTML documents can be converted to XML.", - "type": "module", - "override": true - }, - "http://expath.org/ns/file": { - "ns": "http://expath.org/ns/file", - "prefixes": [ - "file" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://expath.org/ns/file#list#1": { - "name": "list", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#list#1", - "params": [ - "$dir as xs:string" - ], - "type": "xs:string*", - "description": " Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether sub-directories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
" - }, - "http://expath.org/ns/file#list#2": { - "name": "list", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#list#2", - "params": [ - "$dir as xs:string", - "$recursive as xs:boolean" - ], - "type": "xs:string*", - "description": " Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether sub-directories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
" - }, - "http://expath.org/ns/file#list#3": { - "name": "list", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#list#3", - "params": [ - "$dir as xs:string", - "$recursive as xs:boolean", - "$pattern as xs:string" - ], - "type": "xs:string*", - "description": " Lists all files and directories found in the specified $dir. The returned paths are relative to the provided path.
The optional parameter $recursive specifies whether sub-directories will be traversed, too.
The optional parameter $pattern defines a file name pattern in the Glob Syntax. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (,).
" - }, - "http://expath.org/ns/file#children#1": { - "name": "children", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#children#1", - "params": [ - "$dir as xs:string" - ], - "type": "xs:string*", - "description": " Returns the full paths to all files and directories found in the specified $dir.
The inverse function is file:parent. The related function file:list returns relative file paths." - }, - "http://expath.org/ns/file#descendants#1": { - "name": "descendants", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#descendants#1", - "params": [ - "$dir as xs:string" - ], - "type": "xs:string*", - "description": " Returns the full paths to all files and directories found in the specified $dir and its sub-directories.
. The related function file:list returns relative file paths." - }, - "http://expath.org/ns/file#read-binary#1": { - "name": "read-binary", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-binary#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:base64Binary", - "description": " Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file." - }, - "http://expath.org/ns/file#read-binary#2": { - "name": "read-binary", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-binary#2", - "params": [ - "$path as xs:string", - "$offset as xs:integer" - ], - "type": "xs:base64Binary", - "description": " Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file." - }, - "http://expath.org/ns/file#read-binary#3": { - "name": "read-binary", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-binary#3", - "params": [ - "$path as xs:string", - "$offset as xs:integer", - "$length as xs:integer" - ], - "type": "xs:base64Binary", - "description": " Reads the binary content of the file specified by $path and returns it as lazy xs:base64Binary item.
The optional parameters $offset and $length can be used to read chunks of a file." - }, - "http://expath.org/ns/file#read-text#1": { - "name": "read-text", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string", - "description": " Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://expath.org/ns/file#read-text#2": { - "name": "read-text", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text#2", - "params": [ - "$path as xs:string", - "$encoding as xs:string" - ], - "type": "xs:string", - "description": " Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://expath.org/ns/file#read-text#3": { - "name": "read-text", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text#3", - "params": [ - "$path as xs:string", - "$encoding as xs:string", - "$fallback as xs:boolean" - ], - "type": "xs:string", - "description": " Reads the textual contents of the file specified by $path and returns it as lazy xs:string item:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).
" - }, - "http://expath.org/ns/file#read-text-lines#1": { - "name": "read-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text-lines#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string*", - "description": " Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

" - }, - "http://expath.org/ns/file#read-text-lines#2": { - "name": "read-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text-lines#2", - "params": [ - "$path as xs:string", - "$encoding as xs:string" - ], - "type": "xs:string*", - "description": " Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

" - }, - "http://expath.org/ns/file#read-text-lines#3": { - "name": "read-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text-lines#3", - "params": [ - "$path as xs:string", - "$encoding as xs:string", - "$fallback as xs:boolean" - ], - "type": "xs:string*", - "description": " Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

" - }, - "http://expath.org/ns/file#read-text-lines#4": { - "name": "read-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text-lines#4", - "params": [ - "$path as xs:string", - "$encoding as xs:string", - "$fallback as xs:boolean", - "$offset as xs:integer" - ], - "type": "xs:string*", - "description": " Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

" - }, - "http://expath.org/ns/file#read-text-lines#5": { - "name": "read-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#read-text-lines#5", - "params": [ - "$path as xs:string", - "$encoding as xs:string", - "$fallback as xs:boolean", - "$offset as xs:integer", - "$length as xs:integer" - ], - "type": "xs:string*", - "description": " Reads the textual contents of the file specified by $path and returns it as a sequence of xs:string items:
  • The UTF-8 default encoding can be overwritten with the optional $encoding argument.
  • By default, invalid characters will be rejected. If $fallback is set to true, these characters will be replaced with the Unicode replacement character FFFD (�).

The lines to be read can be restricted with the optional parameters $offset and $length.

" - }, - "http://expath.org/ns/file#create-dir#1": { - "name": "create-dir", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#create-dir#1", - "params": [ - "$dir as xs:string" - ], - "type": "empty-sequence()", - "description": " Creates the directory specified by $dir if it does not already exist. Non-existing parent directories will be created as well.
" - }, - "http://expath.org/ns/file#create-temp-dir#2": { - "name": "create-temp-dir", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#create-temp-dir#2", - "params": [ - "$prefix as xs:string", - "$suffix as xs:string" - ], - "type": "xs:string", - "description": " Creates a new temporary directory that did not exist before this function was called, and returns its full file path. The directory name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the directory will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories." - }, - "http://expath.org/ns/file#create-temp-dir#3": { - "name": "create-temp-dir", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#create-temp-dir#3", - "params": [ - "$prefix as xs:string", - "$suffix as xs:string", - "$dir as xs:string" - ], - "type": "xs:string", - "description": " Creates a new temporary directory that did not exist before this function was called, and returns its full file path. The directory name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the directory will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories." - }, - "http://expath.org/ns/file#create-temp-file#2": { - "name": "create-temp-file", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#create-temp-file#2", - "params": [ - "$prefix as xs:string", - "$suffix as xs:string" - ], - "type": "xs:string", - "description": " Creates a new temporary file that did not exist before this function was called, and returns its full file path. The file name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the file will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories." - }, - "http://expath.org/ns/file#create-temp-file#3": { - "name": "create-temp-file", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#create-temp-file#3", - "params": [ - "$prefix as xs:string", - "$suffix as xs:string", - "$dir as xs:string" - ], - "type": "xs:string", - "description": " Creates a new temporary file that did not exist before this function was called, and returns its full file path. The file name begins and ends with the specified $prefix and $suffix. If no directory is specified via $dir, the file will be placed in the system’s default temporary directory. The operation will create all non-existing parent directories." - }, - "http://expath.org/ns/file#delete#1": { - "name": "delete", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#delete#1", - "params": [ - "$path as xs:string" - ], - "type": "empty-sequence()", - "description": " Recursively deletes a file or directory specified by $path.
The optional parameter $recursive specifies whether sub-directories will be deleted, too.
" - }, - "http://expath.org/ns/file#delete#2": { - "name": "delete", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#delete#2", - "params": [ - "$path as xs:string", - "$recursive as xs:boolean" - ], - "type": "empty-sequence()", - "description": " Recursively deletes a file or directory specified by $path.
The optional parameter $recursive specifies whether sub-directories will be deleted, too.
" - }, - "http://expath.org/ns/file#write#2": { - "name": "write", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write#2", - "params": [ - "$path as xs:string", - "$items as item()*" - ], - "type": "empty-sequence()", - "description": " Writes a serialized sequence of items to the specified file. If the file already exists, it will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= \"div\" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { \"method\" : \"xml\" , \"cdata-section-elements\" : \"div\" , .. . } 
" - }, - "http://expath.org/ns/file#write#3": { - "name": "write", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write#3", - "params": [ - "$path as xs:string", - "$items as item()*", - "$params as item()" - ], - "type": "empty-sequence()", - "description": " Writes a serialized sequence of items to the specified file. If the file already exists, it will be overwritten.
The $params argument contains serialization parameters. As with fn:serialize(), the parameters can be specified
  • either as children of an <output:serialization-parameters/> element:
  <output:serialization-parameters> <output:method value= 'xml' /> <output:cdata-section-elements value= \"div\" /> ... </output:serialization-parameters> 
  • or as map, which contains all key/value pairs:
  map { \"method\" : \"xml\" , \"cdata-section-elements\" : \"div\" , .. . } 
" - }, - "http://expath.org/ns/file#write-binary#2": { - "name": "write-binary", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write-binary#2", - "params": [ - "$path as xs:string", - "$value as xs:anyAtomicType" - ], - "type": "empty-sequence()", - "description": " Writes a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file already exists, it will be overwritten.
If $offset is specified, data will be written at this file position. An existing file may be resized by that operation." - }, - "http://expath.org/ns/file#write-binary#3": { - "name": "write-binary", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write-binary#3", - "params": [ - "$path as xs:string", - "$value as xs:anyAtomicType", - "$offset as xs:integer" - ], - "type": "empty-sequence()", - "description": " Writes a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file already exists, it will be overwritten.
If $offset is specified, data will be written at this file position. An existing file may be resized by that operation." - }, - "http://expath.org/ns/file#write-text#2": { - "name": "write-text", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write-text#2", - "params": [ - "$path as xs:string", - "$value as xs:string" - ], - "type": "empty-sequence()", - "description": " Writes a string to the specified file. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#write-text#3": { - "name": "write-text", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write-text#3", - "params": [ - "$path as xs:string", - "$value as xs:string", - "$encoding as xs:string" - ], - "type": "empty-sequence()", - "description": " Writes a string to the specified file. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#write-text-lines#2": { - "name": "write-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write-text-lines#2", - "params": [ - "$path as xs:string", - "$values as xs:string*" - ], - "type": "empty-sequence()", - "description": " Writes a sequence of strings to the specified file, each followed by the system specific newline character. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#write-text-lines#3": { - "name": "write-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#write-text-lines#3", - "params": [ - "$path as xs:string", - "$values as xs:string*", - "$encoding as xs:string" - ], - "type": "empty-sequence()", - "description": " Writes a sequence of strings to the specified file, each followed by the system specific newline character. If the file already exists, it will be overwritten.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#append#2": { - "name": "append", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#append#2", - "params": [ - "$path as xs:string", - "$items as item()*" - ], - "type": "empty-sequence()", - "description": " Appends a serialized sequence of items to the specified file. If the file does not exists, a new file is created.
" - }, - "http://expath.org/ns/file#append#3": { - "name": "append", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#append#3", - "params": [ - "$path as xs:string", - "$items as item()*", - "$params as item()" - ], - "type": "empty-sequence()", - "description": " Appends a serialized sequence of items to the specified file. If the file does not exists, a new file is created.
" - }, - "http://expath.org/ns/file#append-binary#2": { - "name": "append-binary", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#append-binary#2", - "params": [ - "$path as xs:string", - "$value as xs:anyAtomicType" - ], - "type": "empty-sequence()", - "description": " Appends a binary item (xs:base64Binary, xs:hexBinary) to the specified file. If the file does not exists, a new one is created.
" - }, - "http://expath.org/ns/file#append-text#2": { - "name": "append-text", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#append-text#2", - "params": [ - "$path as xs:string", - "$value as xs:string" - ], - "type": "empty-sequence()", - "description": " Appends a string to a file specified by $path. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#append-text#3": { - "name": "append-text", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#append-text#3", - "params": [ - "$path as xs:string", - "$value as xs:string", - "$encoding as xs:string" - ], - "type": "empty-sequence()", - "description": " Appends a string to a file specified by $path. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#append-text-lines#2": { - "name": "append-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#append-text-lines#2", - "params": [ - "$path as xs:string", - "$values as xs:string*" - ], - "type": "empty-sequence()", - "description": " Appends a sequence of strings to the specified file, each followed by the system specific newline character. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#append-text-lines#3": { - "name": "append-text-lines", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#append-text-lines#3", - "params": [ - "$path as xs:string", - "$values as xs:string*", - "$encoding as xs:string" - ], - "type": "empty-sequence()", - "description": " Appends a sequence of strings to the specified file, each followed by the system specific newline character. If the specified file does not exists, a new file is created.
The optional parameter $encoding defines the output encoding (default: UTF-8).
" - }, - "http://expath.org/ns/file#copy#2": { - "name": "copy", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#copy#2", - "params": [ - "$source as xs:string", - "$target as xs:string" - ], - "type": "empty-sequence()", - "description": " Copies a file or directory specified by $source to the file or directory specified by $target. If the target file already exists, it will be overwritten. No operation will be performed if the source and target path are equal.
" - }, - "http://expath.org/ns/file#move#2": { - "name": "move", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#move#2", - "params": [ - "$source as xs:string", - "$target as xs:string" - ], - "type": "empty-sequence()", - "description": " Moves or renames the file or directory specified by $source to the path specified by $target. If the target file already exists, it will be overwritten. No operation will be performed if the source and target path are equal.
" - }, - "http://expath.org/ns/file#exists#1": { - "name": "exists", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#exists#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:boolean", - "description": " Returns an xs:boolean indicating whether a file or directory specified by $path exists in the file system.
" - }, - "http://expath.org/ns/file#is-dir#1": { - "name": "is-dir", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#is-dir#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:boolean", - "description": " Returns an xs:boolean indicating whether the argument $path points to an existing directory.
" - }, - "http://expath.org/ns/file#is-absolute#1": { - "name": "is-absolute", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#is-absolute#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:boolean", - "description": " Returns an xs:boolean indicating whether the argument $path is absolute.
The behavior of this function depends on the operating system: On Windows, an absolute path starts with the drive letter and a colon, whereas on Linux it starts with a slash." - }, - "http://expath.org/ns/file#is-file#1": { - "name": "is-file", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#is-file#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:boolean", - "description": " Returns an xs:boolean indicating whether the argument $path points to an existing file.
" - }, - "http://expath.org/ns/file#last-modified#1": { - "name": "last-modified", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#last-modified#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:dateTime", - "description": " Retrieves the timestamp of the last modification of the file or directory specified by $path.
" - }, - "http://expath.org/ns/file#size#1": { - "name": "size", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#size#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:integer", - "description": " Returns the size, in bytes, of the file specified by $path, or 0 for directories.
" - }, - "http://expath.org/ns/file#name#1": { - "name": "name", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#name#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string", - "description": " Returns the name of a file or directory specified by $path. An empty string is returned if the path points to the root directory." - }, - "http://expath.org/ns/file#parent#1": { - "name": "parent", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#parent#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string?", - "description": " Returns the absolute path to the parent directory of a file or directory specified by $path. An empty sequence is returned if the path points to a root directory.
The inverse function is file:children.
" - }, - "http://expath.org/ns/file#path-to-native#1": { - "name": "path-to-native", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#path-to-native#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string", - "description": " Transforms the $path argument to its native representation on the operating system.
" - }, - "http://expath.org/ns/file#resolve-path#1": { - "name": "resolve-path", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#resolve-path#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string", - "description": " Transforms the $path argument to an absolute operating system path.
If the path is relative, and if an absolute $base path is specified, it will be resolved against this path." - }, - "http://expath.org/ns/file#resolve-path#2": { - "name": "resolve-path", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#resolve-path#2", - "params": [ - "$path as xs:string", - "$base as xs:string" - ], - "type": "xs:string", - "description": " Transforms the $path argument to an absolute operating system path.
If the path is relative, and if an absolute $base path is specified, it will be resolved against this path." - }, - "http://expath.org/ns/file#path-to-uri#1": { - "name": "path-to-uri", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#path-to-uri#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string", - "description": " Transforms the path specified by $path into a URI with the file:// scheme.
" - }, - "http://expath.org/ns/file#dir-separator#0": { - "name": "dir-separator", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#dir-separator#0", - "params": [], - "type": "xs:string", - "description": " Returns the directory separator used by the operating system, such as / or \\.
" - }, - "http://expath.org/ns/file#path-separator#0": { - "name": "path-separator", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#path-separator#0", - "params": [], - "type": "xs:string", - "description": " Returns the path separator used by the operating system, such as ; or :.
" - }, - "http://expath.org/ns/file#line-separator#0": { - "name": "line-separator", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#line-separator#0", - "params": [], - "type": "xs:string", - "description": " Returns the line separator used by the operating system, such as &#10;, &#13;&#10; or &#13;.
" - }, - "http://expath.org/ns/file#temp-dir#0": { - "name": "temp-dir", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#temp-dir#0", - "params": [], - "type": "xs:string", - "description": " Returns the system’s default temporary-file directory.
" - }, - "http://expath.org/ns/file#current-dir#0": { - "name": "current-dir", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#current-dir#0", - "params": [], - "type": "xs:string", - "description": " Returns the current working directory. This function returns the same result as the function call file:resolve-path(\"\")." - }, - "http://expath.org/ns/file#base-dir#0": { - "name": "base-dir", - "uri": "http://expath.org/ns/file", - "key": "http://expath.org/ns/file#base-dir#0", - "params": [], - "type": "xs:string?", - "description": " Returns the parent directory of the static base URI. If the Base URI property is undefined, the empty sequence is returned. - If a static base URI exists, and if points to a local file path, this function returns the same result as the expression file:parent(static-base-uri())." - } - }, - "description": " This XQuery Module contains functions related to file system operations, such as listing, reading, or writing files.", - "type": "module", - "override": true - }, - "http://basex.org/modules/ft": { - "ns": "http://basex.org/modules/ft", - "prefixes": [ - "ft" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/ft#search#2": { - "name": "search", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#search#2", - "params": [ - "$db as xs:string", - "$terms as item()*" - ], - "type": "text()*", - "description": " Returns all text nodes from the full-text index of the database $db that contain the specified $terms.
The options used for tokenizing the input and building the full-text will also be applied to the search terms. As an example, if the index terms have been stemmed, the search string will be stemmed as well.

The $options argument can be used to control full-text processing. The following options are supported (the introduction on Full-Text processing gives you equivalent expressions in the XQuery Full-Text notation):

  • mode: determines the mode how tokens are searched. Allowed values are any, any word, all, all words, and phrase. any is the default search mode.
  • fuzzy: turns fuzzy querying on or off. Allowed values are true and false. By default, fuzzy querying is turned off.
  • wildcards: turns wildcard querying on or off. Allowed values are true and false. By default, wildcard querying is turned off.
  • ordered: requires that all tokens occur in the order in which they are specified. Allowed values are true and false. The default is false.
  • content: specifies that the matched tokens need to occur at the beginning or end of a searched string, or need to cover the entire string. Allowed values are start, end, and entire. By default, the option is turned off.
  • scope: defines the scope in which tokens must be located. The option has following sub options:
    • same: can be set to true or false. It specifies if tokens need to occur in the same or different units.
    • unit: can be sentence or paragraph. It specifies the unit for finding tokens.
  • window: sets up a window in which all tokens must be located. By default, the option is turned off. It has following sub options:
    • size: specifies the size of the window in terms of units.
    • unit: can be sentences, sentences or paragraphs. The default is words.
  • distance: specifies the distance in which tokens must occur. By default, the option is turned off. It has following sub options:
    • min: specifies the minimum distance in terms of units. The default is 0.
    • max: specifies the maximum distance in terms of units. The default is ∞.
    • unit: can be words, sentences or paragraphs. The default is words.
" - }, - "http://basex.org/modules/ft#search#3": { - "name": "search", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#search#3", - "params": [ - "$db as xs:string", - "$terms as item()*", - "$options as map(*)?" - ], - "type": "text()*", - "description": " Returns all text nodes from the full-text index of the database $db that contain the specified $terms.
The options used for tokenizing the input and building the full-text will also be applied to the search terms. As an example, if the index terms have been stemmed, the search string will be stemmed as well.

The $options argument can be used to control full-text processing. The following options are supported (the introduction on Full-Text processing gives you equivalent expressions in the XQuery Full-Text notation):

  • mode: determines the mode how tokens are searched. Allowed values are any, any word, all, all words, and phrase. any is the default search mode.
  • fuzzy: turns fuzzy querying on or off. Allowed values are true and false. By default, fuzzy querying is turned off.
  • wildcards: turns wildcard querying on or off. Allowed values are true and false. By default, wildcard querying is turned off.
  • ordered: requires that all tokens occur in the order in which they are specified. Allowed values are true and false. The default is false.
  • content: specifies that the matched tokens need to occur at the beginning or end of a searched string, or need to cover the entire string. Allowed values are start, end, and entire. By default, the option is turned off.
  • scope: defines the scope in which tokens must be located. The option has following sub options:
    • same: can be set to true or false. It specifies if tokens need to occur in the same or different units.
    • unit: can be sentence or paragraph. It specifies the unit for finding tokens.
  • window: sets up a window in which all tokens must be located. By default, the option is turned off. It has following sub options:
    • size: specifies the size of the window in terms of units.
    • unit: can be sentences, sentences or paragraphs. The default is words.
  • distance: specifies the distance in which tokens must occur. By default, the option is turned off. It has following sub options:
    • min: specifies the minimum distance in terms of units. The default is 0.
    • max: specifies the maximum distance in terms of units. The default is ∞.
    • unit: can be words, sentences or paragraphs. The default is words.
" - }, - "http://basex.org/modules/ft#contains#2": { - "name": "contains", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#contains#2", - "params": [ - "$input as item()*", - "$terms as item()*" - ], - "type": "xs:boolean", - "description": " Checks if the specified $input items contain the specified $terms.
The function does the same as the Full-Text expression contains text, but options can be specified more dynamically. The $options are the same as for ft:search, and the following ones in addition:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.
" - }, - "http://basex.org/modules/ft#contains#3": { - "name": "contains", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#contains#3", - "params": [ - "$input as item()*", - "$terms as item()*", - "$options as map(*)?" - ], - "type": "xs:boolean", - "description": " Checks if the specified $input items contain the specified $terms.
The function does the same as the Full-Text expression contains text, but options can be specified more dynamically. The $options are the same as for ft:search, and the following ones in addition:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.
" - }, - "http://basex.org/modules/ft#mark#1": { - "name": "mark", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#mark#1", - "params": [ - "$nodes as node()*" - ], - "type": "node()*", - "description": " Puts a marker element around the resulting $nodes of a full-text request.
The default name of the marker element is mark. An alternative name can be chosen via the optional $name argument.
Please note that:
  • The full-text expression that computes the token positions must be specified as argument of the ft:mark() function, as all position information is lost in subsequent processing steps. You may need to specify more than one full-text expression if you want to use the function in a FLWOR expression, as shown in Example 2.
  • The supplied node must be a Database Node. As shown in Example 3, update or transform can be utilized to convert a fragment to the required internal representation.
" - }, - "http://basex.org/modules/ft#mark#2": { - "name": "mark", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#mark#2", - "params": [ - "$nodes as node()*", - "$name as xs:string" - ], - "type": "node()*", - "description": " Puts a marker element around the resulting $nodes of a full-text request.
The default name of the marker element is mark. An alternative name can be chosen via the optional $name argument.
Please note that:
  • The full-text expression that computes the token positions must be specified as argument of the ft:mark() function, as all position information is lost in subsequent processing steps. You may need to specify more than one full-text expression if you want to use the function in a FLWOR expression, as shown in Example 2.
  • The supplied node must be a Database Node. As shown in Example 3, update or transform can be utilized to convert a fragment to the required internal representation.
" - }, - "http://basex.org/modules/ft#extract#1": { - "name": "extract", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#extract#1", - "params": [ - "$nodes as node()*" - ], - "type": "node()*", - "description": " Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark." - }, - "http://basex.org/modules/ft#extract#2": { - "name": "extract", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#extract#2", - "params": [ - "$nodes as node()*", - "$name as xs:string" - ], - "type": "node()*", - "description": " Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark." - }, - "http://basex.org/modules/ft#extract#3": { - "name": "extract", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#extract#3", - "params": [ - "$nodes as node()*", - "$name as xs:string", - "$length as xs:integer" - ], - "type": "node()*", - "description": " Extracts and returns relevant parts of full-text results. It puts a marker element around the resulting $nodes of a full-text index request and chops irrelevant sections of the result.
The default element name of the marker element is mark. An alternative element name can be chosen via the optional $name argument.
The default length of the returned text is 150 characters. An alternative length can be specified via the optional $length argument. Note that the effective text length may differ from the specified text due to formatting and readibility issues.
For more details on this function, please have a look at ft:mark." - }, - "http://basex.org/modules/ft#count#1": { - "name": "count", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#count#1", - "params": [ - "$nodes as node()*" - ], - "type": "xs:integer", - "description": " Returns the number of occurrences of the search terms specified in a full-text expression." - }, - "http://basex.org/modules/ft#score#1": { - "name": "score", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#score#1", - "params": [ - "$item as item()*" - ], - "type": "xs:double*", - "description": " Returns the score values (0.0 - 1.0) that have been attached to the specified items. 0 is returned a value if no score was attached." - }, - "http://basex.org/modules/ft#tokens#1": { - "name": "tokens", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#tokens#1", - "params": [ - "$db as xs:string" - ], - "type": "element(value)*", - "description": " Returns all full-text tokens stored in the index of the database $db, along with their numbers of occurrences.
If $prefix is specified, the returned nodes will be refined to the strings starting with that prefix. The prefix will be tokenized according to the full-text used for creating the index." - }, - "http://basex.org/modules/ft#tokens#2": { - "name": "tokens", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#tokens#2", - "params": [ - "$db as xs:string", - "$prefix as xs:string" - ], - "type": "element(value)*", - "description": " Returns all full-text tokens stored in the index of the database $db, along with their numbers of occurrences.
If $prefix is specified, the returned nodes will be refined to the strings starting with that prefix. The prefix will be tokenized according to the full-text used for creating the index." - }, - "http://basex.org/modules/ft#tokenize#1": { - "name": "tokenize", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#tokenize#1", - "params": [ - "$string as xs:string?" - ], - "type": "xs:string*", - "description": " Tokenizes the given $string, using the current default full-text options or the $options specified as second argument, and returns a sequence with the tokenized string. The following options are available:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.

The $options argument can be used to control full-text processing.

" - }, - "http://basex.org/modules/ft#tokenize#2": { - "name": "tokenize", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#tokenize#2", - "params": [ - "$string as xs:string?", - "$options as map(*)?" - ], - "type": "xs:string*", - "description": " Tokenizes the given $string, using the current default full-text options or the $options specified as second argument, and returns a sequence with the tokenized string. The following options are available:
  • case: determines how character case is processed. Allowed values are insensitive, sensitive, upper and lower. By default, search is case insensitive.
  • diacritics: determines how diacritical characters are processed. Allowed values are insensitive and sensitive. By default, search is diacritical insensitive.
  • stemming: determines is tokens are stemmed. Allowed values are true and false. By default, stemming is turned off.
  • language: determines the language. This option is relevant for stemming tokens. All language codes are supported. The default language is en.

The $options argument can be used to control full-text processing.

" - }, - "http://basex.org/modules/ft#normalize#1": { - "name": "normalize", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#normalize#1", - "params": [ - "$string as xs:string?" - ], - "type": "xs:string", - "description": " Normalizes the given $string, using the current default full-text options or the $options specified as second argument. The function expects the same arguments as ft:tokenize." - }, - "http://basex.org/modules/ft#normalize#2": { - "name": "normalize", - "uri": "http://basex.org/modules/ft", - "key": "http://basex.org/modules/ft#normalize#2", - "params": [ - "$string as xs:string?", - "$options as map(*)?" - ], - "type": "xs:string", - "description": " Normalizes the given $string, using the current default full-text options or the $options specified as second argument. The function expects the same arguments as ft:tokenize." - } - }, - "description": " This XQuery Module extends the Full-Text features of BaseX: The index can be directly accessed, full-text results can be marked with additional elements, or the relevant parts can be extracted. Moreover, the score value, which is generated by the contains text expression, can be explicitly requested from items.", - "type": "module", - "override": true - }, - "http://expath.org/ns/geo": { - "ns": "http://expath.org/ns/geo", - "prefixes": [ - "geo" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://expath.org/ns/geo#dimension#1": { - "name": "dimension", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#dimension#1", - "params": [ - "$geometry as element(*)" - ], - "type": "xs:integer", - "description": " Returns the dimension of the given geometry $geometry." - }, - "http://expath.org/ns/geo#geometry-type#1": { - "name": "geometry-type", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#geometry-type#1", - "params": [ - "$geometry as element(*)" - ], - "type": "xs:QName", - "description": " Returns the name of the geometry type of given geometry $geometry, if the geometry is not recognized with an error massage." - }, - "http://expath.org/ns/geo#srid#1": { - "name": "srid", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#srid#1", - "params": [ - "$geometry as element(*)" - ], - "type": "xs:integer", - "description": " Returns the ID of the Spatial Reference System used by the given geometry $geometry. Spatial Reference System information is supported in the simple way defined in the SFS. A Spatial Reference System ID (SRID) is present in each Geometry object. Geometry provides basic accessor operations for this field, but no others. The SRID is represented as an integer (based on the OpenGIS Simple Features Specifications For SQL).
Here is a difference between the EXPath Geo Module and the implementation in BaseX, since the specification return the URI." - }, - "http://expath.org/ns/geo#envelope#1": { - "name": "envelope", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#envelope#1", - "params": [ - "$geometry as element(*)" - ], - "type": "element(*)", - "description": " Returns the gml:Envelope of the given geometry $geometry. The envelope is the minimum bounding box of this geometry. If this Geometry is the empty geometry, returns an empty Point. If the Geometry is a point, returns a non-empty Point. Otherwise, returns a Polygon whose points are (minx, miny), (maxx, miny), (maxx, maxy), (minx, maxy), (minx, miny)." - }, - "http://expath.org/ns/geo#as-text#1": { - "name": "as-text", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#as-text#1", - "params": [ - "$geometry as element(*)" - ], - "type": "xs:string", - "description": " Returns the WKT (Well-known Text) representation of the given geometry $geometry. The envelope is the minimum bounding box of this geometry" - }, - "http://expath.org/ns/geo#as-binary#1": { - "name": "as-binary", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#as-binary#1", - "params": [ - "$geometry as element(*)" - ], - "type": "xs:base64Binary", - "description": " Returns the WKB (Well-known Binary) representation of the given geometry $geometry." - }, - "http://expath.org/ns/geo#is-simple#1": { - "name": "is-simple", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#is-simple#1", - "params": [ - "$geometry as element(*)" - ], - "type": "xs:boolean", - "description": " Returns whether the given geometry is simple $geometry and does not have has no anomalous geometric points (ie. the geometry does not self-intersect and does not pass through the same point more than once (may be a ring))." - }, - "http://expath.org/ns/geo#boundary#1": { - "name": "boundary", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#boundary#1", - "params": [ - "$geometry as element(*)" - ], - "type": "element(*)?", - "description": " Returns the boundary of the given geometry $geometry, in GML 2. The return value is a sequence of either gml:Point or gml:LinearRing elements as a GeometryCollection object. For a Point or MultiPoint, the boundary is the empty geometry, nothing is returned." - }, - "http://expath.org/ns/geo#num-geometries#1": { - "name": "num-geometries", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#num-geometries#1", - "params": [ - "$geometry as element(*)" - ], - "type": "xs:integer", - "description": " Returns the number of geometry in a geometry-collection $geometry, in GML. For the geometries which are not a collection, it returns the instant value 1.
This function is implemented wider than the specification and accepts all types of geometries, while the specification limits it to the collection types (MultiPoint, MultiPolygon, ...)." - }, - "http://expath.org/ns/geo#geometry-n#2": { - "name": "geometry-n", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#geometry-n#2", - "params": [ - "$geometry as element(*)", - "$geoNumber as xs:integer" - ], - "type": "element(*)", - "description": " Returns the Nth geometry in geometry-collection $geometry, in GML. For the geometries which are not a collection, it returns the geometry if geoNumber $geoNumber is 1.
This function is implemented wider than the specification and accepts all types of geometries, while the specification limits it to the collection types (MultiPoint, MultiPolygon, ...)." - }, - "http://expath.org/ns/geo#length#1": { - "name": "length", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#length#1", - "params": [ - "$geometry as element(*)" - ], - "type": "xs:double", - "description": " Returns the length of the geometry $geometry. If the geometry is a point, zero value will be returned." - }, - "http://expath.org/ns/geo#num-points#1": { - "name": "num-points", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#num-points#1", - "params": [ - "$geometry as element(*)" - ], - "type": "xs:integer", - "description": " Returns integer value of number of the points in the given geometry$geometry. It can be used not only for Lines, also any other geometry types, like MultiPolygon. For Point geometry it will return 1.
This is an implementation different from the EXPath geo specification, as it limits the input geometry type only to lines." - }, - "http://expath.org/ns/geo#area#1": { - "name": "area", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#area#1", - "params": [ - "$geometry as element(*)" - ], - "type": "xs:double", - "description": " Returns the area of the given geometry $geometry. For points and line the return value will be zero." - }, - "http://expath.org/ns/geo#centroid#1": { - "name": "centroid", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#centroid#1", - "params": [ - "$geometry as element(*)" - ], - "type": "element(*)", - "description": " Returns the mathematical centroid of the given geometry $geometry, as a gml:Point. Based on the definition, this point is not always on the surface of the geometry $geometry." - }, - "http://expath.org/ns/geo#point-on-surface#1": { - "name": "point-on-surface", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#point-on-surface#1", - "params": [ - "$geometry as element(*)" - ], - "type": "element(*)", - "description": " Returns an interior point on the given geometry $geometry, as a gml:Point. It is guaranteed to be on surface. Otherwise, the point may lie on the boundary of the geometry." - }, - "http://expath.org/ns/geo#equals#2": { - "name": "equals", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#equals#2", - "params": [ - "$geometry1 as element(*)", - "$geometry2 as element(*)" - ], - "type": "xs:boolean", - "description": " Returns whether geometry1 $geometry1 is spatially equal to $geometry2 $geometry2." - }, - "http://expath.org/ns/geo#disjoint#2": { - "name": "disjoint", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#disjoint#2", - "params": [ - "$geometry1 as element(*)", - "$geometry2 as element(*)" - ], - "type": "xs:boolean", - "description": " Returns whether geometry1 $geometry1 is spatially disjoint from $geometry2 $geometry2 (they have no point in common, they do not intersect each other, and the DE-9IM Intersection Matrix for the two geometries is FF*FF****)." - }, - "http://expath.org/ns/geo#intersects#2": { - "name": "intersects", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#intersects#2", - "params": [ - "$geometry1 as element(*)", - "$geometry2 as element(*)" - ], - "type": "xs:boolean", - "description": " Returns whether geometry1 $geometry1 is spatially intersects $geometry2 $geometry2. This is true if disjoint function of the two geometries returns false." - }, - "http://expath.org/ns/geo#touches#2": { - "name": "touches", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#touches#2", - "params": [ - "$geometry1 as element(*)", - "$geometry2 as element(*)" - ], - "type": "xs:boolean", - "description": " Returns whether geometry1 $geometry1 is spatially touches $geometry2 $geometry2." - }, - "http://expath.org/ns/geo#crosses#2": { - "name": "crosses", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#crosses#2", - "params": [ - "$geometry1 as element(*)", - "$geometry2 as element(*)" - ], - "type": "xs:boolean", - "description": " Returns whether geometry1 $geometry1 is spatially crosses $geometry2 $geometry2. It means, if the geometries have some but not all interior points in common. Returns true if the DE-9IM intersection matrix for the two geometries is:

T*T****** (for P/L, P/A, and L/A situations)
T*****T** (for L/P, A/P, and A/L situations)
0******** (for L/L situations).

" - }, - "http://expath.org/ns/geo#within#2": { - "name": "within", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#within#2", - "params": [ - "$geometry1 as element(*)", - "$geometry2 as element(*)" - ], - "type": "xs:boolean", - "description": " Returns whether geometry1 $geometry1 is spatially within $geometry2 $geometry2." - }, - "http://expath.org/ns/geo#contains#2": { - "name": "contains", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#contains#2", - "params": [ - "$geometry1 as element(*)", - "$geometry2 as element(*)" - ], - "type": "xs:boolean", - "description": " Returns whether geometry1 $geometry1 spatially contains $geometry2 $geometry2. Returns true if within function of these two geometries also returns true." - }, - "http://expath.org/ns/geo#overlaps#2": { - "name": "overlaps", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#overlaps#2", - "params": [ - "$geometry1 as element(*)", - "$geometry2 as element(*)" - ], - "type": "xs:boolean", - "description": " Returns whether geometry1 $geometry1 is spatially overlaps $geometry2 $geometry2." - }, - "http://expath.org/ns/geo#relate#3": { - "name": "relate", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#relate#3", - "params": [ - "$geometry1 as element(*)", - "$geometry2 as element(*)", - "$intersectionMatrix as xs:string" - ], - "type": "xs:boolean", - "description": " Returns whether relationships between the boundaries, interiors and exteriors of geometry1 $geometry1 and geometry2 $geometry2 match the pattern specified in intersectionMatrix $geometry2, which should have the length of 9 charachters.
The values in the DE-9IM can be T, F, *, 0, 1, 2 .

- T means the intersection gives a non-empty result.
- F means the intersection gives an empty result.
- * means any result.
- 0, 1, 2 gives the expected dimension of the result (point, curve, surface)

" - }, - "http://expath.org/ns/geo#distance#2": { - "name": "distance", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#distance#2", - "params": [ - "$geometry1 as element(*)", - "$geometry2 as element(*)" - ], - "type": "xs:double", - "description": " Returns the shortest distance, in the units of the spatial reference system of geometry1 $geometry1, between the geometries, where that distance is the distance between a point on each of the geometries." - }, - "http://expath.org/ns/geo#buffer#2": { - "name": "buffer", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#buffer#2", - "params": [ - "$geometry as element(*)", - "$distance as xs:double" - ], - "type": "element(*)", - "description": " Returns polygonal geometry representing the buffer by distance $distance of geometry $geometry a buffer area around this geometry having the given width, in the spatial reference system of geometry. The buffer of a Geometry is the Minkowski sum or difference of the geometry with a disc of radius abs(distance). The buffer is constructed using 8 segments per quadrant to represent curves." - }, - "http://expath.org/ns/geo#convex-hull#1": { - "name": "convex-hull", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#convex-hull#1", - "params": [ - "$geometry as element(*)" - ], - "type": "element(*)", - "description": " Returns the convex hull geometry of the given geometry $geometry in GML, or the empty sequence. Actually returns the object of smallest dimension possible." - }, - "http://expath.org/ns/geo#intersection#2": { - "name": "intersection", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#intersection#2", - "params": [ - "$geometry1 as element(*)", - "$geometry2 as element(*)" - ], - "type": "element(*)?", - "description": " Returns the intersection geometry of geometry1 $geometry1 with geometry2 $geometry2, in GML or empty sequence if there is no intersection of these geometries." - }, - "http://expath.org/ns/geo#union#2": { - "name": "union", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#union#2", - "params": [ - "$geometry1 as element(*)", - "$geometry2 as element(*)" - ], - "type": "element(*)", - "description": " Returns the union geometry of geometry1 $geometry1 with geometry2 $geometry2, in GML." - }, - "http://expath.org/ns/geo#difference#2": { - "name": "difference", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#difference#2", - "params": [ - "$geometry1 as element(*)", - "$geometry2 as element(*)" - ], - "type": "element(*)?", - "description": " Returns the difference geometry of geometry1 $geometry1 with geometry2 $geometry2, in GML, or empty sequence if the difference is empty, as a set of point in geometry1 $geometry1 and not included in geometry2 $geometry2." - }, - "http://expath.org/ns/geo#sym-difference#2": { - "name": "sym-difference", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#sym-difference#2", - "params": [ - "$geometry1 as element(*)", - "$geometry2 as element(*)" - ], - "type": "element(*)?", - "description": " Returns the symmetric difference geometry of geometry1 $geometry1 with geometry2 $geometry2, in GML, or empty sequence if the difference is empty, as a set of point in one of the geometries and not included in the other." - }, - "http://expath.org/ns/geo#x#1": { - "name": "x", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#x#1", - "params": [ - "$point as element(*)" - ], - "type": "xs:double", - "description": " Returns the x coordinate of point $point. A point has to have an x coordinate." - }, - "http://expath.org/ns/geo#y#1": { - "name": "y", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#y#1", - "params": [ - "$point as element(*)" - ], - "type": "xs:double?", - "description": " Returns the y coordinate of point $point. If the point does not have the y coordinate, 0 will be returned." - }, - "http://expath.org/ns/geo#z#1": { - "name": "z", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#z#1", - "params": [ - "$point as element(*)" - ], - "type": "xs:double?", - "description": " Returns the z coordinate of point $point. If the point does not have the y coordinate, 0 will be returned." - }, - "http://expath.org/ns/geo#start-point#1": { - "name": "start-point", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#start-point#1", - "params": [ - "$line as element(*)" - ], - "type": "element(*)", - "description": " Returns the starting point of the given line $line. $line has to be a single line, LineString or LinearRing." - }, - "http://expath.org/ns/geo#end-point#1": { - "name": "end-point", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#end-point#1", - "params": [ - "$line as element(*)" - ], - "type": "element(*)", - "description": " Returns the ending point of the given line $line. $line has to be a single line, LineString or LinearRing." - }, - "http://expath.org/ns/geo#is-closed#1": { - "name": "is-closed", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#is-closed#1", - "params": [ - "$line as element(*)" - ], - "type": "xs:boolean", - "description": " Returns a boolean value that shows the line $line is a closed loop (start point and end point are the same) or not. $line has to be a line, as a geometry, LineString or LinearRing, and MultiLineString." - }, - "http://expath.org/ns/geo#is-ring#1": { - "name": "is-ring", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#is-ring#1", - "params": [ - "$line as element(*)" - ], - "type": "xs:boolean", - "description": " Returns a boolean value that shows the line $line is a ring (closed loop and single) or not. $line has to be a single line, as a geometry, LineString or LinearRing." - }, - "http://expath.org/ns/geo#point-n#1": { - "name": "point-n", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#point-n#1", - "params": [ - "$line as element(*)" - ], - "type": "element(*)", - "description": " Returns the Nth point in the given line $geometry. $line has to be a single line, as a geometry, LineString or LinearRing." - }, - "http://expath.org/ns/geo#exterior-ring#1": { - "name": "exterior-ring", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#exterior-ring#1", - "params": [ - "$polygon as element(*)" - ], - "type": "element(*)", - "description": " Returns the outer ring of the given polygon $geometry, as a gml:LineString." - }, - "http://expath.org/ns/geo#num-interior-ring#1": { - "name": "num-interior-ring", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#num-interior-ring#1", - "params": [ - "$polygon as element(*)" - ], - "type": "xs:integer", - "description": " Returns the number of interior rings in the given polygon $geometry." - }, - "http://expath.org/ns/geo#interior-ring-n#1": { - "name": "interior-ring-n", - "uri": "http://expath.org/ns/geo", - "key": "http://expath.org/ns/geo#interior-ring-n#1", - "params": [ - "$polygon as element(*)" - ], - "type": "element(*)", - "description": " Returns the outer ring of the given polygon $geometry, as a gml:LineString." - } - }, - "description": " This XQuery Module contains functions that may be applied to geometry data conforming to the Open Geospatial Consortium (OGC) Simple Feature (SF) data model. It is based on the EXPath Geo Module and uses the JTS library.", - "type": "module", - "override": true - }, - "http://basex.org/modules/hash": { - "ns": "http://basex.org/modules/hash", - "prefixes": [ - "hash" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/hash#md5#1": { - "name": "md5", - "uri": "http://basex.org/modules/hash", - "key": "http://basex.org/modules/hash#md5#1", - "params": [ - "$value as xs:anyAtomicType" - ], - "type": "xs:base64Binary", - "description": " Computes the MD5 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary." - }, - "http://basex.org/modules/hash#sha1#1": { - "name": "sha1", - "uri": "http://basex.org/modules/hash", - "key": "http://basex.org/modules/hash#sha1#1", - "params": [ - "$value as xs:anyAtomicType" - ], - "type": "xs:base64Binary", - "description": " Computes the SHA-1 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary." - }, - "http://basex.org/modules/hash#sha256#1": { - "name": "sha256", - "uri": "http://basex.org/modules/hash", - "key": "http://basex.org/modules/hash#sha256#1", - "params": [ - "$value as xs:anyAtomicType" - ], - "type": "xs:base64Binary", - "description": " Computes the SHA-256 hash of the given $value, which may be of type xs:string, xs:base64Binary, or xs:hexBinary." - }, - "http://basex.org/modules/hash#hash#2": { - "name": "hash", - "uri": "http://basex.org/modules/hash", - "key": "http://basex.org/modules/hash#hash#2", - "params": [ - "$value as xs:anyAtomicType", - "$algorithm as xs:string" - ], - "type": "xs:base64Binary", - "description": " Computes the hash of the given $value, using the specified $algorithm. The specified values may be of type xs:string, xs:base64Binary, or xs:hexBinary.
The following three algorihms are supported: MD5, SHA-1, and SHA-256." - } - }, - "description": " This XQuery Module provides functions that perform different hash operations.", - "type": "module", - "override": true - }, - "http://basex.org/modules/hof": { - "ns": "http://basex.org/modules/hof", - "prefixes": [ - "hof" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/hof#fold-left1#2": { - "name": "fold-left1", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#fold-left1#2", - "params": [ - "$seq as item()+", - "$f as function(item()*, item()) as item()*" - ], - "type": "item()*", - "description": " Works the same as fn:fold-left, but does not need a seed, because the sequence must be non-empty." - }, - "http://basex.org/modules/hof#until#3": { - "name": "until", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#until#3", - "params": [ - "$pred as function(item()*) as xs:boolean", - "$f as function(item()*) as item()*", - "$start as item()*" - ], - "type": "item()*", - "description": " Applies the predicate function $pred to $start. If the result is false, $f is invoked with the start value – or, subsequently, with the result of this function – until the predicate function returns true()." - }, - "http://basex.org/modules/hof#scan-left#3": { - "name": "scan-left", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#scan-left#3", - "params": [ - "$seq as item()*", - "$start as item()*", - "$f as function(item()*, item()) as item()*" - ], - "type": "item()*", - "description": " This function is similar to fn:fold-left, but it returns a list of successive reduced values from the left. It is equivalent to:
  declare function hof:scan-left ( $ seq , $ acc , $ f ) { if ( empty ( $ seq )) then $ acc else ( $ acc , hof:scan-left ( tail ( $ seq ), $ f ( $ acc , head ( $ seq )), $ f ) ) }; 
" - }, - "http://basex.org/modules/hof#take-while#2": { - "name": "take-while", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#take-while#2", - "params": [ - "$seq as item()*", - "$pred as function(item()) as xs:boolean" - ], - "type": "item()*", - "description": " The function returns items of $seq as long as the predicate $pred is satisfied. It is equivalent to:
  declare function hof:take-while ( $ seq , $ pred ) { if ( empty ( $ seq ) or not ( $ pred ( head( $ seq )))) then () else ( head ( $ seq ), hof:take-while ( tail ( $ seq ), $ pred ) ) }; 
" - }, - "http://basex.org/modules/hof#drop-while#2": { - "name": "drop-while", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#drop-while#2", - "params": [ - "$seq as item()*", - "$pred as function(item()) as xs:boolean" - ], - "type": "item()*", - "description": " The function skips all items of $seq until the predicate $pred is not satisfied anymore. It is equivalent to:
  declare function hof:drop-while ( $ seq , $ pred ) { if ( $ pred ( head( $ seq ))) then ( hof:drop-while ( tail ( $ seq ), $ pred ) ) else ( $ seq ) }; 
" - }, - "http://basex.org/modules/hof#top-k-by#3": { - "name": "top-k-by", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#top-k-by#3", - "params": [ - "$seq as item()*", - "$sort-key as function(item()) as item()", - "$k as xs:integer" - ], - "type": "item()*", - "description": " Returns the $k items in $seq that are greatest when sorted by the result of $f applied to the item. The function is a much more efficient implementation of the following scheme:
  ( for $ x in $ seq order by $ sort-key ( $ x ) descending return $ x )[ position () <= $ k ] 
" - }, - "http://basex.org/modules/hof#top-k-with#3": { - "name": "top-k-with", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#top-k-with#3", - "params": [ - "$seq as item()*", - "$lt as function(item(), item()) as xs:boolean", - "$k as xs:integer" - ], - "type": "item()*", - "description": " Returns the $k items in $seq that are greatest when sorted in the order of the less-than predicate $lt. The function is a general version of hof:top-k-by($seq, $sort-key, $k)." - }, - "http://basex.org/modules/hof#id#1": { - "name": "id", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#id#1", - "params": [ - "$expr as item()*" - ], - "type": "item()*", - "description": " Returns its argument unchanged. This function isn’t useful on its own, but can be used as argument to other higher-order functions." - }, - "http://basex.org/modules/hof#const#2": { - "name": "const", - "uri": "http://basex.org/modules/hof", - "key": "http://basex.org/modules/hof#const#2", - "params": [ - "$expr as item()*", - "$ignored as item()*" - ], - "type": "item()*", - "description": " Returns its first argument unchanged and ignores the second. This function isn’t useful on its own, but can be used as argument to other higher-order functions, e.g. when a function combining two values is expected and one only wants to retain the left one." - } - }, - "description": "", - "type": "module", - "override": true - }, - "http://basex.org/modules/html": { - "ns": "http://basex.org/modules/html", - "prefixes": [ - "html" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/html#parser#0": { - "name": "parser", - "uri": "http://basex.org/modules/html", - "key": "http://basex.org/modules/html#parser#0", - "params": [], - "type": "xs:string", - "description": " Returns the name of the applied HTML parser (currently: TagSoup). If an empty string is returned, TagSoup was not found in the classpath, and the input will be treated as well-formed XML.
" - }, - "http://basex.org/modules/html#parse#1": { - "name": "parse", - "uri": "http://basex.org/modules/html", - "key": "http://basex.org/modules/html#parse#1", - "params": [ - "$input as xs:anyAtomicType" - ], - "type": "document-node()", - "description": " Converts the HTML document specified by $input to XML and returns a document node:
  • The input may either be a string or a binary item (xs:hexBinary, xs:base64Binary).
  • If the input is passed on in its binary representation, the HTML parser will try to automatically choose the correct encoding.

The $options argument can be used to set TagSoup Options.

" - }, - "http://basex.org/modules/html#parse#2": { - "name": "parse", - "uri": "http://basex.org/modules/html", - "key": "http://basex.org/modules/html#parse#2", - "params": [ - "$input as xs:anyAtomicType", - "$options as map(*)?" - ], - "type": "document-node()", - "description": " Converts the HTML document specified by $input to XML and returns a document node:
  • The input may either be a string or a binary item (xs:hexBinary, xs:base64Binary).
  • If the input is passed on in its binary representation, the HTML parser will try to automatically choose the correct encoding.

The $options argument can be used to set TagSoup Options.

" - }, - "http://basex.org/modules/html#doc#1": { - "name": "doc", - "uri": "http://basex.org/modules/html", - "key": "http://basex.org/modules/html#doc#1", - "params": [ - "$uri as xs:string?" - ], - "type": "document-node()?", - "description": " Fetches the HTML document referred to by the given $uri, converts it to XML and returns a document node. The $options argument can be used to set TagSoup Options." - }, - "http://basex.org/modules/html#doc#2": { - "name": "doc", - "uri": "http://basex.org/modules/html", - "key": "http://basex.org/modules/html#doc#2", - "params": [ - "$uri as xs:string?", - "$options as map(*)?" - ], - "type": "document-node()?", - "description": " Fetches the HTML document referred to by the given $uri, converts it to XML and returns a document node. The $options argument can be used to set TagSoup Options." - } - }, - "description": " This XQuery Module provides functions for converting HTML to XML. Conversion will only take place if TagSoup is included in the classpath (see HTML Parsing for more details).", - "type": "module", - "override": true - }, - "http://expath.org/ns/http-client": { - "ns": "http://expath.org/ns/http-client", - "prefixes": [ - "http" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://expath.org/ns/http-client#send-request#1": { - "name": "send-request", - "uri": "http://expath.org/ns/http-client", - "key": "http://expath.org/ns/http-client#send-request#1", - "params": [ - "$request as element(http:request)" - ], - "type": "item()+", - "description": " Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.
  • Certificate verification can be globally disabled via the IGNORECERT option.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
" - }, - "http://expath.org/ns/http-client#send-request#2": { - "name": "send-request", - "uri": "http://expath.org/ns/http-client", - "key": "http://expath.org/ns/http-client#send-request#2", - "params": [ - "$request as element(http:request)?", - "$href as xs:string?" - ], - "type": "item()+", - "description": " Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.
  • Certificate verification can be globally disabled via the IGNORECERT option.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
" - }, - "http://expath.org/ns/http-client#send-request#3": { - "name": "send-request", - "uri": "http://expath.org/ns/http-client", - "key": "http://expath.org/ns/http-client#send-request#3", - "params": [ - "$request as element(http:request)?", - "$href as xs:string?", - "$bodies as item()*" - ], - "type": "item()+", - "description": " Sends an HTTP request and interprets the corresponding response:
  • $request contains the parameters of the HTTP request such as HTTP method and headers.
  • In addition to this it can also contain the URI to which the request will be sent and the body of the HTTP method.
  • If the URI is not given with the parameter $href, its value in $request is used instead.
  • The request body can also be supplied via the $bodies parameter.
  • Certificate verification can be globally disabled via the IGNORECERT option.

Notes:

  • Both basic and digest authentication is supported.
  • While the contents of the request can be supplied as child of the http:body element, it is faster and safer to pass them on via the third argument.
  • For further information, please check out the EXPath specification.
" - } - }, - "description": " This XQuery Module contains a single function to send HTTP requests and handle HTTP responses. The function send-request is based on the EXPath HTTP Client Module. It gives full control over the available request and response parameters. For simple GET requests, the Fetch Module may be sufficient.", - "type": "module", - "override": true - }, - "http://basex.org/modules/index": { - "ns": "http://basex.org/modules/index", - "prefixes": [ - "index" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/index#facets#1": { - "name": "facets", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#facets#1", - "params": [ - "$db as xs:string" - ], - "type": "xs:string", - "description": " Returns information about all facets and facet values of the database $db in document structure format.
If $type is specified as flat, the function returns this information in a flat summarized version. The returned data is derived from the Path Index." - }, - "http://basex.org/modules/index#facets#2": { - "name": "facets", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#facets#2", - "params": [ - "$db as xs:string", - "$type as xs:string" - ], - "type": "xs:string", - "description": " Returns information about all facets and facet values of the database $db in document structure format.
If $type is specified as flat, the function returns this information in a flat summarized version. The returned data is derived from the Path Index." - }, - "http://basex.org/modules/index#texts#1": { - "name": "texts", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#texts#1", - "params": [ - "$db as xs:string" - ], - "type": "element(value)*", - "description": " Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry." - }, - "http://basex.org/modules/index#texts#2": { - "name": "texts", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#texts#2", - "params": [ - "$db as xs:string", - "$prefix as xs:string" - ], - "type": "element(value)*", - "description": " Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry." - }, - "http://basex.org/modules/index#texts#3": { - "name": "texts", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#texts#3", - "params": [ - "$db as xs:string", - "$start as xs:string", - "$ascending as xs:boolean" - ], - "type": "element(value)*", - "description": " Returns all strings stored in the Text Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry." - }, - "http://basex.org/modules/index#attributes#1": { - "name": "attributes", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#attributes#1", - "params": [ - "$db as xs:string" - ], - "type": "element(value)*", - "description": " Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry." - }, - "http://basex.org/modules/index#attributes#2": { - "name": "attributes", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#attributes#2", - "params": [ - "$db as xs:string", - "$prefix as xs:string" - ], - "type": "element(value)*", - "description": " Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry." - }, - "http://basex.org/modules/index#attributes#3": { - "name": "attributes", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#attributes#3", - "params": [ - "$db as xs:string", - "$start as xs:string", - "$ascending as xs:boolean" - ], - "type": "element(value)*", - "description": " Returns all strings stored in the Attribute Index of the database $db, along with their number of occurrences.
If $prefix is specified, the returned entries will be refined to the ones starting with that prefix.
If $start and $ascending are specified, all nodes will be returned after or before the specified start entry." - }, - "http://basex.org/modules/index#tokens#1": { - "name": "tokens", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#tokens#1", - "params": [ - "$db as xs:string" - ], - "type": "element(value)*", - "description": " Returns all strings stored in the Token Index of the database $db, along with their number of occurrences." - }, - "http://basex.org/modules/index#element-names#1": { - "name": "element-names", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#element-names#1", - "params": [ - "$db as xs:string" - ], - "type": "element(value)*", - "description": " Returns all element names stored in the Name Index of the database $db, along with their number of occurrences." - }, - "http://basex.org/modules/index#attribute-names#1": { - "name": "attribute-names", - "uri": "http://basex.org/modules/index", - "key": "http://basex.org/modules/index#attribute-names#1", - "params": [ - "$db as xs:string" - ], - "type": "element(value)*", - "description": " Returns all attribute names stored in the Name Index of the database $db, along with their number of occurrences." - } - }, - "description": " This XQuery Module provides functions for displaying information stored in the database index structures.", - "type": "module", - "override": true - }, - "http://basex.org/modules/inspect": { - "ns": "http://basex.org/modules/inspect", - "prefixes": [ - "inspect" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/inspect#functions#0": { - "name": "functions", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#functions#0", - "params": [], - "type": "function(*)*", - "description": " Returns function items for all user-defined functions (both public and private) that are known in the current query context. If a $uri is specified, the specified resource will be retrieved as string and compiled, and its functions will be added to the query context and returned to the user. A relative URI will be resolved against the static base URI of the query." - }, - "http://basex.org/modules/inspect#functions#1": { - "name": "functions", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#functions#1", - "params": [ - "$uri as xs:string" - ], - "type": "function(*)*", - "description": " Returns function items for all user-defined functions (both public and private) that are known in the current query context. If a $uri is specified, the specified resource will be retrieved as string and compiled, and its functions will be added to the query context and returned to the user. A relative URI will be resolved against the static base URI of the query." - }, - "http://basex.org/modules/inspect#function-annotations#1": { - "name": "function-annotations", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#function-annotations#1", - "params": [ - "$function as function(*)?" - ], - "type": "map(xs:QName, xs:anyAtomicType*)", - "description": " Returns the annotations of the specified $function in a map." - }, - "http://basex.org/modules/inspect#static-context#2": { - "name": "static-context", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#static-context#2", - "params": [ - "$function as function(*)?", - "$name as xs:string" - ], - "type": "item()*", - "description": " Returns a component of the static context of a $function with the specified $name. If no function is supplied, the current static context is considered.
The following components can be requested:
  • base-uri: Static base URI.
  • namespaces: Prefix/URI map with all statically known namespaces.
  • element-namespace: Default element/type namespace URI, or an empty sequence if it is absent.
  • function-namespace: Default function namespace URI, or an empty sequence if it is absent.
  • collation: URI of the default collation.
  • ordering: Ordering mode (ordered/unordered)
  • construction: Construction mode (preserve/strip)
  • default-order-empty: Default order for empty sequences (greatest/least)
  • boundary-space: Boundary-space policy (preserve/strip)
  • copy-namespaces: Copy-namespaces mode (inherit/no-inherit, preserve/no-preserve)
  • decimal-formats: Nested map with all statically known decimal formats
" - }, - "http://basex.org/modules/inspect#type#1": { - "name": "type", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#type#1", - "params": [ - "$value as item()*" - ], - "type": "xs:string", - "description": " Returns a string representation of the type of a $value:
  • The string includes the occurrence indicator.
  • The type of functions and nodes may be stricter than the returned type.
  • For type checking, the standard expressions typeswitch and instance of should be used instead.

The following $options are available:

  • item: If enabled, only the item type is returned and the occurrence indicator is omitted. The default is false().
  • mode: If value is specified, the assigned type of the result value is returned. With expression the type of the input expression is returned (please note that the original expression may already have been rewritten at compile-time). With computed, the exact value is computed at runtime, based on the expression and the result value. The default is computed.
" - }, - "http://basex.org/modules/inspect#type#2": { - "name": "type", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#type#2", - "params": [ - "$value as item()*", - "$options as map(*)" - ], - "type": "xs:string", - "description": " Returns a string representation of the type of a $value:
  • The string includes the occurrence indicator.
  • The type of functions and nodes may be stricter than the returned type.
  • For type checking, the standard expressions typeswitch and instance of should be used instead.

The following $options are available:

  • item: If enabled, only the item type is returned and the occurrence indicator is omitted. The default is false().
  • mode: If value is specified, the assigned type of the result value is returned. With expression the type of the input expression is returned (please note that the original expression may already have been rewritten at compile-time). With computed, the exact value is computed at runtime, based on the expression and the result value. The default is computed.
" - }, - "http://basex.org/modules/inspect#function#1": { - "name": "function", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#function#1", - "params": [ - "$function as function(*)" - ], - "type": "element(function)", - "description": " Inspects the specified $function and returns an element that describes its structure. The output of this function is similar to eXist-db’s inspect:inspect-function function." - }, - "http://basex.org/modules/inspect#context#0": { - "name": "context", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#context#0", - "params": [], - "type": "element(context)", - "description": " Generates an element that describes all variables and functions in the current query context." - }, - "http://basex.org/modules/inspect#module#1": { - "name": "module", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#module#1", - "params": [ - "$uri as xs:string" - ], - "type": "element(module)", - "description": " Retrieves the resource located at the specified $uri, parses it as XQuery module, and generates an element that describes the module's structure. A relative URI will be resolved against the static base URI of the query." - }, - "http://basex.org/modules/inspect#xqdoc#1": { - "name": "xqdoc", - "uri": "http://basex.org/modules/inspect", - "key": "http://basex.org/modules/inspect#xqdoc#1", - "params": [ - "$uri as xs:string" - ], - "type": "element(xqdoc:xqdoc)", - "description": " Retrieves the resource located at the specified $uri, parses it as XQuery module, and generates an xqDoc element. A relative URI will be resolved against the static base URI of the query.
xqDoc provides a simple vendor-neutral solution for generating documentation from XQuery modules. The documentation conventions have been inspired by the JavaDoc standard. Documentation comments begin with (:~ and end with :), and tags start with @. xqDoc comments can be specified for main and library modules and variable and function declarations.

We have slightly extended the xqDoc conventions to do justice to more recent versions of XQuery (Schema: xqdoc-1.1.30052013.xsd):

  • an <xqdoc:annotations/> node is added to each variable or function that uses annotations. The xqdoc:annotation child nodes may have additional xqdoc:literal elements with type attributes (xs:string, xs:integer, xs:decimal, xs:double) and values.
  • a single <xqdoc:namespaces/> node is added to the root element, which summarizes all prefixes and namespace URIs used or declared in the module.
  • name and type elements are added to variables.
" - } - }, - "description": " This XQuery Module contains functions for extracting internal information about modules and functions and generating documentation.", - "type": "module", - "override": true - }, - "http://basex.org/modules/jobs": { - "ns": "http://basex.org/modules/jobs", - "prefixes": [ - "jobs" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/jobs#eval#1": { - "name": "eval", - "uri": "http://basex.org/modules/jobs", - "key": "http://basex.org/modules/jobs#eval#1", - "params": [ - "$query as xs:anyAtomicItem" - ], - "type": "xs:string", - "description": " Schedules the evaluation of the supplied $query (xs:string, or of type xs:anyURI, pointing to a resource), and returns a query id. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and the context value can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via jobs:result, or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time, dateTime or integer can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples for valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
    • If a time is specified, the query will be executed at this time of the day. Examples for valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • An integer will be interpreted as minutes. If the specified number is greater than the elapsed minutes of the current hour, the query will be executed one hour later.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same id is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service. Registered services must have no variable bindings.
  • log: writes the specified string to the database logs. Two log entries are stored, one at the beginning and another one after the execution of the job.
" - }, - "http://basex.org/modules/jobs#eval#2": { - "name": "eval", - "uri": "http://basex.org/modules/jobs", - "key": "http://basex.org/modules/jobs#eval#2", - "params": [ - "$query as xs:anyAtomicItem", - "$bindings as map(*)?" - ], - "type": "xs:string", - "description": " Schedules the evaluation of the supplied $query (xs:string, or of type xs:anyURI, pointing to a resource), and returns a query id. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and the context value can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via jobs:result, or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time, dateTime or integer can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples for valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
    • If a time is specified, the query will be executed at this time of the day. Examples for valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • An integer will be interpreted as minutes. If the specified number is greater than the elapsed minutes of the current hour, the query will be executed one hour later.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same id is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service. Registered services must have no variable bindings.
  • log: writes the specified string to the database logs. Two log entries are stored, one at the beginning and another one after the execution of the job.
" - }, - "http://basex.org/modules/jobs#eval#3": { - "name": "eval", - "uri": "http://basex.org/modules/jobs", - "key": "http://basex.org/modules/jobs#eval#3", - "params": [ - "$query as xs:anyAtomicItem", - "$bindings as map(*)?", - "$options as map(*)?" - ], - "type": "xs:string", - "description": " Schedules the evaluation of the supplied $query (xs:string, or of type xs:anyURI, pointing to a resource), and returns a query id. The query will be queued, and the result will optionally be cached. Queries can be updating. Variables and the context value can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • cache: indicates if the query result will be cached or ignored (default: false):
    • The result will be cached in main-memory until it is fetched via jobs:result, or until CACHETIMEOUT is exceeded.
    • If the query raises an error, it will be cached and returned instead.
  • start: a dayTimeDuration, time, dateTime or integer can be specified to delay the execution of the query:
    • If a dayTimeDuration is specified, the query will be queued after the specified duration has passed. Examples for valid values are: P1D (1 day), PT5M (5 minutes), PT0.1S (100 ms). An error will be raised if a negative value is specified.
    • If a dateTime is specified, the query will be executed at this date. Examples for valid values are: 2018-12-31T23:59:59 (New Year's Eve 2018, close to midnight). An error will be raised if the specified time lies in the past.
    • If a time is specified, the query will be executed at this time of the day. Examples for valid times are: 02:00:00 (2am local time), 12:00:00Z (noon, UTC). If the time lies in the past, the query will be executed the next day.
    • An integer will be interpreted as minutes. If the specified number is greater than the elapsed minutes of the current hour, the query will be executed one hour later.
  • interval: a dayTimeDuration string can be specified to execute the query periodically. An error is raised if the specified interval is less than one second (PT1S). If the next scheduled call is due, and if a query with the same id is still running, it will be skipped.
  • end: scheduling can be stopped after a given time or duration. The string format is the same as for start. An error is raised if the resulting end time is smaller than the start time.
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.
  • service: additionally registers the job as service. Registered services must have no variable bindings.
  • log: writes the specified string to the database logs. Two log entries are stored, one at the beginning and another one after the execution of the job.
" - }, - "http://basex.org/modules/jobs#result#1": { - "name": "result", - "uri": "http://basex.org/modules/jobs", - "key": "http://basex.org/modules/jobs#result#1", - "params": [ - "$id as xs:string" - ], - "type": "item()*", - "description": " Returns the cached result of a job with the specified job $id:
  • If the original job has raised an error, the cached error will be raised instead.
  • Results can only be retrieved once. After retrieval, the cached result will be dropped.
  • If the result has already been retrieved, or if it has not been cached, an empty sequence is returned.
" - }, - "http://basex.org/modules/jobs#stop#1": { - "name": "stop", - "uri": "http://basex.org/modules/jobs", - "key": "http://basex.org/modules/jobs#stop#1", - "params": [ - "$id as xs:string" - ], - "type": "empty-sequence()", - "description": " Triggers the cancelation of a job with the specified $id, drops the cached result of a query, or cancels a scheduled job. Unknown ids are ignored. All jobs are gracefully stopped; it is up to the process to decide when it is safe to shut down. The following $options can be supplied:
  • service: additionally removes the job from the job services list.
" - }, - "http://basex.org/modules/jobs#wait#1": { - "name": "wait", - "uri": "http://basex.org/modules/jobs", - "key": "http://basex.org/modules/jobs#wait#1", - "params": [ - "$id as xs:string" - ], - "type": "empty-sequence()", - "description": " Waits for the completion of a job with the specified $id:
  • The function will terminate immediately if the job id is unknown. This is the case if a future job has not been queued yet, or if the id has already been discarded after job evaluation.
  • If the function is called with the id of a queued job, or repeatedly executed job, it may stall and never terminate.
" - }, - "http://basex.org/modules/jobs#current#0": { - "name": "current", - "uri": "http://basex.org/modules/jobs", - "key": "http://basex.org/modules/jobs#current#0", - "params": [], - "type": "xs:string", - "description": " Returns the id of the current job." - }, - "http://basex.org/modules/jobs#list#0": { - "name": "list", - "uri": "http://basex.org/modules/jobs", - "key": "http://basex.org/modules/jobs#list#0", - "params": [], - "type": "xs:string*", - "description": " Returns the ids of all jobs that are currently registered. The list includes scheduled, queued, running, stopped, and finished jobs with cached results." - }, - "http://basex.org/modules/jobs#list-details#0": { - "name": "list-details", - "uri": "http://basex.org/modules/jobs", - "key": "http://basex.org/modules/jobs#list-details#0", - "params": [], - "type": "element(job)*", - "description": " Returns information on all jobs that are currently registered, or on a job with the specified $id (or an empty sequence if this job is not found). The list includes scheduled, queued, running jobs, and cached jobs. A string representation of the job, or its URI, will be returned as value. The returned elements have additional attributes:
  • id: job id
  • type: type of the job (command, query, REST, RESTXQ, etc.)
  • state: current state of the job: scheduled, queued, running, cached
  • user: user who started the job
  • duration: evaluation time (included if a job is running or if the result was cached)
  • start: next start of job (included if a job will be executed repeatedly)
  • time: time when job was registered
" - }, - "http://basex.org/modules/jobs#list-details#1": { - "name": "list-details", - "uri": "http://basex.org/modules/jobs", - "key": "http://basex.org/modules/jobs#list-details#1", - "params": [ - "$id as xs:string" - ], - "type": "element(job)*", - "description": " Returns information on all jobs that are currently registered, or on a job with the specified $id (or an empty sequence if this job is not found). The list includes scheduled, queued, running jobs, and cached jobs. A string representation of the job, or its URI, will be returned as value. The returned elements have additional attributes:
  • id: job id
  • type: type of the job (command, query, REST, RESTXQ, etc.)
  • state: current state of the job: scheduled, queued, running, cached
  • user: user who started the job
  • duration: evaluation time (included if a job is running or if the result was cached)
  • start: next start of job (included if a job will be executed repeatedly)
  • time: time when job was registered
" - }, - "http://basex.org/modules/jobs#bindings#1": { - "name": "bindings", - "uri": "http://basex.org/modules/jobs", - "key": "http://basex.org/modules/jobs#bindings#1", - "params": [ - "$id as xs:string" - ], - "type": "map(*)", - "description": " Returns the variable bindings of an existing job with the specified $id. If no variables have been bound to this job, an empty map is returned." - }, - "http://basex.org/modules/jobs#finished#1": { - "name": "finished", - "uri": "http://basex.org/modules/jobs", - "key": "http://basex.org/modules/jobs#finished#1", - "params": [ - "$id as xs:string" - ], - "type": "xs:boolean", - "description": " Indicates if the evaluation of an already running job with the specified $id has finished. As the ids of finished jobs will usually be discarded, unless caching is enabled, the function will also return true for unknown jobs.
  • false indicates that the job id is scheduled, queued, or currently running.
  • true will be returned if the job has either finished, or if the id is unknown (because the ids of all finished jobs will not be cached).
" - }, - "http://basex.org/modules/jobs#services#0": { - "name": "services", - "uri": "http://basex.org/modules/jobs", - "key": "http://basex.org/modules/jobs#services#0", - "params": [], - "type": "element(job)*", - "description": " Returns a list of all jobs that have been persistently registered as Services." - } - }, - "description": " This XQuery Module provides functions for organizing scheduled, queued, running and cached jobs. Jobs can be commands, queries, client or HTTP requests.", - "type": "module", - "override": true - }, - "http://basex.org/modules/json": { - "ns": "http://basex.org/modules/json", - "prefixes": [ - "json" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/json#parse#1": { - "name": "parse", - "uri": "http://basex.org/modules/json", - "key": "http://basex.org/modules/json#parse#1", - "params": [ - "$string as xs:string?" - ], - "type": "item()?", - "description": " Converts the JSON $string to an XQuery value. If the input can be successfully parsed, it can be serialized back to the original JSON representation. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/json#parse#2": { - "name": "parse", - "uri": "http://basex.org/modules/json", - "key": "http://basex.org/modules/json#parse#2", - "params": [ - "$string as xs:string?", - "$options as map(*)?" - ], - "type": "item()?", - "description": " Converts the JSON $string to an XQuery value. If the input can be successfully parsed, it can be serialized back to the original JSON representation. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/json#doc#1": { - "name": "doc", - "uri": "http://basex.org/modules/json", - "key": "http://basex.org/modules/json#doc#1", - "params": [ - "$uri as xs:string" - ], - "type": "item()?", - "description": " Fetches the JSON document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/json#doc#2": { - "name": "doc", - "uri": "http://basex.org/modules/json", - "key": "http://basex.org/modules/json#doc#2", - "params": [ - "$uri as xs:string", - "$options as map(*)?" - ], - "type": "item()?", - "description": " Fetches the JSON document referred to by the given $uri and converts it to an XQuery value. The $options argument can be used to control the way the input is converted." - }, - "http://basex.org/modules/json#serialize#1": { - "name": "serialize", - "uri": "http://basex.org/modules/json", - "key": "http://basex.org/modules/json#serialize#1", - "params": [ - "$input as item()?" - ], - "type": "xs:string", - "description": " Serializes the specified $input as JSON, using the specified $options, and returns the result as string:
  • The input is expected to conform to the results that are created by json:parse().
  • Non-conforming items will be serialized as specified in the json output method of the official recommendation.

Values can also be serialized as JSON with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to json, and
  • the options presented in this article need to be assigned to the json parameter.
" - }, - "http://basex.org/modules/json#serialize#2": { - "name": "serialize", - "uri": "http://basex.org/modules/json", - "key": "http://basex.org/modules/json#serialize#2", - "params": [ - "$input as item()?", - "$options as map(*)?" - ], - "type": "xs:string", - "description": " Serializes the specified $input as JSON, using the specified $options, and returns the result as string:
  • The input is expected to conform to the results that are created by json:parse().
  • Non-conforming items will be serialized as specified in the json output method of the official recommendation.

Values can also be serialized as JSON with the standard Serialization feature of XQuery:

  • The parameter method needs to be set to json, and
  • the options presented in this article need to be assigned to the json parameter.
" - } - }, - "description": " This XQuery Module contains functions to parse and serialize JSON data JSON (JavaScript Object Notation) is a popular data exchange format for applications written in JavaScript. As there are notable differences between JSON and XML, or XQuery data types, no mapping exists that guarantees a lossless, bidirectional conversion between JSON and XML. For this reason, we offer various mappings, all of which are suited to different use cases.", - "type": "module", - "override": true - }, - "http://basex.org/modules/lazy": { - "ns": "http://basex.org/modules/lazy", - "prefixes": [ - "lazy" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/lazy#cache#1": { - "name": "cache", - "uri": "http://basex.org/modules/lazy", - "key": "http://basex.org/modules/lazy#cache#1", - "params": [ - "$items as item()*" - ], - "type": "item()*", - "description": " Caches the data of lazy $items in a sequence:
  • data of lazy items will be retrieved and cached inside the item.
  • non-lazy items, or lazy items with cached data, will simply be passed through.
  • If $lazy is set to true(), caching will be deferred until the data is eventually requested. Streaming will be disabled: Data will always be cached before a stream is returned.

Caching is advisable if an item will be processed more than once, or if the data may not be available anymore at a later stage.

" - }, - "http://basex.org/modules/lazy#cache#2": { - "name": "cache", - "uri": "http://basex.org/modules/lazy", - "key": "http://basex.org/modules/lazy#cache#2", - "params": [ - "$items as item()*", - "$lazy as xs:boolean" - ], - "type": "item()*", - "description": " Caches the data of lazy $items in a sequence:
  • data of lazy items will be retrieved and cached inside the item.
  • non-lazy items, or lazy items with cached data, will simply be passed through.
  • If $lazy is set to true(), caching will be deferred until the data is eventually requested. Streaming will be disabled: Data will always be cached before a stream is returned.

Caching is advisable if an item will be processed more than once, or if the data may not be available anymore at a later stage.

" - }, - "http://basex.org/modules/lazy#is-lazy#1": { - "name": "is-lazy", - "uri": "http://basex.org/modules/lazy", - "key": "http://basex.org/modules/lazy#is-lazy#1", - "params": [ - "$item as item()" - ], - "type": "xs:boolean", - "description": " Checks whether the specified $item is lazy." - }, - "http://basex.org/modules/lazy#is-cached#1": { - "name": "is-cached", - "uri": "http://basex.org/modules/lazy", - "key": "http://basex.org/modules/lazy#is-cached#1", - "params": [ - "$item as item()" - ], - "type": "xs:boolean", - "description": " Checks whether the contents of the specified $item are cached. The function will always return true for non-lazy items." - } - }, - "description": "", - "type": "module", - "override": true - }, - "http://www.w3.org/2005/xpath-functions/map": { - "ns": "http://www.w3.org/2005/xpath-functions/map", - "prefixes": [ - "map" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://www.w3.org/2005/xpath-functions/map#contains#2": { - "name": "contains", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#contains#2", - "params": [ - "$map as map(*)", - "$key as xs:anyAtomicType" - ], - "type": "xs:boolean", - "description": " Returns true if the supplied $map contains an entry with a key equal to the supplied value of $key; otherwise it returns false. No error is raised if the map contains keys that are not comparable with the supplied $key.

If the supplied key is xs:untypedAtomic, it is compared as an instance of xs:string. If the supplied key is the xs:float or xs:double value NaN, the function returns true if there is an entry whose key is NaN, or false otherwise.

" - }, - "http://www.w3.org/2005/xpath-functions/map#entry#2": { - "name": "entry", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#entry#2", - "params": [ - "$key as xs:anyAtomicType", - "$value as item()*" - ], - "type": "map(*)", - "description": " Creates a new map containing a single entry. The key of the entry in the new map is $key, and its associated value is $value.

The function map:entry is intended primarily for use in conjunction with the function map:merge . For example, a map containing seven entries may be constructed like this:

  map:merge (( map:entry ( \"Sun\" , \"Sunday\" ), map:entry ( \"Mon\" , \"Monday\" ), map:entry ( \"Tue\" , \"Tuesday\" ), map:entry ( \"Wed\" , \"Wednesday\" ), map:entry ( \"Thu\" , \"Thursday\" ), map:entry ( \"Fri\" , \"Friday\" ), map:entry ( \"Sat\" , \"Saturday\" ) )) 

Unlike the map { ... } expression, this technique can be used to construct a map with a variable number of entries, for example:

  map:merge ( for $ b in // book return map:entry ( $ b / isbn , $ b )) 
" - }, - "http://www.w3.org/2005/xpath-functions/map#find#2": { - "name": "find", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#find#2", - "params": [ - "$input as item()*", - "$key as xs:anyAtomicType" - ], - "type": "array(*)", - "description": " Returns all values of maps in the supplied $input with the specified $key. The found values will be returned in an array. Arbitrary input will be processed recursively as follows:
  • In a sequence, each item will be processed in order.
  • In an array, all array members will be processed as sequence.
  • In a map, all entries whose keys match the specified key. Moreover, all values of the map will be processed as sequence.
" - }, - "http://www.w3.org/2005/xpath-functions/map#for-each#2": { - "name": "for-each", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#for-each#2", - "params": [ - "$map as map(*)", - "$function as function(xs:anyAtomicType, item()*) as item()*" - ], - "type": "item()*", - "description": " Applies the specified $function to every key/value pair of the supplied $map and returns the results as a sequence." - }, - "http://www.w3.org/2005/xpath-functions/map#get#2": { - "name": "get", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#get#2", - "params": [ - "$map as map(*)", - "$key as xs:anyAtomicType" - ], - "type": "item()*", - "description": " Returns the value associated with a supplied key in a given map. This function attempts to find an entry within the $map that has a key equal to the supplied value of $key. If there is such an entry, the function returns the associated value; otherwise it returns an empty sequence. No error is raised if the map contains keys that are not comparable with the supplied $key. If the supplied key is xs:untypedAtomic, it is converted to xs:string.

A return value of () from map:get could indicate that the key is present in the map with an associated value of (), or it could indicate that the key is not present in the map. The two cases can be distinguished by calling map:contains. Invoking the map as a function item has the same effect as calling get: that is, when $map is a map, the expression $map($K) is equivalent to get($map, $K). Similarly, the expression get(get(get($map, 'employee'), 'name'), 'first') can be written as $map('employee')('name')('first').

" - }, - "http://www.w3.org/2005/xpath-functions/map#keys#1": { - "name": "keys", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#keys#1", - "params": [ - "$map as map(*)" - ], - "type": "xs:anyAtomicType*", - "description": " Returns a sequence containing all the key values present in a map. The function takes the supplied $map and returns the keys that are present in the map as a sequence of atomic values. The order may differ from the order in which entries were inserted in the map." - }, - "http://www.w3.org/2005/xpath-functions/map#merge#1": { - "name": "merge", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#merge#1", - "params": [ - "$maps as map(*)*" - ], - "type": "map(*)", - "description": " Constructs and returns a new map. The map is formed by combining the contents of the supplied $maps. The maps are combined as follows:
  1. There is one entry in the new map for each distinct key present in the union of the input maps.
  2. The $options argument defines how duplicate keys are handled. Currently, a single option duplicates exists, and its allowed values are use-first, use-last, combine and reject (default: use-first).
" - }, - "http://www.w3.org/2005/xpath-functions/map#merge#2": { - "name": "merge", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#merge#2", - "params": [ - "$maps as map(*)*", - "$options as map(*)" - ], - "type": "map(*)", - "description": " Constructs and returns a new map. The map is formed by combining the contents of the supplied $maps. The maps are combined as follows:
  1. There is one entry in the new map for each distinct key present in the union of the input maps.
  2. The $options argument defines how duplicate keys are handled. Currently, a single option duplicates exists, and its allowed values are use-first, use-last, combine and reject (default: use-first).
" - }, - "http://www.w3.org/2005/xpath-functions/map#put#3": { - "name": "put", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#put#3", - "params": [ - "$map as map(*)", - "$key as xs:anyAtomicType", - "$value as item()*" - ], - "type": "map(*)", - "description": " Creates a new map, containing the entries of the supplied $map and a new entry composed by $key and $value. The semantics of this function are equivalent to map:merge((map { $key, $value }, $map))" - }, - "http://www.w3.org/2005/xpath-functions/map#remove#2": { - "name": "remove", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#remove#2", - "params": [ - "$map as map(*)", - "$keys as xs:anyAtomicType*" - ], - "type": "map(*)", - "description": " Constructs a new map by removing entries from an existing map. The entries in the new map correspond to the entries of $map, excluding entries supplied via $keys.

No failure occurs if the input map contains no entry with the supplied keys; the input map is returned unchanged.

" - }, - "http://www.w3.org/2005/xpath-functions/map#size#1": { - "name": "size", - "uri": "http://www.w3.org/2005/xpath-functions/map", - "key": "http://www.w3.org/2005/xpath-functions/map#size#1", - "params": [ - "$map as map(*)" - ], - "type": "xs:integer", - "description": " Returns a the number of entries in the supplied map. The function takes the supplied $map and returns the number of entries that are present in the map." - } - }, - "description": " This XQuery Module contains functions for manipulating maps. Maps have been introduced with XQuery 3.1.", - "type": "module", - "override": true - }, - "http://www.w3.org/2005/xpath-functions/math": { - "ns": "http://www.w3.org/2005/xpath-functions/math", - "prefixes": [ - "math" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://www.w3.org/2005/xpath-functions/math#pi#0": { - "name": "pi", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#pi#0", - "params": [], - "type": "xs:double", - "description": " Returns the xs:double value of the mathematical constant π whose lexical representation is 3.141592653589793." - }, - "http://www.w3.org/2005/xpath-functions/math#sqrt#1": { - "name": "sqrt", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#sqrt#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the square root of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the xs:double value of the mathematical square root of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#sin#1": { - "name": "sin", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#sin#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the sine of the $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the sine of $arg, treated as an angle in radians." - }, - "http://www.w3.org/2005/xpath-functions/math#cos#1": { - "name": "cos", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#cos#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the cosine of $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the cosine of $arg, treated as an angle in radians." - }, - "http://www.w3.org/2005/xpath-functions/math#tan#1": { - "name": "tan", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#tan#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the tangent of $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the tangent of $arg, treated as an angle in radians." - }, - "http://www.w3.org/2005/xpath-functions/math#asin#1": { - "name": "asin", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#asin#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the arc sine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc sine of $arg, returned as an angle in radians in the range -Ï€/2 to +Ï€/2." - }, - "http://www.w3.org/2005/xpath-functions/math#acos#1": { - "name": "acos", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#acos#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the arc cosine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc cosine of $arg, returned as an angle in radians in the range 0 to +Ï€." - }, - "http://www.w3.org/2005/xpath-functions/math#atan#1": { - "name": "atan", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#atan#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the arc tangent of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc tangent of $arg, returned as an angle in radians in the range -Ï€/2 to +Ï€/2." - }, - "http://www.w3.org/2005/xpath-functions/math#atan2#2": { - "name": "atan2", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#atan2#2", - "params": [ - "$arg1 as xs:double?", - "$arg2 as xs:double" - ], - "type": "xs:double?", - "description": " Returns the arc tangent of $arg1 divided by $arg2, the result being in the range -Ï€/2 to +Ï€/2 radians.
If $arg1 is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc tangent of $arg1 divided by $arg2, returned as an angle in radians in the range -Ï€ to +Ï€." - }, - "http://www.w3.org/2005/xpath-functions/math#pow#2": { - "name": "pow", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#pow#2", - "params": [ - "$arg1 as xs:double?", - "$arg2 as xs:double" - ], - "type": "xs:double?", - "description": " Returns $arg1 raised to the power of $arg2.
If $arg1 is the empty sequence, the empty sequence is returned.
Otherwise the result is the $arg1 raised to the power of $arg2." - }, - "http://www.w3.org/2005/xpath-functions/math#exp#1": { - "name": "exp", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#exp#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns e raised to the power of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the value of e raised to the power of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#log#1": { - "name": "log", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#log#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the natural logarithm of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the natural logarithm (base e) of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#log10#1": { - "name": "log10", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#log10#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the base 10 logarithm of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the base 10 logarithm of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#e#0": { - "name": "e", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#e#0", - "params": [], - "type": "xs:double", - "description": " Returns the xs:double value of the mathematical constant e whose lexical representation is 2.718281828459045." - }, - "http://www.w3.org/2005/xpath-functions/math#sinh#1": { - "name": "sinh", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#sinh#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the hyperbolic sine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic sine of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#cosh#1": { - "name": "cosh", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#cosh#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the hyperbolic cosine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic cosine of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#tanh#1": { - "name": "tanh", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#tanh#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the hyperbolic tangent of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic tangent of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#crc32#1": { - "name": "crc32", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#crc32#1", - "params": [ - "$string as xs:string?" - ], - "type": "xs:hexBinary?", - "description": " Calculates the CRC32 check sum of the given $string.
If an empty sequence is supplied, the empty sequence is returned." - } - }, - "description": " The math XQuery Module defines functions to perform mathematical operations, such as pi, asin and acos. Most functions are specified in the Functions and Operators Specification of the upcoming XQuery 3.0 Recommendation, and some additional ones have been added in this module.", - "type": "module", - "override": true - }, - "http://basex.org/modules/out": { - "ns": "http://basex.org/modules/out", - "prefixes": [ - "out" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/out#cr#0": { - "name": "cr", - "uri": "http://basex.org/modules/out", - "key": "http://basex.org/modules/out#cr#0", - "params": [], - "type": "xs:string", - "description": " Returns a single carriage return character (&#13;)." - }, - "http://basex.org/modules/out#nl#0": { - "name": "nl", - "uri": "http://basex.org/modules/out", - "key": "http://basex.org/modules/out#nl#0", - "params": [], - "type": "xs:string", - "description": " Returns a single newline character (&#10;)." - }, - "http://basex.org/modules/out#tab#0": { - "name": "tab", - "uri": "http://basex.org/modules/out", - "key": "http://basex.org/modules/out#tab#0", - "params": [], - "type": "xs:string", - "description": " Returns a single tabulator character (&#9;)." - }, - "http://basex.org/modules/out#format#2": { - "name": "format", - "uri": "http://basex.org/modules/out", - "key": "http://basex.org/modules/out#format#2", - "params": [ - "$format as xs:string", - "$items as item()" - ], - "type": "xs:string", - "description": " Returns a formatted string. The remaining arguments specified by $items are applied to the $format string, according to Java’s printf syntax." - } - }, - "description": "", - "type": "module", - "override": true - }, - "http://basex.org/modules/proc": { - "ns": "http://basex.org/modules/proc", - "prefixes": [ - "proc" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/proc#system#1": { - "name": "system", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#system#1", - "params": [ - "$cmd as xs:string" - ], - "type": "xs:string", - "description": " Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
" - }, - "http://basex.org/modules/proc#system#2": { - "name": "system", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#system#2", - "params": [ - "$cmd as xs:string", - "$args as xs:string*" - ], - "type": "xs:string", - "description": " Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
" - }, - "http://basex.org/modules/proc#system#3": { - "name": "system", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#system#3", - "params": [ - "$cmd as xs:string", - "$args as xs:string*", - "$options as map(xs:string, xs:string)" - ], - "type": "xs:string", - "description": " Executes the specified command in a separate process and returns the result as string. $cmd is the name of the command, arguments to the command may be specified via $args. The $options parameter contains process options:
  • encoding: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.
  • timeout: abort process execution after the specified number of seconds.
  • dir: process command in the specified directory.
  • input: standard string input (stdin) to be passed on to the command.
" - }, - "http://basex.org/modules/proc#execute#1": { - "name": "execute", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#execute#1", - "params": [ - "$cmd as xs:string" - ], - "type": "element(result)", - "description": " Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system.
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

  <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
" - }, - "http://basex.org/modules/proc#execute#2": { - "name": "execute", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#execute#2", - "params": [ - "$cmd as xs:string", - "$args as xs:string*" - ], - "type": "element(result)", - "description": " Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system.
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

  <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
" - }, - "http://basex.org/modules/proc#execute#3": { - "name": "execute", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#execute#3", - "params": [ - "$cmd as xs:string", - "$args as xs:string*", - "$options as map(xs:string, xs:string)" - ], - "type": "element(result)", - "description": " Executes the specified command in a separate process and returns the result as element:
  • $cmd is the name of the command, and arguments to the command may be specified via $args.
  • The same $options are allowed as for proc:system.
  • Instead of the proc:error error, the error message and process code will be assigned to the returned elements.
  • Instead of the proc:code.... error, the error message will be assigned to the returned element (no process code will be returned).

The result has the following structure:

  <result> <output>...output...</output> <error>...error message...</error> <code>...process code...</code> </result> 
" - }, - "http://basex.org/modules/proc#fork#1": { - "name": "fork", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#fork#1", - "params": [ - "$cmd as xs:string" - ], - "type": "element(result)", - "description": " Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored)." - }, - "http://basex.org/modules/proc#fork#2": { - "name": "fork", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#fork#2", - "params": [ - "$cmd as xs:string", - "$args as xs:string*" - ], - "type": "element(result)", - "description": " Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored)." - }, - "http://basex.org/modules/proc#fork#3": { - "name": "fork", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#fork#3", - "params": [ - "$cmd as xs:string", - "$args as xs:string*", - "$options as map(xs:string, xs:string)" - ], - "type": "element(result)", - "description": " Executes the specified command and ignores the result. $cmd is the name of the command, and arguments to the command may be specified via $args. The same $options are allowed as for proc:system (but the encoding will be ignored)." - }, - "http://basex.org/modules/proc#property#1": { - "name": "property", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#property#1", - "params": [ - "$name as xs:string" - ], - "type": "xs:string?", - "description": " Returns the system property, specified by $name, or a context parameter of the web.xml file with that name (see Web Applications). An empty sequence is returned if the property does not exist. For environment variables of the operating system, please use fn:environment-variable." - }, - "http://basex.org/modules/proc#property-names#0": { - "name": "property-names", - "uri": "http://basex.org/modules/proc", - "key": "http://basex.org/modules/proc#property-names#0", - "params": [], - "type": "xs:string*", - "description": " Returns the names of all Java system properties and context parameters of the web.xml file (see Web Applications). For environment variables of the operating system, please use fn:available-environment-variables." - } - }, - "description": " This XQuery Module provides functions for executing system commands from XQuery.", - "type": "module", - "override": true - }, - "http://basex.org/modules/prof": { - "ns": "http://basex.org/modules/prof", - "prefixes": [ - "prof" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/prof#track#1": { - "name": "track", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#track#1", - "params": [ - "$expression as item()" - ], - "type": "item()*", - "description": " Measures the execution time and memory consumption required for evaluating the specified $expression and returns a map with the results. The following $options are available:
  • time: Include execution time in result as xs:decimal (unit: milliseconds; default: true).
  • memory: Include memory consumption in result as xs:integer (unit: bytes; default: false).
  • value: Include value in result (default: true).

Helpful notes:

  • If you are not interested in some of the returned results, you should disable them to save time and memory.
  • Profiling might change the execution behavior of your code: An expression that might be executed iteratively will be cached by the profiling function.
  • If a value has a compact internal representation, memory consumption will be very low, even if the serialized result may consume much more memory.
  • Please note that memory profiling is only approximative, so it can be quite misleading. If the memory option is enabled, main-memory will be garbage-collected before and after evaluation to improve the quality of the measurement.
" - }, - "http://basex.org/modules/prof#track#2": { - "name": "track", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#track#2", - "params": [ - "$expression as item()", - "$options as map(*)?" - ], - "type": "item()*", - "description": " Measures the execution time and memory consumption required for evaluating the specified $expression and returns a map with the results. The following $options are available:
  • time: Include execution time in result as xs:decimal (unit: milliseconds; default: true).
  • memory: Include memory consumption in result as xs:integer (unit: bytes; default: false).
  • value: Include value in result (default: true).

Helpful notes:

  • If you are not interested in some of the returned results, you should disable them to save time and memory.
  • Profiling might change the execution behavior of your code: An expression that might be executed iteratively will be cached by the profiling function.
  • If a value has a compact internal representation, memory consumption will be very low, even if the serialized result may consume much more memory.
  • Please note that memory profiling is only approximative, so it can be quite misleading. If the memory option is enabled, main-memory will be garbage-collected before and after evaluation to improve the quality of the measurement.
" - }, - "http://basex.org/modules/prof#time#1": { - "name": "time", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#time#1", - "params": [ - "$expr as item()" - ], - "type": "item()*", - "description": " Measures the time needed to evaluate $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes." - }, - "http://basex.org/modules/prof#time#2": { - "name": "time", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#time#2", - "params": [ - "$expr as item()", - "$label as xs:string" - ], - "type": "item()*", - "description": " Measures the time needed to evaluate $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes." - }, - "http://basex.org/modules/prof#memory#1": { - "name": "memory", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#memory#1", - "params": [ - "$expr as item()" - ], - "type": "item()*", - "description": " Measures the memory allocated by evaluating $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes." - }, - "http://basex.org/modules/prof#memory#2": { - "name": "memory", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#memory#2", - "params": [ - "$expr as item()", - "$label as xs:string" - ], - "type": "item()*", - "description": " Measures the memory allocated by evaluating $expr and outputs a string to standard error or, if the GUI is used, to the Info View. An optional $label may be specified to tag the profiling result. See prof:track for further notes." - }, - "http://basex.org/modules/prof#current-ms#0": { - "name": "current-ms", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#current-ms#0", - "params": [], - "type": "xs:integer", - "description": " Returns the number of milliseconds passed since 1970/01/01 UTC. The granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds." - }, - "http://basex.org/modules/prof#current-ns#0": { - "name": "current-ns", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#current-ns#0", - "params": [], - "type": "xs:integer", - "description": " Returns the current value of the most precise available system timer in nanoseconds." - }, - "http://basex.org/modules/prof#dump#1": { - "name": "dump", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#dump#1", - "params": [ - "$expr as item()*" - ], - "type": "empty-sequence()", - "description": " Dumps a serialized representation of $expr to STDERR, optionally prefixed with $label, and returns an empty sequence. If the GUI is used, the dumped result is shown in the Info View." - }, - "http://basex.org/modules/prof#dump#2": { - "name": "dump", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#dump#2", - "params": [ - "$expr as item()*", - "$label as xs:string" - ], - "type": "empty-sequence()", - "description": " Dumps a serialized representation of $expr to STDERR, optionally prefixed with $label, and returns an empty sequence. If the GUI is used, the dumped result is shown in the Info View." - }, - "http://basex.org/modules/prof#variables#0": { - "name": "variables", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#variables#0", - "params": [], - "type": "empty-sequence()", - "description": " Prints a list of all current local and global variable assignments to standard error or, if the GUI is used, to the Info View.
As every query is optimized before being evaluated, not all of the original variables may be visible in the output. Moreover, many variables of function calls will disappear because functions are inlined. Function inlining can be turned off by setting INLINELIMIT to 0." - }, - "http://basex.org/modules/prof#type#1": { - "name": "type", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#type#1", - "params": [ - "$expr as item()*" - ], - "type": "item()*", - "description": " Similar to fn:trace($expr, $msg), but instead of a user-defined message, it emits the compile-time type and estimated result size of its argument." - }, - "http://basex.org/modules/prof#gc#0": { - "name": "gc", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#gc#0", - "params": [], - "type": "empty-sequence()", - "description": " Enforces Java garbage collection. If no $count is supplied, garbage will be collected once. Please note that this function should only be used for debugging purposes; in productive code, it is best to trust the garbage collecting strategies of Java." - }, - "http://basex.org/modules/prof#gc#1": { - "name": "gc", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#gc#1", - "params": [ - "$count as xs:integer" - ], - "type": "empty-sequence()", - "description": " Enforces Java garbage collection. If no $count is supplied, garbage will be collected once. Please note that this function should only be used for debugging purposes; in productive code, it is best to trust the garbage collecting strategies of Java." - }, - "http://basex.org/modules/prof#runtime#1": { - "name": "runtime", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#runtime#1", - "params": [ - "$name as xs:string" - ], - "type": "xs:integer", - "description": " Returns the value of the specified runtime $option. The following options exist:
  • max: Maximum memory that the Java virtual machine will attempt to use.
  • total: Total memory in the Java virtual machine (varies over time).
  • used: Currently used memory (varies over time, will shrink after garbage collection).
  • processors: number of processors available to the Java virtual machine.
" - }, - "http://basex.org/modules/prof#void#1": { - "name": "void", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#void#1", - "params": [ - "$value as item()*" - ], - "type": "empty-sequence()", - "description": " Swallows all items of the specified $value and returns an empty sequence. This function is helpful if some code needs to be evaluated and if the actual result is irrelevant." - }, - "http://basex.org/modules/prof#sleep#1": { - "name": "sleep", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#sleep#1", - "params": [ - "$ms as xs:integer" - ], - "type": "empty-sequence()", - "description": " Sleeps for the specified number of milliseconds." - }, - "http://basex.org/modules/prof#human#1": { - "name": "human", - "uri": "http://basex.org/modules/prof", - "key": "http://basex.org/modules/prof#human#1", - "params": [ - "$number as xs:integer" - ], - "type": "xs:string", - "description": " Returns a human-readable representation of the specified $number." - } - }, - "description": " This XQuery Module contains various functions to test and profile code, and to dump information to standard output.", - "type": "module", - "override": true - }, - "http://basex.org/modules/random": { - "ns": "http://basex.org/modules/random", - "prefixes": [ - "random" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/random#double#0": { - "name": "double", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#double#0", - "params": [], - "type": "xs:double", - "description": " Returns a double value between 0.0 (inclusive) and 1.0 (exclusive).
" - }, - "http://basex.org/modules/random#integer#0": { - "name": "integer", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#integer#0", - "params": [], - "type": "xs:integer", - "description": " Returns an integer value, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive)
" - }, - "http://basex.org/modules/random#integer#1": { - "name": "integer", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#integer#1", - "params": [ - "$max as xs:integer" - ], - "type": "xs:integer", - "description": " Returns an integer value, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive)
" - }, - "http://basex.org/modules/random#seeded-double#2": { - "name": "seeded-double", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#seeded-double#2", - "params": [ - "$seed as xs:integer", - "$num as xs:integer" - ], - "type": "xs:double*", - "description": " Returns a sequence with $num double values between 0.0 (inclusive) and 1.0 (exclusive). The random values are created using the initial seed given in $seed.
" - }, - "http://basex.org/modules/random#seeded-integer#2": { - "name": "seeded-integer", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#seeded-integer#2", - "params": [ - "$seed as xs:integer", - "$num as xs:integer" - ], - "type": "xs:integer*", - "description": " Returns a sequence with $num integer values, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive). The random values are created using the initial seed given in $seed.
" - }, - "http://basex.org/modules/random#seeded-integer#3": { - "name": "seeded-integer", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#seeded-integer#3", - "params": [ - "$seed as xs:integer", - "$num as xs:integer", - "$max as xs:integer" - ], - "type": "xs:integer*", - "description": " Returns a sequence with $num integer values, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive). The random values are created using the initial seed given in $seed.
" - }, - "http://basex.org/modules/random#gaussian#1": { - "name": "gaussian", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#gaussian#1", - "params": [ - "$num as xs:integer" - ], - "type": "xs:double*", - "description": " Returns a sequence with $num double values. The random values are Gaussian (i.e. normally) distributed with the mean 0.0. and the derivation 1.0.
" - }, - "http://basex.org/modules/random#seeded-permutation#2": { - "name": "seeded-permutation", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#seeded-permutation#2", - "params": [ - "$seed as xs:integer", - "$items as item()*" - ], - "type": "item()*", - "description": " Returns a random permutation of the specified $items. The random order is created using the initial seed given in $seed.
" - }, - "http://basex.org/modules/random#uuid#0": { - "name": "uuid", - "uri": "http://basex.org/modules/random", - "key": "http://basex.org/modules/random#uuid#0", - "params": [], - "type": "xs:string", - "description": " Creates a random universally unique identifier (UUID), represented as 128-bit value." - } - }, - "description": " This XQuery Module contains functions for computing random values. All functions except for random:seeded-double and random:seeded-integer are non-deterministic, i. e., they return different values for each call.", - "type": "module", - "override": true - }, - "http://basex.org/modules/repo": { - "ns": "http://basex.org/modules/repo", - "prefixes": [ - "repo" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/repo#install#1": { - "name": "install", - "uri": "http://basex.org/modules/repo", - "key": "http://basex.org/modules/repo#install#1", - "params": [ - "$path as xs:string" - ], - "type": "empty-sequence()", - "description": " Installs a package or replaces an existing package. The parameter $path indicates the path to the package.
" - }, - "http://basex.org/modules/repo#delete#1": { - "name": "delete", - "uri": "http://basex.org/modules/repo", - "key": "http://basex.org/modules/repo#delete#1", - "params": [ - "$pkg as xs:string" - ], - "type": "empty-sequence()", - "description": " Deletes a package. The parameter $pkg indicates the package name, optionally suffixed with a dash and the package version.
" - }, - "http://basex.org/modules/repo#list#0": { - "name": "list", - "uri": "http://basex.org/modules/repo", - "key": "http://basex.org/modules/repo#list#0", - "params": [], - "type": "element(package)*", - "description": " Lists the names and versions of all currently installed packages.
" - } - }, - "description": " This XQuery Module contains functions for installing, listing and deleting modules contained in the Repository.", - "type": "module", - "override": true - }, - "http://exquery.org/ns/request": { - "ns": "http://exquery.org/ns/request", - "prefixes": [ - "request" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://exquery.org/ns/request#method#0": { - "name": "method", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#method#0", - "params": [], - "type": "xs:string", - "description": " Returns the Method of the HTTP request." - }, - "http://exquery.org/ns/request#scheme#0": { - "name": "scheme", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#scheme#0", - "params": [], - "type": "xs:string", - "description": " Returns the Scheme component of the URI of an HTTP request." - }, - "http://exquery.org/ns/request#hostname#0": { - "name": "hostname", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#hostname#0", - "params": [], - "type": "xs:string", - "description": " Returns the Hostname component of the URI of an HTTP request." - }, - "http://exquery.org/ns/request#port#0": { - "name": "port", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#port#0", - "params": [], - "type": "xs:integer", - "description": " Returns the Port component of the URI of an HTTP request, or a default port if it has not been explicitly specified in the URI." - }, - "http://exquery.org/ns/request#path#0": { - "name": "path", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#path#0", - "params": [], - "type": "xs:string", - "description": " Returns the Path component of the URI of an HTTP request." - }, - "http://exquery.org/ns/request#query#0": { - "name": "query", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#query#0", - "params": [], - "type": "xs:string?", - "description": " Returns the Query component of the URI of an HTTP request. If no query component exists, an empty sequence is returned." - }, - "http://exquery.org/ns/request#uri#0": { - "name": "uri", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#uri#0", - "params": [], - "type": "xs:anyURI", - "description": " Returns the complete URI of an HTTP request as it has been specified by the client." - }, - "http://exquery.org/ns/request#context-path#0": { - "name": "context-path", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#context-path#0", - "params": [], - "type": "xs:string", - "description": " Returns the context of the request. For servlets in the default (root) context, this method returns an empty string." - }, - "http://exquery.org/ns/request#address#0": { - "name": "address", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#address#0", - "params": [], - "type": "xs:string", - "description": " Returns the IP address of the server." - }, - "http://exquery.org/ns/request#remote-hostname#0": { - "name": "remote-hostname", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#remote-hostname#0", - "params": [], - "type": "xs:string", - "description": " Returns the fully qualified hostname of the client that sent the request." - }, - "http://exquery.org/ns/request#remote-address#0": { - "name": "remote-address", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#remote-address#0", - "params": [], - "type": "xs:string", - "description": " Returns the IP address of the client that sent the request." - }, - "http://exquery.org/ns/request#remote-port#0": { - "name": "remote-port", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#remote-port#0", - "params": [], - "type": "xs:string", - "description": " Returns the TCP port of the client socket that triggered the request." - }, - "http://exquery.org/ns/request#parameter-names#0": { - "name": "parameter-names", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#parameter-names#0", - "params": [], - "type": "xs:string*", - "description": " Returns the names of all query and form field parameters available from the HTTP request. With RESTXQ, this function can be used to access parameters that have not been statically bound by %rest:query-param." - }, - "http://exquery.org/ns/request#parameter#1": { - "name": "parameter", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#parameter#1", - "params": [ - "$name as xs:string" - ], - "type": "xs:string*", - "description": " Returns the value of the named query or form field parameter in an HTTP request. If the parameter does not exist, an empty sequence or the optionally specified default value is returned instead. If both query and form field parameters with the same name exist, the form field values will be attached to the query values." - }, - "http://exquery.org/ns/request#parameter#2": { - "name": "parameter", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#parameter#2", - "params": [ - "$name as xs:string", - "$default as xs:string" - ], - "type": "xs:string*", - "description": " Returns the value of the named query or form field parameter in an HTTP request. If the parameter does not exist, an empty sequence or the optionally specified default value is returned instead. If both query and form field parameters with the same name exist, the form field values will be attached to the query values." - }, - "http://exquery.org/ns/request#header-names#0": { - "name": "header-names", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#header-names#0", - "params": [], - "type": "xs:string*", - "description": " Returns the names of all headers available from the HTTP request. If RESTXQ is used, this function can be used to access headers that have not been statically bound by %rest:header-param." - }, - "http://exquery.org/ns/request#header#1": { - "name": "header", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#header#1", - "params": [ - "$name as xs:string" - ], - "type": "xs:string?", - "description": " Returns the value of the named header in an HTTP request. If the header does not exist, an empty sequence or the optionally specified default value is returned instead." - }, - "http://exquery.org/ns/request#header#2": { - "name": "header", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#header#2", - "params": [ - "$name as xs:string", - "$default as xs:string" - ], - "type": "xs:string", - "description": " Returns the value of the named header in an HTTP request. If the header does not exist, an empty sequence or the optionally specified default value is returned instead." - }, - "http://exquery.org/ns/request#cookie-names#0": { - "name": "cookie-names", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#cookie-names#0", - "params": [], - "type": "xs:string*", - "description": " Returns the names of all cookies in the HTTP headers available from the HTTP request. If RESTXQ is used, this function can be used to access cookies that have not been statically bound by %rest:cookie-param." - }, - "http://exquery.org/ns/request#cookie#1": { - "name": "cookie", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#cookie#1", - "params": [ - "$name as xs:string" - ], - "type": "xs:string?", - "description": " Returns the value of the named Cookie in an HTTP request. If there is no such cookie, an empty sequence or the optionally specified default value is returned instead." - }, - "http://exquery.org/ns/request#cookie#2": { - "name": "cookie", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#cookie#2", - "params": [ - "$name as xs:string", - "$default as xs:string" - ], - "type": "xs:string", - "description": " Returns the value of the named Cookie in an HTTP request. If there is no such cookie, an empty sequence or the optionally specified default value is returned instead." - }, - "http://exquery.org/ns/request#attribute-names#0": { - "name": "attribute-names", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#attribute-names#0", - "params": [], - "type": "xs:string*", - "description": " Returns the names of all HTTP request attributes." - }, - "http://exquery.org/ns/request#attribute#1": { - "name": "attribute", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#attribute#1", - "params": [ - "$name as xs:string" - ], - "type": "item()*", - "description": " Returns the value of an attribute of the HTTP request. If the attribute does not exist, an empty sequence or the optionally specified default value is returned instead." - }, - "http://exquery.org/ns/request#attribute#2": { - "name": "attribute", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#attribute#2", - "params": [ - "$name as xs:string", - "$default as item()*" - ], - "type": "item()*", - "description": " Returns the value of an attribute of the HTTP request. If the attribute does not exist, an empty sequence or the optionally specified default value is returned instead." - }, - "http://exquery.org/ns/request#set-attribute#2": { - "name": "set-attribute", - "uri": "http://exquery.org/ns/request", - "key": "http://exquery.org/ns/request#set-attribute#2", - "params": [ - "$name as xs:string", - "$value as item()*" - ], - "type": "empty-sequence()", - "description": " Binds the specified $value to the request attribute with the specified $name." - } - }, - "description": " This XQuery Module contains functions for retrieving information on an HTTP request that has triggered the query. It is mostly useful when building Web Applications.", - "type": "module", - "override": true - }, - "http://exquery.org/ns/restxq": { - "ns": "http://exquery.org/ns/restxq", - "prefixes": [ - "rest" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://exquery.org/ns/restxq#base-uri#0": { - "name": "base-uri", - "uri": "http://exquery.org/ns/restxq", - "key": "http://exquery.org/ns/restxq#base-uri#0", - "params": [], - "type": "xs:anyURI", - "description": " Returns the implementation-defined base URI of the resource function." - }, - "http://exquery.org/ns/restxq#uri#0": { - "name": "uri", - "uri": "http://exquery.org/ns/restxq", - "key": "http://exquery.org/ns/restxq#uri#0", - "params": [], - "type": "xs:anyURI", - "description": " Returns the complete URI that addresses the Resource Function. This is the result of rest:base-uri appended with the path from the path annotation of the resource function." - }, - "http://exquery.org/ns/restxq#wadl#0": { - "name": "wadl", - "uri": "http://exquery.org/ns/restxq", - "key": "http://exquery.org/ns/restxq#wadl#0", - "params": [], - "type": "element(wadl:application)", - "description": " Returns a WADL description of all available REST services." - }, - "http://exquery.org/ns/restxq#init#0": { - "name": "init", - "uri": "http://exquery.org/ns/restxq", - "key": "http://exquery.org/ns/restxq#init#0", - "params": [], - "type": "empty-sequence()", - "description": " Initializes the RESTXQ module cache:
  • By default, the cache will be discarded, and all modules will be parsed and cached again.
  • If $update is enabled, the background caching behavior is simulated (see PARSERESTXQ ): Only updated modules will be parsed.
  • This function should be called if new RESTXQ code is deployed at runtime.
" - }, - "http://exquery.org/ns/restxq#init#1": { - "name": "init", - "uri": "http://exquery.org/ns/restxq", - "key": "http://exquery.org/ns/restxq#init#1", - "params": [ - "$update as xs:boolean" - ], - "type": "empty-sequence()", - "description": " Initializes the RESTXQ module cache:
  • By default, the cache will be discarded, and all modules will be parsed and cached again.
  • If $update is enabled, the background caching behavior is simulated (see PARSERESTXQ ): Only updated modules will be parsed.
  • This function should be called if new RESTXQ code is deployed at runtime.
" - } - }, - "description": " This XQuery Module contains helper functions for the RESTXQ API, some of which are defined in the RESTXQ Draft.", - "type": "module", - "override": true - }, - "http://basex.org/modules/session": { - "ns": "http://basex.org/modules/session", - "prefixes": [ - "session" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/session#id#0": { - "name": "id", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#id#0", - "params": [], - "type": "xs:string", - "description": " Returns the session ID of a servlet request." - }, - "http://basex.org/modules/session#created#0": { - "name": "created", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#created#0", - "params": [], - "type": "xs:dateTime", - "description": " Returns the creation time of a session." - }, - "http://basex.org/modules/session#accessed#0": { - "name": "accessed", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#accessed#0", - "params": [], - "type": "xs:dateTime", - "description": " Returns the last access time of a session." - }, - "http://basex.org/modules/session#names#0": { - "name": "names", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#names#0", - "params": [], - "type": "xs:string*", - "description": " Returns the names of all attributes bound to the current session." - }, - "http://basex.org/modules/session#get#1": { - "name": "get", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#get#1", - "params": [ - "$name as xs:string" - ], - "type": "item()*", - "description": " Returns the value of a session attribute with the specified $name. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead." - }, - "http://basex.org/modules/session#get#2": { - "name": "get", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#get#2", - "params": [ - "$name as xs:string", - "$default as item()*" - ], - "type": "item()*", - "description": " Returns the value of a session attribute with the specified $name. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead." - }, - "http://basex.org/modules/session#set#2": { - "name": "set", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#set#2", - "params": [ - "$name as xs:string", - "$value as item()*" - ], - "type": "empty-sequence()", - "description": " Binds the specified $value to the session attribute with the specified $name." - }, - "http://basex.org/modules/session#delete#1": { - "name": "delete", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#delete#1", - "params": [ - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Deletes a session attribute with the specified $name." - }, - "http://basex.org/modules/session#close#0": { - "name": "close", - "uri": "http://basex.org/modules/session", - "key": "http://basex.org/modules/session#close#0", - "params": [], - "type": "empty-sequence()", - "description": " Unregisters a session and all data associated with it." - } - }, - "description": "", - "type": "module", - "override": true - }, - "http://basex.org/modules/sessions": { - "ns": "http://basex.org/modules/sessions", - "prefixes": [ - "sessions" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/sessions#ids#0": { - "name": "ids", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#ids#0", - "params": [], - "type": "xs:string*", - "description": " Returns the IDs of all registered sessions." - }, - "http://basex.org/modules/sessions#created#1": { - "name": "created", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#created#1", - "params": [ - "$id as xs:string" - ], - "type": "xs:dateTime", - "description": " Returns the creation time of the session specified by $id." - }, - "http://basex.org/modules/sessions#accessed#1": { - "name": "accessed", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#accessed#1", - "params": [ - "$id as xs:string" - ], - "type": "xs:dateTime", - "description": " Returns the last access time of the session specified by $id." - }, - "http://basex.org/modules/sessions#names#1": { - "name": "names", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#names#1", - "params": [ - "$id as xs:string" - ], - "type": "xs:string*", - "description": " Returns the names of all attributes bound to the session specified by $id." - }, - "http://basex.org/modules/sessions#get#2": { - "name": "get", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#get#2", - "params": [ - "$id as xs:string", - "$name as xs:string" - ], - "type": "item()*", - "description": " Returns the value of an attribute with the specified $name from the session with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead." - }, - "http://basex.org/modules/sessions#get#3": { - "name": "get", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#get#3", - "params": [ - "$id as xs:string", - "$name as xs:string", - "$default as item()*" - ], - "type": "item()*", - "description": " Returns the value of an attribute with the specified $name from the session with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead." - }, - "http://basex.org/modules/sessions#set#3": { - "name": "set", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#set#3", - "params": [ - "$id as xs:string", - "$name as xs:string", - "$value as item()*" - ], - "type": "empty-sequence()", - "description": " Returns the specified value to the attribute with the specified $name from the session with the specified $id." - }, - "http://basex.org/modules/sessions#delete#2": { - "name": "delete", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#delete#2", - "params": [ - "$id as xs:string", - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Deletes an attribute with the specified $name from the session with the specified $id." - }, - "http://basex.org/modules/sessions#close#1": { - "name": "close", - "uri": "http://basex.org/modules/sessions", - "key": "http://basex.org/modules/sessions#close#1", - "params": [ - "$id as xs:string" - ], - "type": "empty-sequence()", - "description": " Unregisters the session specified by $id." - } - }, - "description": " This XQuery Module can only be called from users with Admin permissions. It contains functions for accessing and modifying all registered server-side sessions. This module is mainly useful in the context of Web Applications.", - "type": "module", - "override": true - }, - "http://basex.org/modules/sql": { - "ns": "http://basex.org/modules/sql", - "prefixes": [ - "sql" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/sql#init#1": { - "name": "init", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#init#1", - "params": [ - "$class as xs:string" - ], - "type": "empty-sequence()", - "description": " This function initializes a JDBC driver specified via $class. This step might be superfluous if the SQL database is not embedded.
" - }, - "http://basex.org/modules/sql#connect#1": { - "name": "connect", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#connect#1", - "params": [ - "$url as xs:string" - ], - "type": "xs:anyURI", - "description": " This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:<server> [/<database>]. If the parameters $user and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options." - }, - "http://basex.org/modules/sql#connect#3": { - "name": "connect", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#connect#3", - "params": [ - "$url as xs:string", - "$user as xs:string", - "$password as xs:string" - ], - "type": "xs:anyURI", - "description": " This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:<server> [/<database>]. If the parameters $user and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options." - }, - "http://basex.org/modules/sql#connect#4": { - "name": "connect", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#connect#4", - "params": [ - "$url as xs:string", - "$user as xs:string", - "$password as xs:string", - "$options as map(*)?" - ], - "type": "xs:anyURI", - "description": " This function establishes a connection to a relational database and returns a connection id. The parameter $url is the URL of the database and shall be of the form: jdbc:<driver name>:<server> [/<database>]. If the parameters $user and $password are specified, they are used as credentials for connecting to the database. The $options parameter can be used to set connection options." - }, - "http://basex.org/modules/sql#execute#2": { - "name": "execute", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#execute#2", - "params": [ - "$id as xs:anyURI", - "$statement as xs:string" - ], - "type": "item()*", - "description": " This function executes an SQL $statement, using the connection with the specified $id. The returned result depends on the kind of statement:
  • If an update statement was executed, the number of updated rows will be returned as integer.
  • Otherwise, an XML representation of all results will be returned.

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
" - }, - "http://basex.org/modules/sql#execute#3": { - "name": "execute", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#execute#3", - "params": [ - "$id as xs:anyURI", - "$statement as xs:string", - "$options as map(*)?" - ], - "type": "item()*", - "description": " This function executes an SQL $statement, using the connection with the specified $id. The returned result depends on the kind of statement:
  • If an update statement was executed, the number of updated rows will be returned as integer.
  • Otherwise, an XML representation of all results will be returned.

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
" - }, - "http://basex.org/modules/sql#execute-prepared#2": { - "name": "execute-prepared", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#execute-prepared#2", - "params": [ - "$id as xs:anyURI", - "$params as element(sql:parameters)" - ], - "type": "item()*", - "description": " This function executes a prepared statement with the specified $id. The output format is identical to sql:execute. The optional parameter $params is an element <sql:parameters/> representing the parameters for a prepared statement along with their types and values. The following schema shall be used:
  element sql:parameters { element sql:parameter { attribute type { \"bigdecimal\" | \"boolean\" | \"byte\" | \"date\" | \"double\" | \"float\" | \"int\" | \"long\" | \"short\" | \"sqlxml\" | \"string\" | \"time\" | \"timestamp\" }, attribute null { \"true\" | \"false\" }?, text } + } ? 

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
" - }, - "http://basex.org/modules/sql#execute-prepared#3": { - "name": "execute-prepared", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#execute-prepared#3", - "params": [ - "$id as xs:anyURI", - "$params as element(sql:parameters)", - "$options as map(*)?" - ], - "type": "item()*", - "description": " This function executes a prepared statement with the specified $id. The output format is identical to sql:execute. The optional parameter $params is an element <sql:parameters/> representing the parameters for a prepared statement along with their types and values. The following schema shall be used:
  element sql:parameters { element sql:parameter { attribute type { \"bigdecimal\" | \"boolean\" | \"byte\" | \"date\" | \"double\" | \"float\" | \"int\" | \"long\" | \"short\" | \"sqlxml\" | \"string\" | \"time\" | \"timestamp\" }, attribute null { \"true\" | \"false\" }?, text } + } ? 

With $options, the following parameter can be set:

  • timeout: query execution will be interrupted after the specified number of seconds.
" - }, - "http://basex.org/modules/sql#prepare#2": { - "name": "prepare", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#prepare#2", - "params": [ - "$id as xs:anyURI", - "$statement as xs:string" - ], - "type": "xs:anyURI", - "description": " This function prepares an SQL $statement, using the specified connection $id, and returns the id reference to this statement. The statement is a string with one or more '?' placeholders. If the value of a field has to be set to NULL, then the attribute null of the <sql:parameter/> element must be true." - }, - "http://basex.org/modules/sql#commit#1": { - "name": "commit", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#commit#1", - "params": [ - "$id as xs:anyURI" - ], - "type": "empty-sequence()", - "description": " This function commits the changes made to a relational database, using the specified connection $id." - }, - "http://basex.org/modules/sql#rollback#1": { - "name": "rollback", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#rollback#1", - "params": [ - "$id as xs:anyURI" - ], - "type": "empty-sequence()", - "description": " This function rolls back the changes made to a relational database, using the specified connection $id." - }, - "http://basex.org/modules/sql#close#1": { - "name": "close", - "uri": "http://basex.org/modules/sql", - "key": "http://basex.org/modules/sql#close#1", - "params": [ - "$id as xs:anyURI" - ], - "type": "empty-sequence()", - "description": " This function closes a database connection with the specified $id.
Opened connections will automatically be closed after the XQuery expression has been evaluated, but in order to save memory, it is always recommendable to close connections that are not used anymore." - } - }, - "description": " This XQuery Module contains functions to access relational databases from XQuery using SQL. With this module, you can execute query, update and prepared statements, and the result sets are returned as sequences of XML elements representing tuples. Each element has children representing the columns returned by the SQL statement.", - "type": "module", - "override": true - }, - "http://basex.org/modules/store": { - "ns": "http://basex.org/modules/store", - "prefixes": [ - "store" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/store#get#1": { - "name": "get", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#get#1", - "params": [ - "$key as xs:string" - ], - "type": "item()*", - "description": " Retrieves an entry from the store with the given $key. If the addressed entry does not exist, an empty sequence is returned." - }, - "http://basex.org/modules/store#put#2": { - "name": "put", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#put#2", - "params": [ - "$key as xs:string", - "$value as item()*" - ], - "type": "empty-sequence()", - "description": " Stores an entry with the given $key and $value in the store:
  • If the value is an empty sequence, the entry is removed.
  • If a value refers to an opened database or is a lazy item, its contents are materialized in main memory.
  • Values with function items are rejected.
" - }, - "http://basex.org/modules/store#get-or-put#2": { - "name": "get-or-put", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#get-or-put#2", - "params": [ - "$key as xs:string", - "$put as function() as item()*" - ], - "type": "item()*", - "description": " Retrieves an entry from the store with the given $key. The $put function will only be invoked if the entry does not exist, and its result will be stored and returned instead." - }, - "http://basex.org/modules/store#remove#1": { - "name": "remove", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#remove#1", - "params": [ - "$key as xs:string" - ], - "type": "empty-sequence()", - "description": " Removes an entry with the given $key from the store. No error will be raised if an addressed entry does not exist." - }, - "http://basex.org/modules/store#keys#0": { - "name": "keys", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#keys#0", - "params": [], - "type": "xs:string*", - "description": " Lists the names of all keys." - }, - "http://basex.org/modules/store#clear#0": { - "name": "clear", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#clear#0", - "params": [], - "type": "empty-sequence()", - "description": " Resets the store by removing all its entries." - }, - "http://basex.org/modules/store#read#0": { - "name": "read", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#read#0", - "params": [], - "type": "empty-sequence()", - "description": " Retrieves the standard store from disk, or a custom store if a $name is supplied." - }, - "http://basex.org/modules/store#read#1": { - "name": "read", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#read#1", - "params": [ - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Retrieves the standard store from disk, or a custom store if a $name is supplied." - }, - "http://basex.org/modules/store#write#0": { - "name": "write", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#write#0", - "params": [], - "type": "empty-sequence()", - "description": " Writes the standard store to disk, or to a custom store file if a $name is supplied. If the standard store is empty, the store file will be deleted." - }, - "http://basex.org/modules/store#write#1": { - "name": "write", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#write#1", - "params": [ - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Writes the standard store to disk, or to a custom store file if a $name is supplied. If the standard store is empty, the store file will be deleted." - }, - "http://basex.org/modules/store#list#0": { - "name": "list", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#list#0", - "params": [], - "type": "xs:string*", - "description": " Lists the names of all custom stores." - }, - "http://basex.org/modules/store#delete#1": { - "name": "delete", - "uri": "http://basex.org/modules/store", - "key": "http://basex.org/modules/store#delete#1", - "params": [ - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Deletes a custom store from disk." - } - }, - "description": " This XQuery Module provides functions to organize values in a main-memory key-value store.", - "type": "module", - "override": true - }, - "http://basex.org/modules/strings": { - "ns": "http://basex.org/modules/strings", - "prefixes": [ - "strings" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/strings#levenshtein#2": { - "name": "levenshtein", - "uri": "http://basex.org/modules/strings", - "key": "http://basex.org/modules/strings#levenshtein#2", - "params": [ - "$string1 as xs:string", - "$string2 as xs:string" - ], - "type": "xs:double", - "description": " Computes the Damerau-Levenshtein Distance for two strings and returns a double value (0.0 - 1.0). The returned value is computed as follows:
  • 1.0 – distance / max(length of strings)
  • 1.0 is returned if the strings are equal; 0.0 is returned if the strings are too different.
" - }, - "http://basex.org/modules/strings#soundex#1": { - "name": "soundex", - "uri": "http://basex.org/modules/strings", - "key": "http://basex.org/modules/strings#soundex#1", - "params": [ - "$string as xs:string" - ], - "type": "xs:string", - "description": " Computes the Soundex value for the specified string. The algorithm can be used to find and index English words with similar pronouncation." - }, - "http://basex.org/modules/strings#cologne-phonetic#1": { - "name": "cologne-phonetic", - "uri": "http://basex.org/modules/strings", - "key": "http://basex.org/modules/strings#cologne-phonetic#1", - "params": [ - "$string as xs:string" - ], - "type": "xs:string", - "description": " Computes the Kölner Phonetik value for the specified string. Similar to Soundex, the algorithm is used to find similarly pronounced words, but for the German language. As the first returned digit can be 0, the value is returned as string." - } - }, - "description": "", - "type": "module", - "override": true - }, - "http://basex.org/modules/unit": { - "ns": "http://basex.org/modules/unit", - "prefixes": [ - "unit" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/unit#assert#1": { - "name": "assert", - "uri": "http://basex.org/modules/unit", - "key": "http://basex.org/modules/unit#assert#1", - "params": [ - "$test as item()*" - ], - "type": "empty-sequence()", - "description": " Asserts that the effective boolean value of the specified $test is true and returns an empty sequence. Otherwise, raises an error. The effective boolean value of an expression can be explicitly computed by using the fn:boolean function.
The default failure message can be overridden with the $info argument." - }, - "http://basex.org/modules/unit#assert#2": { - "name": "assert", - "uri": "http://basex.org/modules/unit", - "key": "http://basex.org/modules/unit#assert#2", - "params": [ - "$test as item()*", - "$info as item()" - ], - "type": "empty-sequence()", - "description": " Asserts that the effective boolean value of the specified $test is true and returns an empty sequence. Otherwise, raises an error. The effective boolean value of an expression can be explicitly computed by using the fn:boolean function.
The default failure message can be overridden with the $info argument." - }, - "http://basex.org/modules/unit#assert-equals#2": { - "name": "assert-equals", - "uri": "http://basex.org/modules/unit", - "key": "http://basex.org/modules/unit#assert-equals#2", - "params": [ - "$returned as item()*", - "$expected as item()*" - ], - "type": "empty-sequence()", - "description": " Asserts that the specified arguments are equal according to the rules of the fn:deep-equal function. Otherwise, raises an error.
The default failure message can be overridden with the $info argument." - }, - "http://basex.org/modules/unit#assert-equals#3": { - "name": "assert-equals", - "uri": "http://basex.org/modules/unit", - "key": "http://basex.org/modules/unit#assert-equals#3", - "params": [ - "$returned as item()*", - "$expected as item()*", - "$info as item()" - ], - "type": "empty-sequence()", - "description": " Asserts that the specified arguments are equal according to the rules of the fn:deep-equal function. Otherwise, raises an error.
The default failure message can be overridden with the $info argument." - }, - "http://basex.org/modules/unit#fail#0": { - "name": "fail", - "uri": "http://basex.org/modules/unit", - "key": "http://basex.org/modules/unit#fail#0", - "params": [], - "type": "empty-sequence()", - "description": " Raises a unit error. The default failure message can be overridden with the $info argument." - }, - "http://basex.org/modules/unit#fail#1": { - "name": "fail", - "uri": "http://basex.org/modules/unit", - "key": "http://basex.org/modules/unit#fail#1", - "params": [ - "$info as item()" - ], - "type": "empty-sequence()", - "description": " Raises a unit error. The default failure message can be overridden with the $info argument." - } - }, - "description": " This XQuery Module contains annotations and functions for performing XQUnit tests.", - "type": "module", - "override": true - }, - "http://basex.org/modules/update": { - "ns": "http://basex.org/modules/update", - "prefixes": [ - "update" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/update#apply#2": { - "name": "apply", - "uri": "http://basex.org/modules/update", - "key": "http://basex.org/modules/update#apply#2", - "params": [ - "$function as function(*)", - "$arguments as array(*)" - ], - "type": "empty-sequence()", - "description": " The updating variant of fn:apply applies the specified updating $function to the specified $arguments." - }, - "http://basex.org/modules/update#for-each#2": { - "name": "for-each", - "uri": "http://basex.org/modules/update", - "key": "http://basex.org/modules/update#for-each#2", - "params": [ - "$seq as item()*", - "$function as function(item()) as item()*" - ], - "type": "empty-sequence()", - "description": " The updating variant of fn:for-each applies the specified updating $function to every item of $seq." - }, - "http://basex.org/modules/update#for-each-pair#2": { - "name": "for-each-pair", - "uri": "http://basex.org/modules/update", - "key": "http://basex.org/modules/update#for-each-pair#2", - "params": [ - "$seq1 as item()*", - "$function as function(item()) as item()*" - ], - "type": "empty-sequence()", - "description": " The updating variant of fn:for-each-pair applies the specified updating $function to the successive pairs of items of $seq1 and $seq2. Evaluation is stopped if one sequence yields no more items." - }, - "http://basex.org/modules/update#map-for-each#2": { - "name": "map-for-each", - "uri": "http://basex.org/modules/update", - "key": "http://basex.org/modules/update#map-for-each#2", - "params": [ - "$map as map(*)", - "$function as function(xs:anyAtomicType, item()*) as item()*" - ], - "type": "item()*", - "description": " The updating variant of map:for-each applies the specified $function to every key/value pair of the supplied $map and returns the results as a sequence." - }, - "http://basex.org/modules/update#output#1": { - "name": "output", - "uri": "http://basex.org/modules/update", - "key": "http://basex.org/modules/update#output#1", - "params": [ - "$items as item()*" - ], - "type": "empty-sequence()", - "description": " This function can be used if MIXUPDATES is not enabled, and if values need to returned within an updating expression: The supplied $items will be cached and returned at the very end, i.e., after all updates on the pending update list have been processed. If one of the supplied items is affected by an update, a copy will be created and cached instead." - }, - "http://basex.org/modules/update#cache#0": { - "name": "cache", - "uri": "http://basex.org/modules/update", - "key": "http://basex.org/modules/update#cache#0", - "params": [], - "type": "item()*", - "description": " Returns the items that have been cached by update:output. The output cache can optionally be $reset. The function can be used to check which items will eventually be returned as result of an updating function.
This function is non-deterministic: It will return different results before and after items have been cached. It is e. g. useful when writing unit tests." - }, - "http://basex.org/modules/update#cache#1": { - "name": "cache", - "uri": "http://basex.org/modules/update", - "key": "http://basex.org/modules/update#cache#1", - "params": [ - "$reset as xs:boolean" - ], - "type": "item()*", - "description": " Returns the items that have been cached by update:output. The output cache can optionally be $reset. The function can be used to check which items will eventually be returned as result of an updating function.
This function is non-deterministic: It will return different results before and after items have been cached. It is e. g. useful when writing unit tests." - } - }, - "description": " This XQuery Module provides additional functions for performing updates and returning results in updating expressions.", - "type": "module", - "override": true - }, - "http://basex.org/modules/user": { - "ns": "http://basex.org/modules/user", - "prefixes": [ - "user" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/user#current#0": { - "name": "current", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#current#0", - "params": [], - "type": "xs:string", - "description": " Returns the name of the currently logged in user." - }, - "http://basex.org/modules/user#list#0": { - "name": "list", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#list#0", - "params": [], - "type": "xs:string*", - "description": " Returns the names of all registered users that are visible to the current user." - }, - "http://basex.org/modules/user#list-details#0": { - "name": "list-details", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#list-details#0", - "params": [], - "type": "element(user)*", - "description": " Returns an element sequence, containing all registered users that are visible to the current user.
In addition to the SHOW USERS command, encoded password strings and database permissions will be output. A user $name can be specified to filter the results in advance." - }, - "http://basex.org/modules/user#list-details#1": { - "name": "list-details", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#list-details#1", - "params": [ - "$name as xs:string" - ], - "type": "element(user)*", - "description": " Returns an element sequence, containing all registered users that are visible to the current user.
In addition to the SHOW USERS command, encoded password strings and database permissions will be output. A user $name can be specified to filter the results in advance." - }, - "http://basex.org/modules/user#exists#1": { - "name": "exists", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#exists#1", - "params": [ - "$name as xs:string" - ], - "type": "xs:boolean", - "description": " Checks if a user with the specified $name exists." - }, - "http://basex.org/modules/user#check#2": { - "name": "check", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#check#2", - "params": [ - "$name as xs:string", - "$password as xs:string" - ], - "type": "empty-sequence()", - "description": " Checks if the specified user and password is correct. Raises errors otherwise." - }, - "http://basex.org/modules/user#info#0": { - "name": "info", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#info#0", - "params": [], - "type": "element(info)", - "description": " Returns an info element, which may contain application-specific data. If a user $name is supplied, a user-specific element is returned. By default, the returned element has no contents. It can be modified via user:update-info." - }, - "http://basex.org/modules/user#info#1": { - "name": "info", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#info#1", - "params": [ - "$name as xs:string" - ], - "type": "element(info)", - "description": " Returns an info element, which may contain application-specific data. If a user $name is supplied, a user-specific element is returned. By default, the returned element has no contents. It can be modified via user:update-info." - }, - "http://basex.org/modules/user#create#2": { - "name": "create", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#create#2", - "params": [ - "$name as xs:string", - "$password as xs:string" - ], - "type": "empty-sequence()", - "description": " Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
" - }, - "http://basex.org/modules/user#create#3": { - "name": "create", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#create#3", - "params": [ - "$name as xs:string", - "$password as xs:string", - "$permissions as xs:string*" - ], - "type": "empty-sequence()", - "description": " Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
" - }, - "http://basex.org/modules/user#create#4": { - "name": "create", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#create#4", - "params": [ - "$name as xs:string", - "$password as xs:string", - "$permissions as xs:string*", - "$patterns as xs:string*" - ], - "type": "empty-sequence()", - "description": " Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
" - }, - "http://basex.org/modules/user#create#5": { - "name": "create", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#create#5", - "params": [ - "$name as xs:string", - "$password as xs:string", - "$permissions as xs:string*", - "$patterns as xs:string*", - "$info as element(info)" - ], - "type": "empty-sequence()", - "description": " Creates a new user with the specified $name, $password, and $permissions:
  • Local permissions are granted with non-empty glob $patterns.
  • An $info element with application-specific information can be supplied.
  • The default global permission (none) can be overwritten with an empty pattern or by omitting the last argument.
  • Existing users will be overwritten.
" - }, - "http://basex.org/modules/user#grant#2": { - "name": "grant", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#grant#2", - "params": [ - "$name as xs:string", - "$permissions as xs:string*" - ], - "type": "empty-sequence()", - "description": " Grants global or local $permissions to a user with the specified $name. Local permissions are granted with non-empty glob $patterns." - }, - "http://basex.org/modules/user#grant#3": { - "name": "grant", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#grant#3", - "params": [ - "$name as xs:string", - "$permissions as xs:string*", - "$patterns as xs:string*" - ], - "type": "empty-sequence()", - "description": " Grants global or local $permissions to a user with the specified $name. Local permissions are granted with non-empty glob $patterns." - }, - "http://basex.org/modules/user#drop#1": { - "name": "drop", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#drop#1", - "params": [ - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Drops a user with the specified $name. If non-empty glob $patterns are specified, only the database patterns will be removed." - }, - "http://basex.org/modules/user#drop#2": { - "name": "drop", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#drop#2", - "params": [ - "$name as xs:string", - "$patterns as xs:string*" - ], - "type": "empty-sequence()", - "description": " Drops a user with the specified $name. If non-empty glob $patterns are specified, only the database patterns will be removed." - }, - "http://basex.org/modules/user#alter#2": { - "name": "alter", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#alter#2", - "params": [ - "$name as xs:string", - "$newname as xs:string" - ], - "type": "empty-sequence()", - "description": " Renames a user with the specified $name to $newname." - }, - "http://basex.org/modules/user#password#2": { - "name": "password", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#password#2", - "params": [ - "$name as xs:string", - "$password as xs:string" - ], - "type": "empty-sequence()", - "description": " Changes the password of a user with the specified $name." - }, - "http://basex.org/modules/user#update-info#1": { - "name": "update-info", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#update-info#1", - "params": [ - "$info as element(info)" - ], - "type": "empty-sequence()", - "description": " Assigns the specified $info element to the user management or, if $name is supplied, to a specific user. This function can be used to manage application-specific data (groups, enhanced user info, etc.)." - }, - "http://basex.org/modules/user#update-info#2": { - "name": "update-info", - "uri": "http://basex.org/modules/user", - "key": "http://basex.org/modules/user#update-info#2", - "params": [ - "$info as element(info)", - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Assigns the specified $info element to the user management or, if $name is supplied, to a specific user. This function can be used to manage application-specific data (groups, enhanced user info, etc.)." - } - }, - "description": " This XQuery Module contains functions for creating and administering database users. The User Management article gives more information on database users and permissions.", - "type": "module", - "override": true - }, - "http://basex.org/modules/util": { - "ns": "http://basex.org/modules/util", - "prefixes": [ - "util" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/util#if#2": { - "name": "if", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#if#2", - "params": [ - "$condition as item()*", - "$then as item()*" - ], - "type": "item()*", - "description": " Alternative writing for the if/then/else expression:
  • If the effective boolean value of $condition is true, the $then branch will be evaluated.
  • Otherwise, $else will be evaluated. If no third argument is supplied, an empty sequence will be returned.
" - }, - "http://basex.org/modules/util#if#3": { - "name": "if", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#if#3", - "params": [ - "$condition as item()*", - "$then as item()*", - "$else as item()*" - ], - "type": "item()*", - "description": " Alternative writing for the if/then/else expression:
  • If the effective boolean value of $condition is true, the $then branch will be evaluated.
  • Otherwise, $else will be evaluated. If no third argument is supplied, an empty sequence will be returned.
" - }, - "http://basex.org/modules/util#or#2": { - "name": "or", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#or#2", - "params": [ - "$items as item()*", - "$default as item()*" - ], - "type": "item()*", - "description": " Returns $items if it is a non-empty sequence. Otherwise, returns $default. Equivalent to the following expressions:
  if ( exists ( $ items )) then $ items else $ default , (: Elvis operator :) $ items ?: $ default 
" - }, - "http://basex.org/modules/util#count-within#2": { - "name": "count-within", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#count-within#2", - "params": [ - "$sequence as item()*", - "$min as xs:integer" - ], - "type": "xs:boolean", - "description": " Checks if the specified $sequence has at least $min and, optionally, at most $max items. Equivalent to:
  let $ count := count ( $ sequence ) return $ count >= $ min and $ count <= $ max 
" - }, - "http://basex.org/modules/util#count-within#3": { - "name": "count-within", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#count-within#3", - "params": [ - "$sequence as item()*", - "$min as xs:integer", - "$max as xs:integer" - ], - "type": "xs:boolean", - "description": " Checks if the specified $sequence has at least $min and, optionally, at most $max items. Equivalent to:
  let $ count := count ( $ sequence ) return $ count >= $ min and $ count <= $ max 
" - }, - "http://basex.org/modules/util#item#2": { - "name": "item", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#item#2", - "params": [ - "$sequence as item()*", - "$position as xs:double" - ], - "type": "item()?", - "description": " Returns the item from $sequence at the specified $position. Equivalent to:
  $ sequence [ $ position ] 
" - }, - "http://basex.org/modules/util#range#3": { - "name": "range", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#range#3", - "params": [ - "$sequence as item()*", - "$first as xs:double", - "$last as xs:double" - ], - "type": "item()*", - "description": " Returns items from $sequence, starting at position $first and ending at $last. Equivalent to:
  subsequence ( $ sequence , $ first , $ last - $ first + 1 ) 
" - }, - "http://basex.org/modules/util#last#1": { - "name": "last", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#last#1", - "params": [ - "$sequence as item()*" - ], - "type": "item()?", - "description": " Returns last item of a $sequence. Equivalent to:
  $ sequence [ last ()] 
" - }, - "http://basex.org/modules/util#init#1": { - "name": "init", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#init#1", - "params": [ - "$sequence as item()*" - ], - "type": "item()*", - "description": " Returns all items of a $sequence except for the last one. Equivalent to:
  $ sequence [ position () < last ()] 
" - }, - "http://basex.org/modules/util#ddo#1": { - "name": "ddo", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#ddo#1", - "params": [ - "$nodes as node()*" - ], - "type": "node()*", - "description": " Returns nodes in distinct document order: duplicate nodes will be removed, and the remaining nodes will be returned in document order. As results of path expressions are brought distinct document order before they are returned, the function is equivalent to:
  $ nodes / self :: node () 
" - }, - "http://basex.org/modules/util#root#1": { - "name": "root", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#root#1", - "params": [ - "$nodes as node()*" - ], - "type": "document-node()*", - "description": " Returns the document nodes of the specified $nodes. The path expression /abc is internally represented as util:root(.)/abc</code. Equivalent to:
   $ nodes ! /  
" - }, - "http://basex.org/modules/util#strip-namespaces#1": { - "name": "strip-namespaces", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#strip-namespaces#1", - "params": [ - "$node as node()" - ], - "type": "node()", - "description": " Removes namespaces with the specified $prefixes from the supplied $node. An empty string can be supplied to remove the default namespace. If no prefixes are specified, all namespaces will be removed." - }, - "http://basex.org/modules/util#strip-namespaces#2": { - "name": "strip-namespaces", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#strip-namespaces#2", - "params": [ - "$node as node()", - "$prefixes as xs:string*" - ], - "type": "node()", - "description": " Removes namespaces with the specified $prefixes from the supplied $node. An empty string can be supplied to remove the default namespace. If no prefixes are specified, all namespaces will be removed." - }, - "http://basex.org/modules/util#array-members#1": { - "name": "array-members", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#array-members#1", - "params": [ - "$array as array(*)" - ], - "type": "array(*)*", - "description": " Returns each member of an $array as a new array. Equivalent to:
  for $ a in 1 to array:size ( $ array ) return [ $ array ( $ a ) ] 
" - }, - "http://basex.org/modules/util#array-values#1": { - "name": "array-values", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#array-values#1", - "params": [ - "$array as array(*)" - ], - "type": "item()*", - "description": " Returns all members of an $array as a sequence. Equivalent to:
  $ array ? * 
" - }, - "http://basex.org/modules/util#map-entries#1": { - "name": "map-entries", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#map-entries#1", - "params": [ - "$map as map(*)" - ], - "type": "map(xs:string, item()*)*", - "description": " Returns each entry of a $map as a new map, each with a key and value entry. Equivalent to:
  map:for-each ( $ map , function ( $ key , $ value ) { map { \"key\" : $ key , \"value\" : $ value } }) 
" - }, - "http://basex.org/modules/util#map-values#1": { - "name": "map-values", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#map-values#1", - "params": [ - "$map as map(*)" - ], - "type": "item()*", - "description": " Returns all values of a $map as a sequence. Equivalent to:
  $ map ? * 
" - }, - "http://basex.org/modules/util#replicate#2": { - "name": "replicate", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#replicate#2", - "params": [ - "$input as item()*", - "$count as xs:integer" - ], - "type": "item()*", - "description": " Evaluates $input and returns the result $count times. Unless $multiple is enabled, the input expression is only evaluated once. Equivalent expressions:
  util:replicate ( $ input , $ count , true ()), ( 1 to $ count ) ! $ input 
" - }, - "http://basex.org/modules/util#replicate#3": { - "name": "replicate", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#replicate#3", - "params": [ - "$input as item()*", - "$count as xs:integer", - "$multiple as xs:boolean" - ], - "type": "item()*", - "description": " Evaluates $input and returns the result $count times. Unless $multiple is enabled, the input expression is only evaluated once. Equivalent expressions:
  util:replicate ( $ input , $ count , true ()), ( 1 to $ count ) ! $ input 
" - }, - "http://basex.org/modules/util#intersperse#2": { - "name": "intersperse", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#intersperse#2", - "params": [ - "$items as item()*", - "$separator as item()*" - ], - "type": "item()*", - "description": " Inserts the defined $separator between the $items of a sequence and returns the resulting sequence. Equivalent to:
  head ( $ items ), for $ item in tail ( $ items ) return ( $ separator , $ item ) 
" - }, - "http://basex.org/modules/util#duplicates#1": { - "name": "duplicates", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#duplicates#1", - "params": [ - "$sequence as item()*" - ], - "type": "xs:anyAtomicType*", - "description": " Returns duplicate values in a $sequence. See fn:distinct-values for the applied equality rules and the usage of the $collation argument." - }, - "http://basex.org/modules/util#duplicates#2": { - "name": "duplicates", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#duplicates#2", - "params": [ - "$sequence as item()*", - "$collation as xs:string" - ], - "type": "xs:anyAtomicType*", - "description": " Returns duplicate values in a $sequence. See fn:distinct-values for the applied equality rules and the usage of the $collation argument." - }, - "http://basex.org/modules/util#chars#1": { - "name": "chars", - "uri": "http://basex.org/modules/util", - "key": "http://basex.org/modules/util#chars#1", - "params": [ - "$string as xs:string" - ], - "type": "xs:string*", - "description": " Returns all characters of a $string as a sequence. Equivalent to:
  for $ cp in string-to-codepoints ( $ string ) return codepoints-to-string ( $ cp ) 
" - } - }, - "description": " This XQuery Module contains various utility and helper functions.", - "type": "module", - "override": true - }, - "http://basex.org/modules/validate": { - "ns": "http://basex.org/modules/validate", - "prefixes": [ - "validate" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/validate#dtd#1": { - "name": "dtd", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#dtd#1", - "params": [ - "$input as item()" - ], - "type": "empty-sequence()", - "description": " Validates the XML $input document against a $schema and returns an empty sequence or an error." - }, - "http://basex.org/modules/validate#dtd#2": { - "name": "dtd", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#dtd#2", - "params": [ - "$input as item()", - "$schema as xs:string?" - ], - "type": "empty-sequence()", - "description": " Validates the XML $input document against a $schema and returns an empty sequence or an error." - }, - "http://basex.org/modules/validate#dtd-info#1": { - "name": "dtd-info", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#dtd-info#1", - "params": [ - "$input as item()" - ], - "type": "xs:string*", - "description": " Validates the XML $input document against a $schema and returns warnings, errors and fatal errors in a string sequence." - }, - "http://basex.org/modules/validate#dtd-info#2": { - "name": "dtd-info", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#dtd-info#2", - "params": [ - "$input as item()", - "$schema as xs:string?" - ], - "type": "xs:string*", - "description": " Validates the XML $input document against a $schema and returns warnings, errors and fatal errors in a string sequence." - }, - "http://basex.org/modules/validate#dtd-report#1": { - "name": "dtd-report", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#dtd-report#1", - "params": [ - "$input as item()" - ], - "type": "element(report)", - "description": " Validates the XML $input document against a $schema and returns warnings, errors and fatal errors as XML." - }, - "http://basex.org/modules/validate#dtd-report#2": { - "name": "dtd-report", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#dtd-report#2", - "params": [ - "$input as item()", - "$schema as xs:string?" - ], - "type": "element(report)", - "description": " Validates the XML $input document against a $schema and returns warnings, errors and fatal errors as XML." - }, - "http://basex.org/modules/validate#xsd#1": { - "name": "xsd", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd#1", - "params": [ - "$input as item()" - ], - "type": "empty-sequence()", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features." - }, - "http://basex.org/modules/validate#xsd#2": { - "name": "xsd", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd#2", - "params": [ - "$input as item()", - "$schema as item()?" - ], - "type": "empty-sequence()", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features." - }, - "http://basex.org/modules/validate#xsd#3": { - "name": "xsd", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd#3", - "params": [ - "$input as item()", - "$schema as item()?", - "$features as map(*)" - ], - "type": "empty-sequence()", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features." - }, - "http://basex.org/modules/validate#xsd-info#1": { - "name": "xsd-info", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-info#1", - "params": [ - "$input as item()" - ], - "type": "xs:string*", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors in a string sequence." - }, - "http://basex.org/modules/validate#xsd-info#2": { - "name": "xsd-info", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-info#2", - "params": [ - "$input as item()", - "$schema as item()?" - ], - "type": "xs:string*", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors in a string sequence." - }, - "http://basex.org/modules/validate#xsd-info#3": { - "name": "xsd-info", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-info#3", - "params": [ - "$input as item()", - "$schema as item()?", - "$features as map(*)" - ], - "type": "xs:string*", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors in a string sequence." - }, - "http://basex.org/modules/validate#xsd-report#1": { - "name": "xsd-report", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-report#1", - "params": [ - "$input as item()" - ], - "type": "element(report)", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors as XML." - }, - "http://basex.org/modules/validate#xsd-report#2": { - "name": "xsd-report", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-report#2", - "params": [ - "$input as item()", - "$schema as xs:string?" - ], - "type": "element(report)", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors as XML." - }, - "http://basex.org/modules/validate#xsd-report#3": { - "name": "xsd-report", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-report#3", - "params": [ - "$input as item()", - "$schema as xs:string?", - "$features as map(*)" - ], - "type": "element(report)", - "description": " Validates the XML $input document against a $schema, using the processor-specific $features, and returns warnings, errors and fatal errors as XML." - }, - "http://basex.org/modules/validate#xsd-processor#0": { - "name": "xsd-processor", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-processor#0", - "params": [], - "type": "xs:string", - "description": " Returns the name of the applied XSD processor." - }, - "http://basex.org/modules/validate#xsd-version#0": { - "name": "xsd-version", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#xsd-version#0", - "params": [], - "type": "xs:string", - "description": " Returns the supported version of XSD Schema." - }, - "http://basex.org/modules/validate#rng#2": { - "name": "rng", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#rng#2", - "params": [ - "$input as item()", - "$schema as item()" - ], - "type": "empty-sequence()", - "description": " Validates the XML $input document against a $schema, using the XML or $compact notation." - }, - "http://basex.org/modules/validate#rng#3": { - "name": "rng", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#rng#3", - "params": [ - "$input as item()", - "$schema as item()", - "$compact as xs:boolean" - ], - "type": "empty-sequence()", - "description": " Validates the XML $input document against a $schema, using the XML or $compact notation." - }, - "http://basex.org/modules/validate#rng-info#2": { - "name": "rng-info", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#rng-info#2", - "params": [ - "$input as item()", - "$schema as item()" - ], - "type": "xs:string*", - "description": " Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors in a string sequence." - }, - "http://basex.org/modules/validate#rng-info#3": { - "name": "rng-info", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#rng-info#3", - "params": [ - "$input as item()", - "$schema as item()", - "$compact as xs:boolean" - ], - "type": "xs:string*", - "description": " Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors in a string sequence." - }, - "http://basex.org/modules/validate#rng-report#2": { - "name": "rng-report", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#rng-report#2", - "params": [ - "$input as item()", - "$schema as xs:string" - ], - "type": "element(report)", - "description": " Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors as XML." - }, - "http://basex.org/modules/validate#rng-report#3": { - "name": "rng-report", - "uri": "http://basex.org/modules/validate", - "key": "http://basex.org/modules/validate#rng-report#3", - "params": [ - "$input as item()", - "$schema as xs:string", - "$compact as xs:boolean" - ], - "type": "element(report)", - "description": " Validates the XML $input document against a $schema, using the XML or $compact notation, and returns warnings, errors and fatal errors as XML." - } - }, - "description": " This XQuery Module contains functions to perform validations against DTDs, XML Schema and RelaxNG. The documentation further describes how to use Schematron validation with BaseX.", - "type": "module", - "override": true - }, - "http://basex.org/modules/web": { - "ns": "http://basex.org/modules/web", - "prefixes": [ - "web" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/web#content-type#1": { - "name": "content-type", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#content-type#1", - "params": [ - "$path as xs:string" - ], - "type": "xs:string", - "description": " Returns the content type of a path by analyzing its file suffix. application/octet-stream is returned if the file suffix is unknown." - }, - "http://basex.org/modules/web#create-url#2": { - "name": "create-url", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#create-url#2", - "params": [ - "$url as xs:string", - "$parameters as map(*)" - ], - "type": "xs:string", - "description": " Creates a new URL from the specified $url string, query string $parameters and an optional $anchor reference. The keys and values of the map entries will be converted to strings, URL-encoded (see web:encode-url), and appended to the URL as query parameters. If a map entry has more than a single item, all of them will be appended as single parameters." - }, - "http://basex.org/modules/web#create-url#3": { - "name": "create-url", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#create-url#3", - "params": [ - "$url as xs:string", - "$parameters as map(*)", - "$anchor as xs:string" - ], - "type": "xs:string", - "description": " Creates a new URL from the specified $url string, query string $parameters and an optional $anchor reference. The keys and values of the map entries will be converted to strings, URL-encoded (see web:encode-url), and appended to the URL as query parameters. If a map entry has more than a single item, all of them will be appended as single parameters." - }, - "http://basex.org/modules/web#encode-url#1": { - "name": "encode-url", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#encode-url#1", - "params": [ - "$string as xs:string" - ], - "type": "xs:string", - "description": " Encodes a string to a URL. Spaces are rewritten to +; *, -, . and _ are adopted; and all other non-ASCII characters and special characters are percent-encoded." - }, - "http://basex.org/modules/web#decode-url#1": { - "name": "decode-url", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#decode-url#1", - "params": [ - "$string as xs:string" - ], - "type": "xs:string", - "description": " Decodes a URL to the original string. Percent-encoded characters are decoded to their UTF8 codepoints, and + characters are rewritten to spaces." - }, - "http://basex.org/modules/web#forward#1": { - "name": "forward", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#forward#1", - "params": [ - "$path as xs:string" - ], - "type": "element(rest:forward)", - "description": " Creates a server-side RESTXQ forward request to the specified $path:
  • The client will not get notified of this forwarding.
  • Supplied query parameters will be attached to parameters of the current request.
  • The $parameter argument is processed as described in web:create-url.
" - }, - "http://basex.org/modules/web#forward#2": { - "name": "forward", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#forward#2", - "params": [ - "$path as xs:string", - "$parameters as map(*)" - ], - "type": "element(rest:forward)", - "description": " Creates a server-side RESTXQ forward request to the specified $path:
  • The client will not get notified of this forwarding.
  • Supplied query parameters will be attached to parameters of the current request.
  • The $parameter argument is processed as described in web:create-url.
" - }, - "http://basex.org/modules/web#redirect#1": { - "name": "redirect", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#redirect#1", - "params": [ - "$url as xs:string" - ], - "type": "element(rest:response)", - "description": " Creates a RESTXQ redirection to the specified $url. The returned response will only work if no other items are returned by the RESTXQ function.
The $parameters and $anchor arguments are processed as described in (see web:create-url)." - }, - "http://basex.org/modules/web#redirect#2": { - "name": "redirect", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#redirect#2", - "params": [ - "$url as xs:string", - "$parameters as map(*)" - ], - "type": "element(rest:response)", - "description": " Creates a RESTXQ redirection to the specified $url. The returned response will only work if no other items are returned by the RESTXQ function.
The $parameters and $anchor arguments are processed as described in (see web:create-url)." - }, - "http://basex.org/modules/web#redirect#3": { - "name": "redirect", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#redirect#3", - "params": [ - "$url as xs:string", - "$parameters as map(*)", - "$anchor as xs:string" - ], - "type": "element(rest:response)", - "description": " Creates a RESTXQ redirection to the specified $url. The returned response will only work if no other items are returned by the RESTXQ function.
The $parameters and $anchor arguments are processed as described in (see web:create-url)." - }, - "http://basex.org/modules/web#response-header#0": { - "name": "response-header", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#response-header#0", - "params": [], - "type": "element(rest:response)", - "description": " Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
" - }, - "http://basex.org/modules/web#response-header#1": { - "name": "response-header", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#response-header#1", - "params": [ - "$output as map(*)?" - ], - "type": "element(rest:response)", - "description": " Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
" - }, - "http://basex.org/modules/web#response-header#2": { - "name": "response-header", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#response-header#2", - "params": [ - "$output as map(*)?", - "$headers as map(*)?" - ], - "type": "element(rest:response)", - "description": " Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
" - }, - "http://basex.org/modules/web#response-header#3": { - "name": "response-header", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#response-header#3", - "params": [ - "$output as map(*)?", - "$headers as map(*)?", - "$atts as map(*)?" - ], - "type": "element(rest:response)", - "description": " Creates a RESTXQ response header.

Serialization parameters and header values can be supplied via the $output and $headers arguments, and status and message attributes can be attached to the HTTP response element with the $atts argument.

  • media-type: application/octet-stream

Header options can be supplied via the $headers argument. Empty string values can be specified to invalidate default values. By default, the following header options will be returned:

  • Cache-Control: max-age=3600,public
" - }, - "http://basex.org/modules/web#error#2": { - "name": "error", - "uri": "http://basex.org/modules/web", - "key": "http://basex.org/modules/web#error#2", - "params": [ - "$status as xs:integer", - "$message as xs:string" - ], - "type": "none", - "description": " Raises an error with the QName rest:error, the specified $message and the specified $status as error value.
Calls to this function are equivalent to fn:error(xs:QName('rest:error'), $message, $status).

See RESTXQ: Raise Errors to learn how the function is helpful in web applications.

" - } - }, - "description": " This XQuery Module provides convenience functions for building web applications with RESTXQ.", - "type": "module", - "override": true - }, - "http://basex.org/modules/ws": { - "ns": "http://basex.org/modules/ws", - "prefixes": [ - "ws" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/ws#id#0": { - "name": "id", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#id#0", - "params": [], - "type": "xs:string", - "description": " Returns the ID of the current WebSocket." - }, - "http://basex.org/modules/ws#ids#0": { - "name": "ids", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#ids#0", - "params": [], - "type": "xs:string*", - "description": " Returns the ids of all currently registered WebSockets." - }, - "http://basex.org/modules/ws#path#1": { - "name": "path", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#path#1", - "params": [ - "$id as xs:string" - ], - "type": "xs:string", - "description": " Returns the path of the WebSocket with the specified $id." - }, - "http://basex.org/modules/ws#close#1": { - "name": "close", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#close#1", - "params": [ - "$id as xs:string" - ], - "type": "empty-sequence()", - "description": " Closes the connection of the WebSocket with the specified $id." - }, - "http://basex.org/modules/ws#send#2": { - "name": "send", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#send#2", - "params": [ - "$message as item()", - "$ids as xs:string*" - ], - "type": "empty-sequence()", - "description": " Sends a $message to the clients with the specified $ids. Ids that cannot be assigned to clients will be ignored. The message will be handled as follows:
  • Items of type xs:base64Binary and xs:hexBinary will be transmitted as binary messages.
  • Function items (maps, arrays) will be serialized as JSON and transmitted as string messages.
  • All other items will be serialized with the default serialization options and transmitted as string messages.
" - }, - "http://basex.org/modules/ws#broadcast#1": { - "name": "broadcast", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#broadcast#1", - "params": [ - "$message as xs:anyAtomicType" - ], - "type": "empty-sequence()", - "description": " Broadcasts a $message to all connected clients except to the caller. Invocations of this convenience function are equivalent to ws:send($message, ws:ids()[. != ws:id()]). See ws:send for more details on the message handling." - }, - "http://basex.org/modules/ws#emit#1": { - "name": "emit", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#emit#1", - "params": [ - "$message as xs:anyAtomicType" - ], - "type": "empty-sequence()", - "description": " Emits a $message to all connected clients. Invocations of this function are equivalent to ws:send($message, ws:ids()). See ws:send for more details on the message handling." - }, - "http://basex.org/modules/ws#eval#1": { - "name": "eval", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#eval#1", - "params": [ - "$query as xs:anyAtomicItem" - ], - "type": "xs:string", - "description": " Schedules the evaluation of the supplied $query and returns the result to the calling WebSocket client. The query can be a URI or a string, and variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.

Query scheduling is recommendable if the immediate query execution might be too time consuming and lead to a timeout.

" - }, - "http://basex.org/modules/ws#eval#2": { - "name": "eval", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#eval#2", - "params": [ - "$query as xs:anyAtomicItem", - "$bindings as map(*)?" - ], - "type": "xs:string", - "description": " Schedules the evaluation of the supplied $query and returns the result to the calling WebSocket client. The query can be a URI or a string, and variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.

Query scheduling is recommendable if the immediate query execution might be too time consuming and lead to a timeout.

" - }, - "http://basex.org/modules/ws#eval#3": { - "name": "eval", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#eval#3", - "params": [ - "$query as xs:anyAtomicItem", - "$bindings as map(*)?", - "$options as map(*)?" - ], - "type": "xs:string", - "description": " Schedules the evaluation of the supplied $query and returns the result to the calling WebSocket client. The query can be a URI or a string, and variables and context items can be declared via $bindings (see xquery:eval for more details). The following $options can be supplied:
  • base-uri: sets the base-uri property for the query. This URI will be used when resolving relative URIs, such as with fn:doc.
  • id: sets a custom job id. The id must not start with the standard job prefix, and it can only be assigned if no job with the same name exists.

Query scheduling is recommendable if the immediate query execution might be too time consuming and lead to a timeout.

" - }, - "http://basex.org/modules/ws#get#2": { - "name": "get", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#get#2", - "params": [ - "$id as xs:string", - "$name as xs:string" - ], - "type": "item()*", - "description": " Returns the value of an attribute with the specified $name from the WebSocket with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead." - }, - "http://basex.org/modules/ws#get#3": { - "name": "get", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#get#3", - "params": [ - "$id as xs:string", - "$name as xs:string", - "$default as item()*" - ], - "type": "item()*", - "description": " Returns the value of an attribute with the specified $name from the WebSocket with the specified $id. If the attribute is unknown, an empty sequence or the optionally specified $default value will be returned instead." - }, - "http://basex.org/modules/ws#set#3": { - "name": "set", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#set#3", - "params": [ - "$id as xs:string", - "$name as xs:string", - "$value as item()*" - ], - "type": "empty-sequence()", - "description": " Returns the specified value of the attribute with the specified $name from the WebSocket with the specified $id." - }, - "http://basex.org/modules/ws#delete#2": { - "name": "delete", - "uri": "http://basex.org/modules/ws", - "key": "http://basex.org/modules/ws#delete#2", - "params": [ - "$id as xs:string", - "$name as xs:string" - ], - "type": "empty-sequence()", - "description": " Deletes an attribute with the specified $name from the WebSocket with the specified $id." - } - }, - "description": " This XQuery Module contains functions for accessing specific WebSocket functions. This module is mainly useful in the context of WebSockets.", - "type": "module", - "override": true - }, - "http://basex.org/modules/xquery": { - "ns": "http://basex.org/modules/xquery", - "prefixes": [ - "xquery" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/xquery#eval#1": { - "name": "eval", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#eval#1", - "params": [ - "$query as xs:anyAtomicType" - ], - "type": "item()*", - "description": " Evaluates the supplied $query and returns the resulting items. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string.

Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:

  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. Overwrites the base URI of the query; will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
" - }, - "http://basex.org/modules/xquery#eval#2": { - "name": "eval", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#eval#2", - "params": [ - "$query as xs:anyAtomicType", - "$bindings as map(*)?" - ], - "type": "item()*", - "description": " Evaluates the supplied $query and returns the resulting items. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string.

Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:

  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. Overwrites the base URI of the query; will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
" - }, - "http://basex.org/modules/xquery#eval#3": { - "name": "eval", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#eval#3", - "params": [ - "$query as xs:anyAtomicType", - "$bindings as map(*)?", - "$options as map(*)?" - ], - "type": "item()*", - "description": " Evaluates the supplied $query and returns the resulting items. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string.

Variables and context items can be declared via $bindings. The specified keys must be QNames or strings:

  • If a key is a QName, it will be directly adopted as variable name.
  • It a key is a string, it may be prefixed with a dollar sign. Namespace can be specified using the Clark Notation.
  • If the specified string is empty, the value will be bound to the context item.

The $options parameter contains evaluation options:

  • permission: the query will be evaluated with the specified permissions (see User Management).
  • timeout: query execution will be interrupted after the specified number of seconds.
  • memory: query execution will be interrupted if the specified number of megabytes will be exceeded. This check works best if only one process is running at the same time. Moreover, please note that this option enforces garbage collection, so it will take some additional time, and it requires GC to be enabled in your JVM.
  • base-uri: set base-uri property for the query. Overwrites the base URI of the query; will be used when resolving relative URIs by functions such as fn:doc.
  • pass: passes on the original error info (line and column number, optional file uri). By default, this option is false.
" - }, - "http://basex.org/modules/xquery#eval-update#1": { - "name": "eval-update", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#eval-update#1", - "params": [ - "$query as xs:anyAtomicType" - ], - "type": "item()*", - "description": " Evaluates a query as updating expression. All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules for all arguments are the same as for xquery:eval." - }, - "http://basex.org/modules/xquery#eval-update#2": { - "name": "eval-update", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#eval-update#2", - "params": [ - "$query as xs:anyAtomicType", - "$bindings as map(*)?" - ], - "type": "item()*", - "description": " Evaluates a query as updating expression. All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules for all arguments are the same as for xquery:eval." - }, - "http://basex.org/modules/xquery#eval-update#3": { - "name": "eval-update", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#eval-update#3", - "params": [ - "$query as xs:anyAtomicType", - "$bindings as map(*)?", - "$options as map(*)?" - ], - "type": "item()*", - "description": " Evaluates a query as updating expression. All updates will be added to the Pending Update List of the main query and performed after the evaluation of the main query.
The rules for all arguments are the same as for xquery:eval." - }, - "http://basex.org/modules/xquery#parse#1": { - "name": "parse", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#parse#1", - "params": [ - "$query as xs:anyAtomicType" - ], - "type": "item()?", - "description": " Parses the specified $query as XQuery module and returns the resulting query plan. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string. The $options parameter influences the output:
  • compile: additionally compiles the query after parsing it. By default, this option is false.
  • plan: returns an XML representation of the internal query plan. By default, this option is true. The naming of the expressions in the query plan may change over time
  • pass: by default, the option is false. If an error is raised, the line/column number and the optional file uri will refer to the location of the function call. If the option is enabled, the line/column and file uri will be adopted from the raised error.
  • base-uri: set base-uri property for the query. This URI will be used when resolving relative URIs by functions such as fn:doc.
" - }, - "http://basex.org/modules/xquery#parse#2": { - "name": "parse", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#parse#2", - "params": [ - "$query as xs:anyAtomicType", - "$options as map(*)?" - ], - "type": "item()?", - "description": " Parses the specified $query as XQuery module and returns the resulting query plan. If the query is of type xs:anyURI, the module located at this URI will be retrieved (a relative URI will be resolved against the static base URI). Otherwise, the input is expected to be of type xs:string. The $options parameter influences the output:
  • compile: additionally compiles the query after parsing it. By default, this option is false.
  • plan: returns an XML representation of the internal query plan. By default, this option is true. The naming of the expressions in the query plan may change over time
  • pass: by default, the option is false. If an error is raised, the line/column number and the optional file uri will refer to the location of the function call. If the option is enabled, the line/column and file uri will be adopted from the raised error.
  • base-uri: set base-uri property for the query. This URI will be used when resolving relative URIs by functions such as fn:doc.
" - }, - "http://basex.org/modules/xquery#fork-join#1": { - "name": "fork-join", - "uri": "http://basex.org/modules/xquery", - "key": "http://basex.org/modules/xquery#fork-join#1", - "params": [ - "$functions as function(*)*" - ], - "type": "item()*", - "description": " This function executes the supplied (non-updating) functions in parallel." - } - }, - "description": " This XQuery Module contains functions for parsing and evaluating XQuery strings at runtime, and to run code in parallel.", - "type": "module", - "override": true - }, - "http://basex.org/modules/xslt": { - "ns": "http://basex.org/modules/xslt", - "prefixes": [ - "xslt" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://basex.org/modules/xslt#processor#0": { - "name": "processor", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#processor#0", - "params": [], - "type": "xs:string", - "description": " Returns the name of the applied XSLT processor, or the path to a custom implementation (currently: \"Java\", \"Saxon EE\", \"Saxon PE\", or \"Saxon HE\").
" - }, - "http://basex.org/modules/xslt#version#0": { - "name": "version", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#version#0", - "params": [], - "type": "xs:string", - "description": " Returns the supported XSLT version (currently: \"1.0\" or \"3.0\"). \"Unknown\" is returned if a custom implementation was chosen.
" - }, - "http://basex.org/modules/xslt#transform#2": { - "name": "transform", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform#2", - "params": [ - "$input as item()", - "$stylesheet as item()" - ], - "type": "node()", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

XML Catalog files will be considered when resolving URIs. Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available:

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
" - }, - "http://basex.org/modules/xslt#transform#3": { - "name": "transform", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform#3", - "params": [ - "$input as item()", - "$stylesheet as item()", - "$params as map(*)?" - ], - "type": "node()", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

XML Catalog files will be considered when resolving URIs. Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available:

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
" - }, - "http://basex.org/modules/xslt#transform#4": { - "name": "transform", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform#4", - "params": [ - "$input as item()", - "$stylesheet as item()", - "$args as map(*)?", - "$options as map(*)?" - ], - "type": "node()", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as node. $input and $stylesheet can be specified as
  • xs:string, containing the stylesheet URI,
  • xs:string, containing the document in its string representation, or
  • node(), containing the document itself.

XML Catalog files will be considered when resolving URIs. Variables can be bound to a stylesheet via $args (only strings are supported when using XSLT 3.0 and Saxon). The following $options are available:

  • cache: cache XSLT transformer (speeds up repeated transformations, but increases memory consumption)
" - }, - "http://basex.org/modules/xslt#transform-text#2": { - "name": "transform-text", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform-text#2", - "params": [ - "$input as item()", - "$stylesheet as item()" - ], - "type": "xs:string", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform.
" - }, - "http://basex.org/modules/xslt#transform-text#3": { - "name": "transform-text", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform-text#3", - "params": [ - "$input as item()", - "$stylesheet as item()", - "$params as map(*)?" - ], - "type": "xs:string", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform.
" - }, - "http://basex.org/modules/xslt#transform-text#4": { - "name": "transform-text", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform-text#4", - "params": [ - "$input as item()", - "$stylesheet as item()", - "$params as map(*)?", - "$options as map(*)?" - ], - "type": "xs:string", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns the result as string. The semantics of $params and $options is the same as for xslt:transform.
" - }, - "http://basex.org/modules/xslt#transform-report#2": { - "name": "transform-report", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform-report#2", - "params": [ - "$input as item()", - "$stylesheet as item()" - ], - "type": "xs:string", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns a map with the following keys:
  • result: The transformation result: One or more document nodes, or (if the result cannot be converted to XML) an item of type xs:untypedAtomic.
  • messages: Informational output generated by xsl:message elements: A sequence of arrays. The arrays consist of XML elements, or (for those messages that cannot be converted to XML) items of type xs:untypedAtomic.

The semantics of $params and $options is the same as for xslt:transform.
For the moment, messages can only be returned with recent versions of Saxon.

  • error (optional): An error string, which would be raised as an error by the other functions of this module.
" - }, - "http://basex.org/modules/xslt#transform-report#3": { - "name": "transform-report", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform-report#3", - "params": [ - "$input as item()", - "$stylesheet as item()", - "$params as map(*)?" - ], - "type": "xs:string", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns a map with the following keys:
  • result: The transformation result: One or more document nodes, or (if the result cannot be converted to XML) an item of type xs:untypedAtomic.
  • messages: Informational output generated by xsl:message elements: A sequence of arrays. The arrays consist of XML elements, or (for those messages that cannot be converted to XML) items of type xs:untypedAtomic.

The semantics of $params and $options is the same as for xslt:transform.
For the moment, messages can only be returned with recent versions of Saxon.

  • error (optional): An error string, which would be raised as an error by the other functions of this module.
" - }, - "http://basex.org/modules/xslt#transform-report#4": { - "name": "transform-report", - "uri": "http://basex.org/modules/xslt", - "key": "http://basex.org/modules/xslt#transform-report#4", - "params": [ - "$input as item()", - "$stylesheet as item()", - "$params as map(*)?", - "$options as map(*)?" - ], - "type": "xs:string", - "description": " Transforms the document specified by $input, using the XSLT template specified by $stylesheet, and returns a map with the following keys:
  • result: The transformation result: One or more document nodes, or (if the result cannot be converted to XML) an item of type xs:untypedAtomic.
  • messages: Informational output generated by xsl:message elements: A sequence of arrays. The arrays consist of XML elements, or (for those messages that cannot be converted to XML) items of type xs:untypedAtomic.

The semantics of $params and $options is the same as for xslt:transform.
For the moment, messages can only be returned with recent versions of Saxon.

  • error (optional): An error string, which would be raised as an error by the other functions of this module.
" - } - }, - "description": " This XQuery Module contains functions and variables to perform XSL transformations.", - "type": "module", - "override": true - }, - "http://expath.org/ns/zip": { - "ns": "http://expath.org/ns/zip", - "prefixes": [ - "zip" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://expath.org/ns/zip#binary-entry#2": { - "name": "binary-entry", - "uri": "http://expath.org/ns/zip", - "key": "http://expath.org/ns/zip#binary-entry#2", - "params": [ - "$uri as xs:string", - "$path as xs:string" - ], - "type": "xs:base64Binary", - "description": " Extracts the binary file at $path within the ZIP file located at $uri and returns it as an xs:base64Binary item." - }, - "http://expath.org/ns/zip#text-entry#2": { - "name": "text-entry", - "uri": "http://expath.org/ns/zip", - "key": "http://expath.org/ns/zip#text-entry#2", - "params": [ - "$uri as xs:string", - "$path as xs:string" - ], - "type": "xs:string", - "description": " Extracts the text file at $path within the ZIP file located at $uri and returns it as an xs:string item.
An optional encoding can be specified via $encoding." - }, - "http://expath.org/ns/zip#text-entry#3": { - "name": "text-entry", - "uri": "http://expath.org/ns/zip", - "key": "http://expath.org/ns/zip#text-entry#3", - "params": [ - "$uri as xs:string", - "$path as xs:string", - "$encoding as xs:string" - ], - "type": "xs:string", - "description": " Extracts the text file at $path within the ZIP file located at $uri and returns it as an xs:string item.
An optional encoding can be specified via $encoding." - }, - "http://expath.org/ns/zip#xml-entry#2": { - "name": "xml-entry", - "uri": "http://expath.org/ns/zip", - "key": "http://expath.org/ns/zip#xml-entry#2", - "params": [ - "$uri as xs:string", - "$path as xs:string" - ], - "type": "document-node()", - "description": " Extracts the XML file at $path within the ZIP file located at $uri and returns it as a document node." - }, - "http://expath.org/ns/zip#html-entry#2": { - "name": "html-entry", - "uri": "http://expath.org/ns/zip", - "key": "http://expath.org/ns/zip#html-entry#2", - "params": [ - "$uri as xs:string", - "$path as xs:string" - ], - "type": "document-node()", - "description": " Extracts the HTML file at $path within the ZIP file located at $uri and returns it as a document node. The file is converted to XML first if Tagsoup is found in the classpath." - }, - "http://expath.org/ns/zip#entries#1": { - "name": "entries", - "uri": "http://expath.org/ns/zip", - "key": "http://expath.org/ns/zip#entries#1", - "params": [ - "$uri as xs:string" - ], - "type": "element(zip:file)", - "description": " Generates an ZIP XML Representation of the hierarchical structure of the ZIP file located at $uri and returns it as an element node. The file contents are not returned by this function." - }, - "http://expath.org/ns/zip#zip-file#1": { - "name": "zip-file", - "uri": "http://expath.org/ns/zip", - "key": "http://expath.org/ns/zip#zip-file#1", - "params": [ - "$zip as element(zip:file)" - ], - "type": "empty-sequence()", - "description": " Creates a new ZIP archive with the characteristics described by $zip, the ZIP XML Representation." - }, - "http://expath.org/ns/zip#update-entries#2": { - "name": "update-entries", - "uri": "http://expath.org/ns/zip", - "key": "http://expath.org/ns/zip#update-entries#2", - "params": [ - "$zip as element(zip:file)", - "$output as xs:string" - ], - "type": "empty-sequence()", - "description": " Updates an existing ZIP archive or creates a modifed copy, based on the characteristics described by $zip, the ZIP XML Representation. The $output argument is the URI where the modified ZIP file is copied to." - } - }, - "description": " This XQuery Module contains functions to handle ZIP archives. The contents of ZIP files can be extracted and listed, and new archives can be created. The module is based on the EXPath ZIP Module. Please note that the ZIP module is not being actively maintained but is still distributed for compatibility with older applications. We recommend you use the Archive Module wherever possible.", - "type": "module", - "override": true - } -} \ No newline at end of file diff --git a/packages/basex-static-namespaces.json b/packages/basex-static-namespaces.json deleted file mode 100644 index 59900a1..0000000 --- a/packages/basex-static-namespaces.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "http://basex.org": { - "description": "BaseX Annotations, Pragmas, …", - "prefixes": [ - "basex" - ], - "type": "declare" - }, - "http://basex.org/modules/input": { - "description": "RESTXQ: Input Options ", - "prefixes": [ - "input" - ], - "type": "declare" - }, - "http://basex.org/modules/input": { - "description": "RESTXQ: Input Options ", - "prefixes": [ - "input" - ], - "type": "declare" - }, - "http://expath.org/ns/pkg": { - "description": "EXPath Packages ", - "prefixes": [ - "pkg" - ], - "type": "declare" - }, - "http://www.w3.org/2005/xqt-errors": { - "description": "XQuery Errors ", - "prefixes": [ - "err" - ], - "type": "declare" - }, - "http://www.w3.org/2010/xslt-xquery-serialization": { - "description": "Serialization ", - "prefixes": [ - "output" - ], - "type": "declare" - } -} \ No newline at end of file diff --git a/packages/xpath-3.1.json b/packages/xpath-3.1.json deleted file mode 100644 index 00f2c42..0000000 --- a/packages/xpath-3.1.json +++ /dev/null @@ -1,2149 +0,0 @@ -{ - "http://www.w3.org/2005/xpath-functions/math": { - "ns": "http://www.w3.org/2005/xpath-functions/math", - "prefixes": [ - "math" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://www.w3.org/2005/xpath-functions/math#pi#0": { - "name": "pi", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#pi#0", - "params": [], - "type": "xs:double", - "description": " Returns the xs:double value of the mathematical constant π whose lexical representation is 3.141592653589793." - }, - "http://www.w3.org/2005/xpath-functions/math#sqrt#1": { - "name": "sqrt", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#sqrt#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the square root of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the xs:double value of the mathematical square root of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#sin#1": { - "name": "sin", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#sin#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the sine of the $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the sine of $arg, treated as an angle in radians." - }, - "http://www.w3.org/2005/xpath-functions/math#cos#1": { - "name": "cos", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#cos#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the cosine of $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the cosine of $arg, treated as an angle in radians." - }, - "http://www.w3.org/2005/xpath-functions/math#tan#1": { - "name": "tan", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#tan#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the tangent of $arg, expressed in radians.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the tangent of $arg, treated as an angle in radians." - }, - "http://www.w3.org/2005/xpath-functions/math#asin#1": { - "name": "asin", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#asin#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the arc sine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc sine of $arg, returned as an angle in radians in the range -Ï€/2 to +Ï€/2." - }, - "http://www.w3.org/2005/xpath-functions/math#acos#1": { - "name": "acos", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#acos#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the arc cosine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc cosine of $arg, returned as an angle in radians in the range 0 to +Ï€." - }, - "http://www.w3.org/2005/xpath-functions/math#atan#1": { - "name": "atan", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#atan#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the arc tangent of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc tangent of $arg, returned as an angle in radians in the range -Ï€/2 to +Ï€/2." - }, - "http://www.w3.org/2005/xpath-functions/math#atan2#2": { - "name": "atan2", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#atan2#2", - "params": [ - "$arg1 as xs:double?", - "$arg2 as xs:double" - ], - "type": "xs:double?", - "description": " Returns the arc tangent of $arg1 divided by $arg2, the result being in the range -Ï€/2 to +Ï€/2 radians.
If $arg1 is the empty sequence, the empty sequence is returned.
Otherwise the result is the arc tangent of $arg1 divided by $arg2, returned as an angle in radians in the range -Ï€ to +Ï€." - }, - "http://www.w3.org/2005/xpath-functions/math#pow#2": { - "name": "pow", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#pow#2", - "params": [ - "$arg1 as xs:double?", - "$arg2 as xs:double" - ], - "type": "xs:double?", - "description": " Returns $arg1 raised to the power of $arg2.
If $arg1 is the empty sequence, the empty sequence is returned.
Otherwise the result is the $arg1 raised to the power of $arg2." - }, - "http://www.w3.org/2005/xpath-functions/math#exp#1": { - "name": "exp", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#exp#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns e raised to the power of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the value of e raised to the power of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#log#1": { - "name": "log", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#log#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the natural logarithm of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the natural logarithm (base e) of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#log10#1": { - "name": "log10", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#log10#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the base 10 logarithm of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the base 10 logarithm of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#e#0": { - "name": "e", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#e#0", - "params": [], - "type": "xs:double", - "description": " Returns the xs:double value of the mathematical constant e whose lexical representation is 2.718281828459045." - }, - "http://www.w3.org/2005/xpath-functions/math#sinh#1": { - "name": "sinh", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#sinh#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the hyperbolic sine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic sine of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#cosh#1": { - "name": "cosh", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#cosh#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the hyperbolic cosine of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic cosine of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#tanh#1": { - "name": "tanh", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#tanh#1", - "params": [ - "$arg as xs:double?" - ], - "type": "xs:double?", - "description": " Returns the hyperbolic tangent of $arg.
If $arg is the empty sequence, the empty sequence is returned.
Otherwise the result is the hyperbolic tangent of $arg." - }, - "http://www.w3.org/2005/xpath-functions/math#crc32#1": { - "name": "crc32", - "uri": "http://www.w3.org/2005/xpath-functions/math", - "key": "http://www.w3.org/2005/xpath-functions/math#crc32#1", - "params": [ - "$string as xs:string?" - ], - "type": "xs:hexBinary?", - "description": " Calculates the CRC32 check sum of the given $string.
If an empty sequence is supplied, the empty sequence is returned." - } - }, - "description": " The math XQuery Module defines functions to perform mathematical operations, such as pi, asin and acos. Most functions are specified in the Functions and Operators Specification of the upcoming XQuery 3.0 Recommendation, and some additional ones have been added in this module.", - "type": "module", - "override": true - }, - "http://www.w3.org/2005/xpath-functions": { - "ns": "http://www.w3.org/2005/xpath-functions", - "prefixes": [ - "fn" - ], - "namespaces": [], - "variables": {}, - "functions": { - "http://www.w3.org/2005/xpath-functions#error#0": { - "name": "error", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#error#0", - "params": [], - "description": " Calling the fn:error function raises an application-defined error." - }, - "http://www.w3.org/2005/xpath-functions#error#1": { - "name": "error", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#error#1", - "params": [ - "$code as xs:QName?" - ], - "description": " Calling the fn:error function raises an application-defined error." - }, - "http://www.w3.org/2005/xpath-functions#error#2": { - "name": "error", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#error#2", - "params": [ - "$code as xs:QName?", - "$description as xs:string" - ], - "description": " Calling the fn:error function raises an application-defined error." - }, - "http://www.w3.org/2005/xpath-functions#error#3": { - "name": "error", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#error#3", - "params": [ - "$code as xs:QName?", - "$description as xs:string", - "$error-object as item()*" - ], - "description": " Calling the fn:error function raises an application-defined error." - }, - "http://www.w3.org/2005/xpath-functions#trace#1": { - "name": "trace", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#trace#1", - "params": [ - "$value as item()*" - ], - "type": "item()*", - "description": " Provides an execution trace intended to be used in debugging queries." - }, - "http://www.w3.org/2005/xpath-functions#trace#2": { - "name": "trace", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#trace#2", - "params": [ - "$value as item()*", - "$label as xs:string" - ], - "type": "item()*", - "description": " Provides an execution trace intended to be used in debugging queries." - }, - "http://www.w3.org/2005/xpath-functions#abs#1": { - "name": "abs", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#abs#1", - "params": [ - "$arg as xs:numeric?" - ], - "type": "xs:numeric?", - "description": " Returns the absolute value of $arg." - }, - "http://www.w3.org/2005/xpath-functions#ceiling#1": { - "name": "ceiling", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#ceiling#1", - "params": [ - "$arg as xs:numeric?" - ], - "type": "xs:numeric?", - "description": " Rounds $arg upwards to a whole number." - }, - "http://www.w3.org/2005/xpath-functions#floor#1": { - "name": "floor", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#floor#1", - "params": [ - "$arg as xs:numeric?" - ], - "type": "xs:numeric?", - "description": " Rounds $arg downwards to a whole number." - }, - "http://www.w3.org/2005/xpath-functions#round#1": { - "name": "round", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#round#1", - "params": [ - "$arg as xs:numeric?" - ], - "type": "xs:numeric?", - "description": " Rounds a value to a specified number of decimal places, rounding upwards if two such values are equally near." - }, - "http://www.w3.org/2005/xpath-functions#round#2": { - "name": "round", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#round#2", - "params": [ - "$arg as xs:numeric?", - "$precision as xs:integer" - ], - "type": "xs:numeric?", - "description": " Rounds a value to a specified number of decimal places, rounding upwards if two such values are equally near." - }, - "http://www.w3.org/2005/xpath-functions#round-half-to-even#1": { - "name": "round-half-to-even", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#round-half-to-even#1", - "params": [ - "$arg as xs:numeric?" - ], - "type": "xs:numeric?", - "description": " Rounds a value to a specified number of decimal places, rounding to make the last digit even if two such values are equally near." - }, - "http://www.w3.org/2005/xpath-functions#round-half-to-even#2": { - "name": "round-half-to-even", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#round-half-to-even#2", - "params": [ - "$arg as xs:numeric?", - "$precision as xs:integer" - ], - "type": "xs:numeric?", - "description": " Rounds a value to a specified number of decimal places, rounding to make the last digit even if two such values are equally near." - }, - "http://www.w3.org/2005/xpath-functions#number#0": { - "name": "number", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#number#0", - "params": [], - "type": "xs:double", - "description": " Returns the value indicated by $arg or, if $arg is not specified, the context item after atomization, converted to an xs:double." - }, - "http://www.w3.org/2005/xpath-functions#number#1": { - "name": "number", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#number#1", - "params": [ - "$arg as xs:anyAtomicType?" - ], - "type": "xs:double", - "description": " Returns the value indicated by $arg or, if $arg is not specified, the context item after atomization, converted to an xs:double." - }, - "http://www.w3.org/2005/xpath-functions#format-integer#2": { - "name": "format-integer", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#format-integer#2", - "params": [ - "$value as xs:integer?", - "$picture as xs:string" - ], - "type": "xs:string", - "description": " Formats an integer according to a given picture string, using the conventions of a given natural language if specified." - }, - "http://www.w3.org/2005/xpath-functions#format-integer#3": { - "name": "format-integer", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#format-integer#3", - "params": [ - "$value as xs:integer?", - "$picture as xs:string", - "$lang as xs:string?" - ], - "type": "xs:string", - "description": " Formats an integer according to a given picture string, using the conventions of a given natural language if specified." - }, - "http://www.w3.org/2005/xpath-functions#format-number#2": { - "name": "format-number", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#format-number#2", - "params": [ - "$value as xs:numeric?", - "$picture as xs:string" - ], - "type": "xs:string", - "description": " Returns a string containing a number formatted according to a given picture string, taking account of decimal formats specified in the static context." - }, - "http://www.w3.org/2005/xpath-functions#format-number#3": { - "name": "format-number", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#format-number#3", - "params": [ - "$value as xs:numeric?", - "$picture as xs:string", - "$decimal-format-name as xs:string?" - ], - "type": "xs:string", - "description": " Returns a string containing a number formatted according to a given picture string, taking account of decimal formats specified in the static context." - }, - "http://www.w3.org/2005/xpath-functions#random-number-generator#0": { - "name": "random-number-generator", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#random-number-generator#0", - "params": [], - "type": "map(xs:string, item())", - "description": " Returns a random number generator, which can be used to generate sequences of random numbers." - }, - "http://www.w3.org/2005/xpath-functions#random-number-generator#1": { - "name": "random-number-generator", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#random-number-generator#1", - "params": [ - "$seed as xs:anyAtomicType?" - ], - "type": "map(xs:string, item())", - "description": " Returns a random number generator, which can be used to generate sequences of random numbers." - }, - "http://www.w3.org/2005/xpath-functions#codepoints-to-string#1": { - "name": "codepoints-to-string", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#codepoints-to-string#1", - "params": [ - "$arg as xs:integer*" - ], - "type": "xs:string", - "description": " Returns an xs:string whose characters have supplied codepoints." - }, - "http://www.w3.org/2005/xpath-functions#string-to-codepoints#1": { - "name": "string-to-codepoints", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#string-to-codepoints#1", - "params": [ - "$arg as xs:string?" - ], - "type": "xs:integer*", - "description": " Returns the sequence of codepoints that constitute an xs:string value." - }, - "http://www.w3.org/2005/xpath-functions#compare#2": { - "name": "compare", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#compare#2", - "params": [ - "$comparand1 as xs:string?", - "$comparand2 as xs:string?" - ], - "type": "xs:integer?", - "description": " Returns -1, 0, or 1, depending on whether $comparand1 collates before, equal to, or after $comparand2 according to the rules of a selected collation." - }, - "http://www.w3.org/2005/xpath-functions#compare#3": { - "name": "compare", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#compare#3", - "params": [ - "$comparand1 as xs:string?", - "$comparand2 as xs:string?", - "$collation as xs:string" - ], - "type": "xs:integer?", - "description": " Returns -1, 0, or 1, depending on whether $comparand1 collates before, equal to, or after $comparand2 according to the rules of a selected collation." - }, - "http://www.w3.org/2005/xpath-functions#codepoint-equal#2": { - "name": "codepoint-equal", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#codepoint-equal#2", - "params": [ - "$comparand1 as xs:string?", - "$comparand2 as xs:string?" - ], - "type": "xs:boolean?", - "description": " Returns true if two strings are equal, considered codepoint-by-codepoint." - }, - "http://www.w3.org/2005/xpath-functions#collation-key#1": { - "name": "collation-key", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#collation-key#1", - "params": [ - "$key as xs:string" - ], - "type": "xs:base64Binary", - "description": " Given a string value and a collation, generates an internal value called a collation key, with the property that the matching and ordering of collation keys reflects the matching and ordering of strings under the specified collation." - }, - "http://www.w3.org/2005/xpath-functions#collation-key#2": { - "name": "collation-key", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#collation-key#2", - "params": [ - "$key as xs:string", - "$collation as xs:string" - ], - "type": "xs:base64Binary", - "description": " Given a string value and a collation, generates an internal value called a collation key, with the property that the matching and ordering of collation keys reflects the matching and ordering of strings under the specified collation." - }, - "http://www.w3.org/2005/xpath-functions#contains-token#2": { - "name": "contains-token", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#contains-token#2", - "params": [ - "$input as xs:string*", - "$token as xs:string" - ], - "type": "xs:boolean", - "description": " Determines whether or not any of the supplied strings, when tokenized at whitespace boundaries, contains the supplied token, under the rules of the supplied collation." - }, - "http://www.w3.org/2005/xpath-functions#contains-token#3": { - "name": "contains-token", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#contains-token#3", - "params": [ - "$input as xs:string*", - "$token as xs:string", - "$collation as xs:string" - ], - "type": "xs:boolean", - "description": " Determines whether or not any of the supplied strings, when tokenized at whitespace boundaries, contains the supplied token, under the rules of the supplied collation." - }, - "http://www.w3.org/2005/xpath-functions#concat#2": { - "name": "concat", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#concat#2", - "params": [ - "$arg1 as xs:anyAtomicType?", - "$arg2 as xs:anyAtomicType?" - ], - "type": "xs:string", - "description": " Returns the concatenation of the string values of the arguments." - }, - "http://www.w3.org/2005/xpath-functions#string-join#1": { - "name": "string-join", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#string-join#1", - "params": [ - "$arg1 as xs:anyAtomicType*" - ], - "type": "xs:string", - "description": " Returns a string created by concatenating the items in a sequence, with a defined separator between adjacent items." - }, - "http://www.w3.org/2005/xpath-functions#string-join#2": { - "name": "string-join", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#string-join#2", - "params": [ - "$arg1 as xs:anyAtomicType*", - "$arg2 as xs:string" - ], - "type": "xs:string", - "description": " Returns a string created by concatenating the items in a sequence, with a defined separator between adjacent items." - }, - "http://www.w3.org/2005/xpath-functions#substring#2": { - "name": "substring", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#substring#2", - "params": [ - "$sourceString as xs:string?", - "$start as xs:double" - ], - "type": "xs:string", - "description": " Returns the portion of the value of $sourceString beginning at the position indicated by the value of $start and continuing for the number of characters indicated by the value of $length." - }, - "http://www.w3.org/2005/xpath-functions#substring#3": { - "name": "substring", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#substring#3", - "params": [ - "$sourceString as xs:string?", - "$start as xs:double", - "$length as xs:double" - ], - "type": "xs:string", - "description": " Returns the portion of the value of $sourceString beginning at the position indicated by the value of $start and continuing for the number of characters indicated by the value of $length." - }, - "http://www.w3.org/2005/xpath-functions#string-length#0": { - "name": "string-length", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#string-length#0", - "params": [], - "type": "xs:integer", - "description": " Returns the number of characters in a string." - }, - "http://www.w3.org/2005/xpath-functions#string-length#1": { - "name": "string-length", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#string-length#1", - "params": [ - "$arg as xs:string?" - ], - "type": "xs:integer", - "description": " Returns the number of characters in a string." - }, - "http://www.w3.org/2005/xpath-functions#normalize-space#0": { - "name": "normalize-space", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#normalize-space#0", - "params": [], - "type": "xs:string", - "description": " Returns the value of $arg with leading and trailing whitespace removed, and sequences of internal whitespace reduced to a single space character." - }, - "http://www.w3.org/2005/xpath-functions#normalize-space#1": { - "name": "normalize-space", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#normalize-space#1", - "params": [ - "$arg as xs:string?" - ], - "type": "xs:string", - "description": " Returns the value of $arg with leading and trailing whitespace removed, and sequences of internal whitespace reduced to a single space character." - }, - "http://www.w3.org/2005/xpath-functions#normalize-unicode#1": { - "name": "normalize-unicode", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#normalize-unicode#1", - "params": [ - "$arg as xs:string?" - ], - "type": "xs:string", - "description": " Returns the value of $arg after applying Unicode normalization." - }, - "http://www.w3.org/2005/xpath-functions#normalize-unicode#2": { - "name": "normalize-unicode", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#normalize-unicode#2", - "params": [ - "$arg as xs:string?", - "$normalizationForm as xs:string" - ], - "type": "xs:string", - "description": " Returns the value of $arg after applying Unicode normalization." - }, - "http://www.w3.org/2005/xpath-functions#upper-case#1": { - "name": "upper-case", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#upper-case#1", - "params": [ - "$arg as xs:string?" - ], - "type": "xs:string", - "description": " Converts a string to upper case." - }, - "http://www.w3.org/2005/xpath-functions#lower-case#1": { - "name": "lower-case", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#lower-case#1", - "params": [ - "$arg as xs:string?" - ], - "type": "xs:string", - "description": " Converts a string to lower case." - }, - "http://www.w3.org/2005/xpath-functions#translate#3": { - "name": "translate", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#translate#3", - "params": [ - "$arg as xs:string?", - "$mapString as xs:string", - "$transString as xs:string" - ], - "type": "xs:string", - "description": " Returns the value of $arg modified by replacing or removing individual characters." - }, - "http://www.w3.org/2005/xpath-functions#contains#2": { - "name": "contains", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#contains#2", - "params": [ - "$arg1 as xs:string?", - "$arg2 as xs:string?" - ], - "type": "xs:boolean", - "description": " Returns true if the string $arg1 contains $arg2 as a substring, taking collations into account." - }, - "http://www.w3.org/2005/xpath-functions#contains#3": { - "name": "contains", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#contains#3", - "params": [ - "$arg1 as xs:string?", - "$arg2 as xs:string?", - "$collation as xs:string" - ], - "type": "xs:boolean", - "description": " Returns true if the string $arg1 contains $arg2 as a substring, taking collations into account." - }, - "http://www.w3.org/2005/xpath-functions#starts-with#2": { - "name": "starts-with", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#starts-with#2", - "params": [ - "$arg1 as xs:string?", - "$arg2 as xs:string?" - ], - "type": "xs:boolean", - "description": " Returns true if the string $arg1 contains $arg2 as a leading substring, taking collations into account." - }, - "http://www.w3.org/2005/xpath-functions#starts-with#3": { - "name": "starts-with", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#starts-with#3", - "params": [ - "$arg1 as xs:string?", - "$arg2 as xs:string?", - "$collation as xs:string" - ], - "type": "xs:boolean", - "description": " Returns true if the string $arg1 contains $arg2 as a leading substring, taking collations into account." - }, - "http://www.w3.org/2005/xpath-functions#ends-with#2": { - "name": "ends-with", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#ends-with#2", - "params": [ - "$arg1 as xs:string?", - "$arg2 as xs:string?" - ], - "type": "xs:boolean", - "description": " Returns true if the string $arg1 contains $arg2 as a trailing substring, taking collations into account." - }, - "http://www.w3.org/2005/xpath-functions#ends-with#3": { - "name": "ends-with", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#ends-with#3", - "params": [ - "$arg1 as xs:string?", - "$arg2 as xs:string?", - "$collation as xs:string" - ], - "type": "xs:boolean", - "description": " Returns true if the string $arg1 contains $arg2 as a trailing substring, taking collations into account." - }, - "http://www.w3.org/2005/xpath-functions#substring-before#2": { - "name": "substring-before", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#substring-before#2", - "params": [ - "$arg1 as xs:string?", - "$arg2 as xs:string?" - ], - "type": "xs:string", - "description": " Returns the part of $arg1 that precedes the first occurrence of $arg2, taking collations into account." - }, - "http://www.w3.org/2005/xpath-functions#substring-before#3": { - "name": "substring-before", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#substring-before#3", - "params": [ - "$arg1 as xs:string?", - "$arg2 as xs:string?", - "$collation as xs:string" - ], - "type": "xs:string", - "description": " Returns the part of $arg1 that precedes the first occurrence of $arg2, taking collations into account." - }, - "http://www.w3.org/2005/xpath-functions#substring-after#2": { - "name": "substring-after", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#substring-after#2", - "params": [ - "$arg1 as xs:string?", - "$arg2 as xs:string?" - ], - "type": "xs:string", - "description": " Returns the part of $arg1 that follows the first occurrence of $arg2, taking collations into account." - }, - "http://www.w3.org/2005/xpath-functions#substring-after#3": { - "name": "substring-after", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#substring-after#3", - "params": [ - "$arg1 as xs:string?", - "$arg2 as xs:string?", - "$collation as xs:string" - ], - "type": "xs:string", - "description": " Returns the part of $arg1 that follows the first occurrence of $arg2, taking collations into account." - }, - "http://www.w3.org/2005/xpath-functions#matches#2": { - "name": "matches", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#matches#2", - "params": [ - "$input as xs:string?", - "$pattern as xs:string" - ], - "type": "xs:boolean", - "description": " Returns true if the supplied string matches a given regular expression." - }, - "http://www.w3.org/2005/xpath-functions#matches#3": { - "name": "matches", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#matches#3", - "params": [ - "$input as xs:string?", - "$pattern as xs:string", - "$flags as xs:string" - ], - "type": "xs:boolean", - "description": " Returns true if the supplied string matches a given regular expression." - }, - "http://www.w3.org/2005/xpath-functions#replace#3": { - "name": "replace", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#replace#3", - "params": [ - "$input as xs:string?", - "$pattern as xs:string", - "$replacement as xs:string" - ], - "type": "xs:string", - "description": " Returns a string produced from the input string by replacing any substrings that match a given regular expression with a supplied replacement string." - }, - "http://www.w3.org/2005/xpath-functions#replace#4": { - "name": "replace", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#replace#4", - "params": [ - "$input as xs:string?", - "$pattern as xs:string", - "$replacement as xs:string", - "$flags as xs:string" - ], - "type": "xs:string", - "description": " Returns a string produced from the input string by replacing any substrings that match a given regular expression with a supplied replacement string." - }, - "http://www.w3.org/2005/xpath-functions#tokenize#1": { - "name": "tokenize", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#tokenize#1", - "params": [ - "$input as xs:string?" - ], - "type": "xs:string*", - "description": " Returns a sequence of strings constructed by splitting the input wherever a separator is found; the separator is any substring that matches a given regular expression." - }, - "http://www.w3.org/2005/xpath-functions#tokenize#2": { - "name": "tokenize", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#tokenize#2", - "params": [ - "$input as xs:string?", - "$pattern as xs:string" - ], - "type": "xs:string*", - "description": " Returns a sequence of strings constructed by splitting the input wherever a separator is found; the separator is any substring that matches a given regular expression." - }, - "http://www.w3.org/2005/xpath-functions#tokenize#3": { - "name": "tokenize", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#tokenize#3", - "params": [ - "$input as xs:string?", - "$pattern as xs:string", - "$flags as xs:string" - ], - "type": "xs:string*", - "description": " Returns a sequence of strings constructed by splitting the input wherever a separator is found; the separator is any substring that matches a given regular expression." - }, - "http://www.w3.org/2005/xpath-functions#analyze-string#2": { - "name": "analyze-string", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#analyze-string#2", - "params": [ - "$input as xs:string?", - "$pattern as xs:string" - ], - "type": "element(fn:analyze-string-result)", - "description": " Analyzes a string using a regular expression, returning an XML structure that identifies which parts of the input string matched or failed to match the regular expression, and in the case of matched substrings, which substrings matched each capturing group in the regular expression." - }, - "http://www.w3.org/2005/xpath-functions#analyze-string#3": { - "name": "analyze-string", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#analyze-string#3", - "params": [ - "$input as xs:string?", - "$pattern as xs:string", - "$flags as xs:string" - ], - "type": "element(fn:analyze-string-result)", - "description": " Analyzes a string using a regular expression, returning an XML structure that identifies which parts of the input string matched or failed to match the regular expression, and in the case of matched substrings, which substrings matched each capturing group in the regular expression." - }, - "http://www.w3.org/2005/xpath-functions#true#0": { - "name": "true", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#true#0", - "params": [], - "type": "xs:boolean", - "description": " Returns the xs:boolean value true." - }, - "http://www.w3.org/2005/xpath-functions#false#0": { - "name": "false", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#false#0", - "params": [], - "type": "xs:boolean", - "description": " Returns the xs:boolean value false." - }, - "http://www.w3.org/2005/xpath-functions#boolean#1": { - "name": "boolean", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#boolean#1", - "params": [ - "$arg as item()*" - ], - "type": "xs:boolean", - "description": " Computes the effective boolean value of the sequence $arg." - }, - "http://www.w3.org/2005/xpath-functions#not#1": { - "name": "not", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#not#1", - "params": [ - "$arg as item()*" - ], - "type": "xs:boolean", - "description": " Returns true if the effective boolean value of $arg is false, or false if it is true." - }, - "http://www.w3.org/2005/xpath-functions#years-from-duration#1": { - "name": "years-from-duration", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#years-from-duration#1", - "params": [ - "$arg as xs:duration?" - ], - "type": "xs:integer?", - "description": " Returns the number of years in a duration." - }, - "http://www.w3.org/2005/xpath-functions#months-from-duration#1": { - "name": "months-from-duration", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#months-from-duration#1", - "params": [ - "$arg as xs:duration?" - ], - "type": "xs:integer?", - "description": " Returns the number of months in a duration." - }, - "http://www.w3.org/2005/xpath-functions#days-from-duration#1": { - "name": "days-from-duration", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#days-from-duration#1", - "params": [ - "$arg as xs:duration?" - ], - "type": "xs:integer?", - "description": " Returns the number of days in a duration." - }, - "http://www.w3.org/2005/xpath-functions#hours-from-duration#1": { - "name": "hours-from-duration", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#hours-from-duration#1", - "params": [ - "$arg as xs:duration?" - ], - "type": "xs:integer?", - "description": " Returns the number of hours in a duration." - }, - "http://www.w3.org/2005/xpath-functions#minutes-from-duration#1": { - "name": "minutes-from-duration", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#minutes-from-duration#1", - "params": [ - "$arg as xs:duration?" - ], - "type": "xs:integer?", - "description": " Returns the number of minutes in a duration." - }, - "http://www.w3.org/2005/xpath-functions#seconds-from-duration#1": { - "name": "seconds-from-duration", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#seconds-from-duration#1", - "params": [ - "$arg as xs:duration?" - ], - "type": "xs:decimal?", - "description": " Returns the number of seconds in a duration." - }, - "http://www.w3.org/2005/xpath-functions#dateTime#2": { - "name": "dateTime", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#dateTime#2", - "params": [ - "$arg1 as xs:date?", - "$arg2 as xs:time?" - ], - "type": "xs:dateTime?", - "description": " Returns an xs:dateTime value created by combining an xs:date and an xs:time." - }, - "http://www.w3.org/2005/xpath-functions#year-from-dateTime#1": { - "name": "year-from-dateTime", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#year-from-dateTime#1", - "params": [ - "$arg as xs:dateTime?" - ], - "type": "xs:integer?", - "description": " Returns the year component of an xs:dateTime." - }, - "http://www.w3.org/2005/xpath-functions#month-from-dateTime#1": { - "name": "month-from-dateTime", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#month-from-dateTime#1", - "params": [ - "$arg as xs:dateTime?" - ], - "type": "xs:integer?", - "description": " Returns the month component of an xs:dateTime." - }, - "http://www.w3.org/2005/xpath-functions#day-from-dateTime#1": { - "name": "day-from-dateTime", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#day-from-dateTime#1", - "params": [ - "$arg as xs:dateTime?" - ], - "type": "xs:integer?", - "description": " Returns the day component of an xs:dateTime." - }, - "http://www.w3.org/2005/xpath-functions#hours-from-dateTime#1": { - "name": "hours-from-dateTime", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#hours-from-dateTime#1", - "params": [ - "$arg as xs:dateTime?" - ], - "type": "xs:integer?", - "description": " Returns the hours component of an xs:dateTime." - }, - "http://www.w3.org/2005/xpath-functions#minutes-from-dateTime#1": { - "name": "minutes-from-dateTime", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#minutes-from-dateTime#1", - "params": [ - "$arg as xs:dateTime?" - ], - "type": "xs:integer?", - "description": " Returns the minute component of an xs:dateTime." - }, - "http://www.w3.org/2005/xpath-functions#seconds-from-dateTime#1": { - "name": "seconds-from-dateTime", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#seconds-from-dateTime#1", - "params": [ - "$arg as xs:dateTime?" - ], - "type": "xs:decimal?", - "description": " Returns the seconds component of an xs:dateTime." - }, - "http://www.w3.org/2005/xpath-functions#timezone-from-dateTime#1": { - "name": "timezone-from-dateTime", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#timezone-from-dateTime#1", - "params": [ - "$arg as xs:dateTime?" - ], - "type": "xs:dayTimeDuration?", - "description": " Returns the timezone component of an xs:dateTime." - }, - "http://www.w3.org/2005/xpath-functions#year-from-date#1": { - "name": "year-from-date", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#year-from-date#1", - "params": [ - "$arg as xs:date?" - ], - "type": "xs:integer?", - "description": " Returns the year component of an xs:date." - }, - "http://www.w3.org/2005/xpath-functions#month-from-date#1": { - "name": "month-from-date", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#month-from-date#1", - "params": [ - "$arg as xs:date?" - ], - "type": "xs:integer?", - "description": " Returns the month component of an xs:date." - }, - "http://www.w3.org/2005/xpath-functions#day-from-date#1": { - "name": "day-from-date", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#day-from-date#1", - "params": [ - "$arg as xs:date?" - ], - "type": "xs:integer?", - "description": " Returns the day component of an xs:date." - }, - "http://www.w3.org/2005/xpath-functions#timezone-from-date#1": { - "name": "timezone-from-date", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#timezone-from-date#1", - "params": [ - "$arg as xs:date?" - ], - "type": "xs:dayTimeDuration?", - "description": " Returns the timezone component of an xs:date." - }, - "http://www.w3.org/2005/xpath-functions#hours-from-time#1": { - "name": "hours-from-time", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#hours-from-time#1", - "params": [ - "$arg as xs:time?" - ], - "type": "xs:integer?", - "description": " Returns the hours component of an xs:time." - }, - "http://www.w3.org/2005/xpath-functions#minutes-from-time#1": { - "name": "minutes-from-time", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#minutes-from-time#1", - "params": [ - "$arg as xs:time?" - ], - "type": "xs:integer?", - "description": " Returns the minutes component of an xs:time." - }, - "http://www.w3.org/2005/xpath-functions#seconds-from-time#1": { - "name": "seconds-from-time", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#seconds-from-time#1", - "params": [ - "$arg as xs:time?" - ], - "type": "xs:decimal?", - "description": " Returns the seconds component of an xs:time." - }, - "http://www.w3.org/2005/xpath-functions#timezone-from-time#1": { - "name": "timezone-from-time", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#timezone-from-time#1", - "params": [ - "$arg as xs:time?" - ], - "type": "xs:dayTimeDuration?", - "description": " Returns the timezone component of an xs:time." - }, - "http://www.w3.org/2005/xpath-functions#adjust-dateTime-to-timezone#1": { - "name": "adjust-dateTime-to-timezone", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#adjust-dateTime-to-timezone#1", - "params": [ - "$arg as xs:dateTime?" - ], - "type": "xs:dateTime?", - "description": " Adjusts an xs:dateTime value to a specific timezone, or to no timezone at all." - }, - "http://www.w3.org/2005/xpath-functions#adjust-dateTime-to-timezone#2": { - "name": "adjust-dateTime-to-timezone", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#adjust-dateTime-to-timezone#2", - "params": [ - "$arg as xs:dateTime?", - "$timezone as xs:dayTimeDuration?" - ], - "type": "xs:dateTime?", - "description": " Adjusts an xs:dateTime value to a specific timezone, or to no timezone at all." - }, - "http://www.w3.org/2005/xpath-functions#adjust-date-to-timezone#1": { - "name": "adjust-date-to-timezone", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#adjust-date-to-timezone#1", - "params": [ - "$arg as xs:date?" - ], - "type": "xs:date?", - "description": " Adjusts an xs:date value to a specific timezone, or to no timezone at all; the result is the date in the target timezone that contains the starting instant of the supplied date." - }, - "http://www.w3.org/2005/xpath-functions#adjust-date-to-timezone#2": { - "name": "adjust-date-to-timezone", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#adjust-date-to-timezone#2", - "params": [ - "$arg as xs:date?", - "$timezone as xs:dayTimeDuration?" - ], - "type": "xs:date?", - "description": " Adjusts an xs:date value to a specific timezone, or to no timezone at all; the result is the date in the target timezone that contains the starting instant of the supplied date." - }, - "http://www.w3.org/2005/xpath-functions#adjust-time-to-timezone#1": { - "name": "adjust-time-to-timezone", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#adjust-time-to-timezone#1", - "params": [ - "$arg as xs:time?" - ], - "type": "xs:time?", - "description": " Adjusts an xs:time value to a specific timezone, or to no timezone at all." - }, - "http://www.w3.org/2005/xpath-functions#adjust-time-to-timezone#2": { - "name": "adjust-time-to-timezone", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#adjust-time-to-timezone#2", - "params": [ - "$arg as xs:time?", - "$timezone as xs:dayTimeDuration?" - ], - "type": "xs:time?", - "description": " Adjusts an xs:time value to a specific timezone, or to no timezone at all." - }, - "http://www.w3.org/2005/xpath-functions#format-dateTime#2": { - "name": "format-dateTime", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#format-dateTime#2", - "params": [ - "$value as xs:dateTime?", - "$picture as xs:string" - ], - "type": "xs:string?", - "description": " Returns a string containing an xs:dateTime value formatted for display." - }, - "http://www.w3.org/2005/xpath-functions#format-dateTime#5": { - "name": "format-dateTime", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#format-dateTime#5", - "params": [ - "$value as xs:dateTime?", - "$picture as xs:string", - "$language as xs:string?", - "$calendar as xs:string?", - "$place as xs:string?" - ], - "type": "xs:string?", - "description": " Returns a string containing an xs:dateTime value formatted for display." - }, - "http://www.w3.org/2005/xpath-functions#format-date#2": { - "name": "format-date", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#format-date#2", - "params": [ - "$value as xs:date?", - "$picture as xs:string" - ], - "type": "xs:string?", - "description": " Returns a string containing an xs:date value formatted for display." - }, - "http://www.w3.org/2005/xpath-functions#format-date#5": { - "name": "format-date", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#format-date#5", - "params": [ - "$value as xs:date?", - "$picture as xs:string", - "$language as xs:string?", - "$calendar as xs:string?", - "$place as xs:string?" - ], - "type": "xs:string?", - "description": " Returns a string containing an xs:date value formatted for display." - }, - "http://www.w3.org/2005/xpath-functions#format-time#2": { - "name": "format-time", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#format-time#2", - "params": [ - "$value as xs:time?", - "$picture as xs:string" - ], - "type": "xs:string?", - "description": " Returns a string containing an xs:time value formatted for display." - }, - "http://www.w3.org/2005/xpath-functions#format-time#5": { - "name": "format-time", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#format-time#5", - "params": [ - "$value as xs:time?", - "$picture as xs:string", - "$language as xs:string?", - "$calendar as xs:string?", - "$place as xs:string?" - ], - "type": "xs:string?", - "description": " Returns a string containing an xs:time value formatted for display." - }, - "http://www.w3.org/2005/xpath-functions#parse-ietf-date#1": { - "name": "parse-ietf-date", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#parse-ietf-date#1", - "params": [ - "$value as xs:string?" - ], - "type": "xs:dateTime?", - "description": " Parses a string containing the date and time in IETF format, returning the corresponding xs:dateTime value." - }, - "http://www.w3.org/2005/xpath-functions#resolve-QName#2": { - "name": "resolve-QName", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#resolve-QName#2", - "params": [ - "$qname as xs:string?", - "$element as element()" - ], - "type": "xs:QName?", - "description": " Returns an xs:QName value (that is, an expanded-QName) by taking an xs:string that has the lexical form of an xs:QName (a string in the form \"prefix:local-name\" or \"local-name\") and resolving it using the in-scope namespaces for a given element." - }, - "http://www.w3.org/2005/xpath-functions#QName#2": { - "name": "QName", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#QName#2", - "params": [ - "$paramURI as xs:string?", - "$paramQName as xs:string" - ], - "type": "xs:QName", - "description": " Returns an xs:QName value formed using a supplied namespace URI and lexical QName." - }, - "http://www.w3.org/2005/xpath-functions#prefix-from-QName#1": { - "name": "prefix-from-QName", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#prefix-from-QName#1", - "params": [ - "$arg as xs:QName?" - ], - "type": "xs:NCName?", - "description": " Returns the prefix component of the supplied QName." - }, - "http://www.w3.org/2005/xpath-functions#local-name-from-QName#1": { - "name": "local-name-from-QName", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#local-name-from-QName#1", - "params": [ - "$arg as xs:QName?" - ], - "type": "xs:NCName?", - "description": " Returns the local part of the supplied QName." - }, - "http://www.w3.org/2005/xpath-functions#namespace-uri-from-QName#1": { - "name": "namespace-uri-from-QName", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#namespace-uri-from-QName#1", - "params": [ - "$arg as xs:QName?" - ], - "type": "xs:anyURI?", - "description": " Returns the namespace URI part of the supplied QName." - }, - "http://www.w3.org/2005/xpath-functions#namespace-uri-for-prefix#2": { - "name": "namespace-uri-for-prefix", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#namespace-uri-for-prefix#2", - "params": [ - "$prefix as xs:string?", - "$element as element()" - ], - "type": "xs:anyURI?", - "description": " Returns the namespace URI of one of the in-scope namespaces for $element, identified by its namespace prefix." - }, - "http://www.w3.org/2005/xpath-functions#in-scope-prefixes#1": { - "name": "in-scope-prefixes", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#in-scope-prefixes#1", - "params": [ - "$element as element()" - ], - "type": "xs:string*", - "description": " Returns the prefixes of the in-scope namespaces for an element node." - }, - "http://www.w3.org/2005/xpath-functions#empty#1": { - "name": "empty", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#empty#1", - "params": [ - "$arg as item()*" - ], - "type": "xs:boolean", - "description": " Returns true if the argument is the empty sequence." - }, - "http://www.w3.org/2005/xpath-functions#exists#1": { - "name": "exists", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#exists#1", - "params": [ - "$arg as item()*" - ], - "type": "xs:boolean", - "description": " Returns true if the argument is a non-empty sequence." - }, - "http://www.w3.org/2005/xpath-functions#head#1": { - "name": "head", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#head#1", - "params": [ - "$arg as item()*" - ], - "type": "item()?", - "description": " Returns the first item in a sequence." - }, - "http://www.w3.org/2005/xpath-functions#tail#1": { - "name": "tail", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#tail#1", - "params": [ - "$arg as item()*" - ], - "type": "item()*", - "description": " Returns all but the first item in a sequence." - }, - "http://www.w3.org/2005/xpath-functions#insert-before#3": { - "name": "insert-before", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#insert-before#3", - "params": [ - "$target as item()*", - "$position as xs:integer", - "$inserts as item()*" - ], - "type": "item()*", - "description": " Returns a sequence constructed by inserting an item or a sequence of items at a given position within an existing sequence." - }, - "http://www.w3.org/2005/xpath-functions#remove#2": { - "name": "remove", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#remove#2", - "params": [ - "$target as item()*", - "$position as xs:integer" - ], - "type": "item()*", - "description": " Returns a new sequence containing all the items of $target except the item at position $position." - }, - "http://www.w3.org/2005/xpath-functions#reverse#1": { - "name": "reverse", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#reverse#1", - "params": [ - "$arg as item()*" - ], - "type": "item()*", - "description": " Reverses the order of items in a sequence." - }, - "http://www.w3.org/2005/xpath-functions#subsequence#2": { - "name": "subsequence", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#subsequence#2", - "params": [ - "$sourceSeq as item()*", - "$startingLoc as xs:double" - ], - "type": "item()*", - "description": " Returns the contiguous sequence of items in the value of $sourceSeq beginning at the position indicated by the value of $startingLoc and continuing for the number of items indicated by the value of $length." - }, - "http://www.w3.org/2005/xpath-functions#subsequence#3": { - "name": "subsequence", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#subsequence#3", - "params": [ - "$sourceSeq as item()*", - "$startingLoc as xs:double", - "$length as xs:double" - ], - "type": "item()*", - "description": " Returns the contiguous sequence of items in the value of $sourceSeq beginning at the position indicated by the value of $startingLoc and continuing for the number of items indicated by the value of $length." - }, - "http://www.w3.org/2005/xpath-functions#unordered#1": { - "name": "unordered", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#unordered#1", - "params": [ - "$sourceSeq as item()*" - ], - "type": "item()*", - "description": " Returns the items of $sourceSeq in an implementation-dependent order." - }, - "http://www.w3.org/2005/xpath-functions#distinct-values#1": { - "name": "distinct-values", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#distinct-values#1", - "params": [ - "$arg as xs:anyAtomicType*" - ], - "type": "xs:anyAtomicType*", - "description": " Returns the values that appear in a sequence, with duplicates eliminated." - }, - "http://www.w3.org/2005/xpath-functions#distinct-values#2": { - "name": "distinct-values", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#distinct-values#2", - "params": [ - "$arg as xs:anyAtomicType*", - "$collation as xs:string" - ], - "type": "xs:anyAtomicType*", - "description": " Returns the values that appear in a sequence, with duplicates eliminated." - }, - "http://www.w3.org/2005/xpath-functions#index-of#2": { - "name": "index-of", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#index-of#2", - "params": [ - "$seq as xs:anyAtomicType*", - "$search as xs:anyAtomicType" - ], - "type": "xs:integer*", - "description": " Returns a sequence of positive integers giving the positions within the sequence $seq of items that are equal to $search." - }, - "http://www.w3.org/2005/xpath-functions#index-of#3": { - "name": "index-of", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#index-of#3", - "params": [ - "$seq as xs:anyAtomicType*", - "$search as xs:anyAtomicType", - "$collation as xs:string" - ], - "type": "xs:integer*", - "description": " Returns a sequence of positive integers giving the positions within the sequence $seq of items that are equal to $search." - }, - "http://www.w3.org/2005/xpath-functions#deep-equal#2": { - "name": "deep-equal", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#deep-equal#2", - "params": [ - "$parameter1 as item()*", - "$parameter2 as item()*" - ], - "type": "xs:boolean", - "description": " This function assesses whether two sequences are deep-equal to each other. To be deep-equal, they must contain items that are pairwise deep-equal; and for two items to be deep-equal, they must either be atomic values that compare equal, or nodes of the same kind, with the same name, whose children are deep-equal, or maps with matching entries, or arrays with matching members." - }, - "http://www.w3.org/2005/xpath-functions#deep-equal#3": { - "name": "deep-equal", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#deep-equal#3", - "params": [ - "$parameter1 as item()*", - "$parameter2 as item()*", - "$collation as xs:string" - ], - "type": "xs:boolean", - "description": " This function assesses whether two sequences are deep-equal to each other. To be deep-equal, they must contain items that are pairwise deep-equal; and for two items to be deep-equal, they must either be atomic values that compare equal, or nodes of the same kind, with the same name, whose children are deep-equal, or maps with matching entries, or arrays with matching members." - }, - "http://www.w3.org/2005/xpath-functions#zero-or-one#1": { - "name": "zero-or-one", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#zero-or-one#1", - "params": [ - "$arg as item()*" - ], - "type": "item()?", - "description": " Returns $arg if it contains zero or one items. Otherwise, raises an error." - }, - "http://www.w3.org/2005/xpath-functions#one-or-more#1": { - "name": "one-or-more", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#one-or-more#1", - "params": [ - "$arg as item()*" - ], - "type": "item()+", - "description": " Returns $arg if it contains one or more items. Otherwise, raises an error." - }, - "http://www.w3.org/2005/xpath-functions#exactly-one#1": { - "name": "exactly-one", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#exactly-one#1", - "params": [ - "$arg as item()*" - ], - "type": "item()", - "description": " Returns $arg if it contains exactly one item. Otherwise, raises an error." - }, - "http://www.w3.org/2005/xpath-functions#count#1": { - "name": "count", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#count#1", - "params": [ - "$arg as item()*" - ], - "type": "xs:integer", - "description": " Returns the number of items in a sequence." - }, - "http://www.w3.org/2005/xpath-functions#avg#1": { - "name": "avg", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#avg#1", - "params": [ - "$arg as xs:anyAtomicType*" - ], - "type": "xs:anyAtomicType?", - "description": " Returns the average of the values in the input sequence $arg, that is, the sum of the values divided by the number of values." - }, - "http://www.w3.org/2005/xpath-functions#max#1": { - "name": "max", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#max#1", - "params": [ - "$arg as xs:anyAtomicType*" - ], - "type": "xs:anyAtomicType?", - "description": " Returns a value that is equal to the highest value appearing in the input sequence." - }, - "http://www.w3.org/2005/xpath-functions#max#2": { - "name": "max", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#max#2", - "params": [ - "$arg as xs:anyAtomicType*", - "$collation as xs:string" - ], - "type": "xs:anyAtomicType?", - "description": " Returns a value that is equal to the highest value appearing in the input sequence." - }, - "http://www.w3.org/2005/xpath-functions#min#1": { - "name": "min", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#min#1", - "params": [ - "$arg as xs:anyAtomicType*" - ], - "type": "xs:anyAtomicType?", - "description": " Returns a value that is equal to the lowest value appearing in the input sequence." - }, - "http://www.w3.org/2005/xpath-functions#min#2": { - "name": "min", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#min#2", - "params": [ - "$arg as xs:anyAtomicType*", - "$collation as xs:string" - ], - "type": "xs:anyAtomicType?", - "description": " Returns a value that is equal to the lowest value appearing in the input sequence." - }, - "http://www.w3.org/2005/xpath-functions#sum#1": { - "name": "sum", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#sum#1", - "params": [ - "$arg as xs:anyAtomicType*" - ], - "type": "xs:anyAtomicType", - "description": " Returns a value obtained by adding together the values in $arg." - }, - "http://www.w3.org/2005/xpath-functions#sum#2": { - "name": "sum", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#sum#2", - "params": [ - "$arg as xs:anyAtomicType*", - "$zero as xs:anyAtomicType?" - ], - "type": "xs:anyAtomicType?", - "description": " Returns a value obtained by adding together the values in $arg." - }, - "http://www.w3.org/2005/xpath-functions#id#1": { - "name": "id", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#id#1", - "params": [ - "$arg as xs:string*" - ], - "type": "element()*", - "description": " Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg." - }, - "http://www.w3.org/2005/xpath-functions#id#2": { - "name": "id", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#id#2", - "params": [ - "$arg as xs:string*", - "$node as node()" - ], - "type": "element()*", - "description": " Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg." - }, - "http://www.w3.org/2005/xpath-functions#element-with-id#1": { - "name": "element-with-id", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#element-with-id#1", - "params": [ - "$arg as xs:string*" - ], - "type": "element()*", - "description": " Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg." - }, - "http://www.w3.org/2005/xpath-functions#element-with-id#2": { - "name": "element-with-id", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#element-with-id#2", - "params": [ - "$arg as xs:string*", - "$node as node()" - ], - "type": "element()*", - "description": " Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg." - }, - "http://www.w3.org/2005/xpath-functions#idref#1": { - "name": "idref", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#idref#1", - "params": [ - "$arg as xs:string*" - ], - "type": "node()*", - "description": " Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg." - }, - "http://www.w3.org/2005/xpath-functions#idref#2": { - "name": "idref", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#idref#2", - "params": [ - "$arg as xs:string*", - "$node as node()" - ], - "type": "node()*", - "description": " Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg." - }, - "http://www.w3.org/2005/xpath-functions#generate-id#0": { - "name": "generate-id", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#generate-id#0", - "params": [], - "type": "xs:string", - "description": " This function returns a string that uniquely identifies a given node." - }, - "http://www.w3.org/2005/xpath-functions#generate-id#1": { - "name": "generate-id", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#generate-id#1", - "params": [ - "$arg as node()?" - ], - "type": "xs:string", - "description": " This function returns a string that uniquely identifies a given node." - }, - "http://www.w3.org/2005/xpath-functions#doc#1": { - "name": "doc", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#doc#1", - "params": [ - "$uri as xs:string?" - ], - "type": "document-node()?", - "description": " Retrieves a document using a URI supplied as an xs:string, and returns the corresponding document node." - }, - "http://www.w3.org/2005/xpath-functions#doc-available#1": { - "name": "doc-available", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#doc-available#1", - "params": [ - "$uri as xs:string?" - ], - "type": "xs:boolean", - "description": " The function returns true if and only if the function call fn:doc($uri) would return a document node." - }, - "http://www.w3.org/2005/xpath-functions#collection#0": { - "name": "collection", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#collection#0", - "params": [], - "type": "item()*", - "description": " Returns a sequence of items identified by a collection URI; or a default collection if no URI is supplied." - }, - "http://www.w3.org/2005/xpath-functions#collection#1": { - "name": "collection", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#collection#1", - "params": [ - "$arg as xs:string?" - ], - "type": "item()*", - "description": " Returns a sequence of items identified by a collection URI; or a default collection if no URI is supplied." - }, - "http://www.w3.org/2005/xpath-functions#uri-collection#0": { - "name": "uri-collection", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#uri-collection#0", - "params": [], - "type": "xs:anyURI*", - "description": " Returns a sequence of xs:anyURI values representing the URIs in a URI collection." - }, - "http://www.w3.org/2005/xpath-functions#uri-collection#1": { - "name": "uri-collection", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#uri-collection#1", - "params": [ - "$arg as xs:string?" - ], - "type": "xs:anyURI*", - "description": " Returns a sequence of xs:anyURI values representing the URIs in a URI collection." - }, - "http://www.w3.org/2005/xpath-functions#unparsed-text#1": { - "name": "unparsed-text", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#unparsed-text#1", - "params": [ - "$href as xs:string?" - ], - "type": "xs:string?", - "description": " The fn:unparsed-text function reads an external resource (for example, a file) and returns a string representation of the resource." - }, - "http://www.w3.org/2005/xpath-functions#unparsed-text#2": { - "name": "unparsed-text", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#unparsed-text#2", - "params": [ - "$href as xs:string?", - "$encoding as xs:string" - ], - "type": "xs:string?", - "description": " The fn:unparsed-text function reads an external resource (for example, a file) and returns a string representation of the resource." - }, - "http://www.w3.org/2005/xpath-functions#unparsed-text-lines#1": { - "name": "unparsed-text-lines", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#unparsed-text-lines#1", - "params": [ - "$href as xs:string?" - ], - "type": "xs:string*", - "description": " The fn:unparsed-text-lines function reads an external resource (for example, a file) and returns its contents as a sequence of strings, one for each line of text in the string representation of the resource." - }, - "http://www.w3.org/2005/xpath-functions#unparsed-text-lines#2": { - "name": "unparsed-text-lines", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#unparsed-text-lines#2", - "params": [ - "$href as xs:string?", - "$encoding as xs:string" - ], - "type": "xs:string*", - "description": " The fn:unparsed-text-lines function reads an external resource (for example, a file) and returns its contents as a sequence of strings, one for each line of text in the string representation of the resource." - }, - "http://www.w3.org/2005/xpath-functions#unparsed-text-available#1": { - "name": "unparsed-text-available", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#unparsed-text-available#1", - "params": [ - "$href as xs:string?" - ], - "type": "xs:boolean", - "description": " Because errors in evaluating the fn:unparsed-text function are non-recoverable, these two functions are provided to allow an application to determine whether a call with particular arguments would succeed." - }, - "http://www.w3.org/2005/xpath-functions#unparsed-text-available#2": { - "name": "unparsed-text-available", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#unparsed-text-available#2", - "params": [ - "$href as xs:string?", - "$encoding as xs:string" - ], - "type": "xs:boolean", - "description": " Because errors in evaluating the fn:unparsed-text function are non-recoverable, these two functions are provided to allow an application to determine whether a call with particular arguments would succeed." - }, - "http://www.w3.org/2005/xpath-functions#environment-variable#1": { - "name": "environment-variable", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#environment-variable#1", - "params": [ - "$name as xs:string" - ], - "type": "xs:string?", - "description": " Returns the value of a system environment variable, if it exists." - }, - "http://www.w3.org/2005/xpath-functions#available-environment-variables#0": { - "name": "available-environment-variables", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#available-environment-variables#0", - "params": [], - "type": "xs:string*", - "description": " Returns a list of environment variable names that are suitable for passing to fn:environment-variable, as a (possibly empty) sequence of strings." - }, - "http://www.w3.org/2005/xpath-functions#parse-xml#1": { - "name": "parse-xml", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#parse-xml#1", - "params": [ - "$arg as xs:string?" - ], - "type": "document-node(element(*))?", - "description": " This function takes as input an XML document represented as a string, and returns the document node at the root of an XDM tree representing the parsed document." - }, - "http://www.w3.org/2005/xpath-functions#parse-xml-fragment#1": { - "name": "parse-xml-fragment", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#parse-xml-fragment#1", - "params": [ - "$arg as xs:string?" - ], - "type": "document-node()?", - "description": " This function takes as input an XML external entity represented as a string, and returns the document node at the root of an XDM tree representing the parsed document fragment." - }, - "http://www.w3.org/2005/xpath-functions#serialize#1": { - "name": "serialize", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#serialize#1", - "params": [ - "$arg as item()*" - ], - "type": "xs:string", - "description": " This function serializes the supplied input sequence $arg as described in , returning the serialized representation of the sequence as a string." - }, - "http://www.w3.org/2005/xpath-functions#serialize#2": { - "name": "serialize", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#serialize#2", - "params": [ - "$arg as item()*", - "$params as item()?" - ], - "type": "xs:string", - "description": " This function serializes the supplied input sequence $arg as described in , returning the serialized representation of the sequence as a string." - }, - "http://www.w3.org/2005/xpath-functions#function-lookup#2": { - "name": "function-lookup", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#function-lookup#2", - "params": [ - "$name as xs:QName", - "$arity as xs:integer" - ], - "type": "function(*)?", - "description": " Returns the function having a given name and arity, if there is one." - }, - "http://www.w3.org/2005/xpath-functions#function-name#1": { - "name": "function-name", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#function-name#1", - "params": [ - "$func as function(*)" - ], - "type": "xs:QName?", - "description": " Returns the name of the function identified by a function item." - }, - "http://www.w3.org/2005/xpath-functions#function-arity#1": { - "name": "function-arity", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#function-arity#1", - "params": [ - "$func as function(*)" - ], - "type": "xs:integer", - "description": " Returns the arity of the function identified by a function item." - }, - "http://www.w3.org/2005/xpath-functions#for-each#2": { - "name": "for-each", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#for-each#2", - "params": [ - "$seq as item()*", - "$action as function(item()) as item()*" - ], - "type": "item()*", - "description": " Applies the function item $action to every item from the sequence $seq in turn, returning the concatenation of the resulting sequences in order." - }, - "http://www.w3.org/2005/xpath-functions#filter#2": { - "name": "filter", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#filter#2", - "params": [ - "$seq as item()*", - "$f as function(item()) as xs:boolean" - ], - "type": "item()*", - "description": " Returns those items from the sequence $seq for which the supplied function $f returns true." - }, - "http://www.w3.org/2005/xpath-functions#fold-left#3": { - "name": "fold-left", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#fold-left#3", - "params": [ - "$seq as item()*", - "$zero as item()*", - "$f as function(item()*, item()) as item()*" - ], - "type": "item()*", - "description": " Processes the supplied sequence from left to right, applying the supplied function repeatedly to each item in turn, together with an accumulated result value." - }, - "http://www.w3.org/2005/xpath-functions#fold-right#3": { - "name": "fold-right", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#fold-right#3", - "params": [ - "$seq as item()*", - "$zero as item()*", - "$f as function(item(), item()*) as item()*" - ], - "type": "item()*", - "description": " Processes the supplied sequence from right to left, applying the supplied function repeatedly to each item in turn, together with an accumulated result value." - }, - "http://www.w3.org/2005/xpath-functions#for-each-pair#3": { - "name": "for-each-pair", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#for-each-pair#3", - "params": [ - "$seq1 as item()*", - "$seq2 as item()*", - "$action as function(item(), item()) as item()*" - ], - "type": "item()*", - "description": " Applies the function item $action to successive pairs of items taken one from $seq1 and one from $seq2, returning the concatenation of the resulting sequences in order." - }, - "http://www.w3.org/2005/xpath-functions#sort#1": { - "name": "sort", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#sort#1", - "params": [ - "$input as item()*" - ], - "type": "item()*", - "description": " Sorts a supplied sequence, based on the value of a sort key supplied as a function." - }, - "http://www.w3.org/2005/xpath-functions#sort#2": { - "name": "sort", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#sort#2", - "params": [ - "$input as item()*", - "$collation as xs:string?" - ], - "type": "item()*", - "description": " Sorts a supplied sequence, based on the value of a sort key supplied as a function." - }, - "http://www.w3.org/2005/xpath-functions#sort#3": { - "name": "sort", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#sort#3", - "params": [ - "$input as item()*", - "$collation as xs:string?", - "$key as function(item()) as xs:anyAtomicType*" - ], - "type": "item()*", - "description": " Sorts a supplied sequence, based on the value of a sort key supplied as a function." - }, - "http://www.w3.org/2005/xpath-functions#apply#2": { - "name": "apply", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#apply#2", - "params": [ - "$function as function(*)", - "$array as array(*)" - ], - "type": "item()*", - "description": " Makes a dynamic call on a function with an argument list supplied in the form of an array." - }, - "http://www.w3.org/2005/xpath-functions#load-xquery-module#1": { - "name": "load-xquery-module", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#load-xquery-module#1", - "params": [ - "$module-uri as xs:string" - ], - "type": "map(*)", - "description": " Provides access to the public functions and global variables of a dynamically-loaded XQuery library module." - }, - "http://www.w3.org/2005/xpath-functions#load-xquery-module#2": { - "name": "load-xquery-module", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#load-xquery-module#2", - "params": [ - "$module-uri as xs:string", - "$options as map(*)" - ], - "type": "map(*)", - "description": " Provides access to the public functions and global variables of a dynamically-loaded XQuery library module." - }, - "http://www.w3.org/2005/xpath-functions#transform#1": { - "name": "transform", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#transform#1", - "params": [ - "$options as map(*)" - ], - "type": "map(*)", - "description": " Invokes a transformation using a dynamically-loaded XSLT stylesheet." - }, - "http://www.w3.org/2005/xpath-functions#parse-json#1": { - "name": "parse-json", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#parse-json#1", - "params": [ - "$json-text as xs:string?" - ], - "type": "item()?", - "description": " Parses a string supplied in the form of a JSON text, returning the results typically in the form of a map or array." - }, - "http://www.w3.org/2005/xpath-functions#parse-json#2": { - "name": "parse-json", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#parse-json#2", - "params": [ - "$json-text as xs:string?", - "$options as map(*)" - ], - "type": "item()?", - "description": " Parses a string supplied in the form of a JSON text, returning the results typically in the form of a map or array." - }, - "http://www.w3.org/2005/xpath-functions#json-doc#1": { - "name": "json-doc", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#json-doc#1", - "params": [ - "$href as xs:string?" - ], - "type": "item()?", - "description": " Reads an external resource containing JSON, and returns the result of parsing the resource as JSON." - }, - "http://www.w3.org/2005/xpath-functions#json-doc#2": { - "name": "json-doc", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#json-doc#2", - "params": [ - "$href as xs:string?", - "$options as map(*)" - ], - "type": "item()?", - "description": " Reads an external resource containing JSON, and returns the result of parsing the resource as JSON." - }, - "http://www.w3.org/2005/xpath-functions#json-to-xml#1": { - "name": "json-to-xml", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#json-to-xml#1", - "params": [ - "$json-text as xs:string?" - ], - "type": "document-node()?", - "description": " Parses a string supplied in the form of a JSON text, returning the results in the form of an XML document node." - }, - "http://www.w3.org/2005/xpath-functions#json-to-xml#2": { - "name": "json-to-xml", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#json-to-xml#2", - "params": [ - "$json-text as xs:string?", - "$options as map(*)" - ], - "type": "document-node()?", - "description": " Parses a string supplied in the form of a JSON text, returning the results in the form of an XML document node." - }, - "http://www.w3.org/2005/xpath-functions#xml-to-json#1": { - "name": "xml-to-json", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#xml-to-json#1", - "params": [ - "$input as node()?" - ], - "type": "xs:string?", - "description": " Converts an XML tree, whose format corresponds to the XML representation of JSON defined in this specification, into a string conforming to the JSON grammar." - }, - "http://www.w3.org/2005/xpath-functions#xml-to-json#2": { - "name": "xml-to-json", - "uri": "http://www.w3.org/2005/xpath-functions", - "key": "http://www.w3.org/2005/xpath-functions#xml-to-json#2", - "params": [ - "$input as node()?", - "$options as map(*)" - ], - "type": "xs:string?", - "description": " Converts an XML tree, whose format corresponds to the XML representation of JSON defined in this specification, into a string conforming to the JSON grammar." - } - }, - "type": "module", - "override": true - } -} \ No newline at end of file diff --git a/processors.json b/processors.json deleted file mode 100644 index 82dfb6e..0000000 --- a/processors.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "basex-10": { - "modules": [ - "packages/basex-static-namespaces.json", - "packages/xpath-3.1.json", - "packages/basex-10.6.json" - ] - }, - "basex-9": { - "modules": [ - "packages/basex-static-namespaces.json", - "packages/xpath-3.1.json", - "packages/basex-9.7.json" - ] - }, - "": { - "modules": [ ] - } -} \ No newline at end of file diff --git a/scripts/build-packages.js b/scripts/build-packages.js deleted file mode 100644 index 1aff574..0000000 --- a/scripts/build-packages.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; -// generate package json file for each processor from xqm files in dir -var processors = { - 'basex-9': { 'src': 'packages.src/basex-9.7' }, - 'basex-10': { 'src': 'packages.src/basex-10.0' }, - 'xpath-3.1': { 'src': 'packages.src/xpath-3.1' } -}; - -var out = 'packages/'; - -var path = require('path'); -var fs = require('fs'); -var ffs = require('final-fs'); - -var XQLint = require('../lib/xqlint').XQLint; - -var getFiles = function (p) { - p = path.resolve(path.normalize(p)); - var files = []; - if (fs.statSync(p).isFile()) { - files.push(p); - } else { - var list = ffs.readdirRecursiveSync(p, true, p); - list.forEach(function (file) { - if (file.endsWith('.xqm')) { - files.push(file); - } - }); - } - return files; -}; - -// return object with keys of known namespaces and values of the xqdoc -function importMods(files) { - var result = {}; - files.forEach(function (file) { - console.log("processing..", file); - const lintOpts={ styleCheck: false, fileName: file, processor: "" } - var linter = new XQLint(fs.readFileSync(file, 'utf-8'), lintOpts); - var syntaxError = linter.hasSyntaxError(); - if (syntaxError) { - console.log("ERR: ", linter.getMarkers()[0].message); - } else { - const xqdoc = linter.getXQDoc(false); - xqdoc.functions=keyed(xqdoc.functions); - xqdoc.variables=keyed(xqdoc.variables);; - const extras={"type":"module","override": true}; - result[xqdoc.ns] ={...xqdoc,...extras}; - console.log(xqdoc.ns); - // console.log(xqdoc); - } - }); - return result; -}; -function keyed(arr){ - const obj={}; - arr.forEach(f=>obj[f.key]=f); - return obj; -}; - -Object.keys(processors).forEach(function (proc) { - const src = processors[proc].src; - var files = getFiles(src) - var xx = structuredClone(importMods(files)); - console.log(Object.keys(xx)); - fs.writeFileSync(out + proc + ".json", JSON.stringify(xx, undefined, 1)); - -}); diff --git a/scripts/wiki-scrape.xq b/scripts/wiki-scrape.xq deleted file mode 100644 index e2e50e3..0000000 --- a/scripts/wiki-scrape.xq +++ /dev/null @@ -1,33 +0,0 @@ -(:~ - This script creates xqm files, with xqdoc style comments, for each BaseX module by reading - the online module documentation from the BaseX Wiki or an wayback archive of it. - Prior to version 10 releases shipped with etc/xqdoc.zip. - @author Christian Gruen, BaseX Team - Updated for https,wayback compatablity - @author Andy Bunce - - :) -import module namespace xqgen='urn:quodatum:xqdoc/wiki' at 'xqm-from-wiki.xqm'; - -declare variable $SOURCES:=map{ - 'basex-10.0': 'https://docs.basex.org' - -}; -declare variable $KEY := "basex-10.0"; -declare variable $BASE := $SOURCES($KEY); -declare variable $ROOT-DIR := file:base-dir() || '../specs/libs/' || $KEY || "/"; - - -file:create-dir($ROOT-DIR), -let $mods:=xqgen:modules($BASE) -for $url in $mods -let $xml:=xqgen:fetch($url) -let $prefix:=xqgen:prefix($xml) -let $xqdoc:=xqgen:page($xml, $url,$BASE) -let $dest:= $ROOT-DIR || $prefix || '.xqm' -return ( - file:write-text($dest=>trace("Write: "), $xqdoc), - prof:sleep(50) -) - - \ No newline at end of file diff --git a/scripts/xqm-from-wiki-v9.xqm b/scripts/xqm-from-wiki-v9.xqm deleted file mode 100644 index d24ca6e..0000000 --- a/scripts/xqm-from-wiki-v9.xqm +++ /dev/null @@ -1,167 +0,0 @@ -(:~ -Create xquery source modules from BaseX Wiki pages (pre version 10) -@author Andy Bunce -@version 0.1 -:) -module namespace xqgen='urn:quodatum:xqdoc/wiki'; - -(:~ - : Serializes the specified nodes. Normalizes links and newlines. - : @param $nodes nodes to be serialized - : @param $url page url - : @return string - :) -declare function xqgen:serialize( - $nodes as node()*, - $url as xs:string, - $base as xs:string -) as xs:string { - normalize-space(serialize( - $nodes update { - descendant-or-self::a/@href ! ( - if(starts-with(., '/')) then replace value of node . with $base || . else - if(starts-with(., '#')) then replace value of node . with $url || . else () - ), - delete node descendant-or-self::a/@*[name() != 'href'], - delete node descendant-or-self::br/@* - } - )) -}; - -(:~ - : Creates the xqdoc header. - : @param $xml page contents - : @param $url page url - : @return string - :) -declare function xqgen:header( - $xml as node(), - $url as xs:string, - $base as xs:string -) as xs:string { - '(:~ ' || out:nl() || - ' : ' || xqgen:serialize( - $xml//div[@id = 'mw-content-text']/div/p[1]/node(), $url,$base - ) || out:nl() || - ' :' || out:nl() || - ' : @author BaseX Team' || out:nl() || - ' : @see ' || $url || out:nl() || - ' :)' -}; - -(:~ - : Creates namespace declarations. - : @param $uris namespace URIs - : @param $prefixes namespace prefixed - : @return string - :) -declare function xqgen:namespaces( - $uris as xs:string*, - $prefixes as xs:string* -) as xs:string* { - 'module namespace ' || $prefixes[1] || ' = "' || $uris[1] || '";', - for $i in 2 to count($uris) - return 'declare namespace ' || $prefixes[$i] || ' = "' || $uris[$i] || '";', - '' -}; - -(:~ - : Creates an xqdoc section for a function. - : @param $xml page contents - : @param $prefix prefix of error namespace - : @param $url page url - : @return string - :) -declare function xqgen:functions( - $xml as node(), - $prefix as xs:string?, - $url as xs:string, - $base as xs:string -) as xs:string* { - for $table in $xml//table[preceding::h2] - let $summary := $table/tbody/tr[td[1]/b = 'Summary']/td[2]/node() - (: xquery 4:) - for $signature in $table/tbody/tr[td[1]/b = ('Signatures','Signature')]/td[2]/code - let $anns := ( - for $param in tokenize(replace($signature/text(), '^\(|\) .*', ''), ', ') - let $tokens := tokenize($param, ' as ', 'q') - return ' : @param ' || $tokens[1] || ' value of type ' || $tokens[2], - - for $return in replace($signature/text(), '^.* as ', '')[. != 'empty-sequence()'] - return ' : @return value of type ' || $return, - - for $error in $table/tbody/tr[td[1]/b = 'Errors']/td[2]/code - [not(preceding-sibling::node()[1] instance of text())] - (:~ let $code := $error/b ! (contains(., ':') ?? . !! ($prefix || ':' || .)) ~:) - let $code := $error/b ! util:if(contains(., ':') , . ,$prefix || ':' || .) - let $message := ( - let $fs := $error/following-sibling::node() - let $br := ($fs/self::br)[1] - return $fs[empty($br) or . << $br] - ) - return ' : @error ' || $code || ' ' || - replace(xqgen:serialize($message, $url,$base), '^: ', '') - ) - return ( - '(:~ ' || out:nl() || - ' : ' || string-join(xqgen:serialize($summary, $url,$base)) || out:nl() || - (' :' || out:nl() || string-join($anns, out:nl()) || out:nl())[exists($anns)] || - ' :)' || out:nl() || - 'declare function ' || $signature || ' external;' || out:nl() - ) -}; - -(:~ - : Creates an xqdoc page. - : @param $xml page contents - : @param $url page url - : @return string - :) -declare function xqgen:page( - $xml as node(), - $url as xs:string, - $base as xs:string -) as xs:string { - let $uris := $xml//code[starts-with(following-sibling::text()[1], ' namespace')]/text() - let $prefixes := $xml//code[starts-with(following-sibling::text()[1], ' prefix.')]/text() - let $error := ( - for-each-pair($uris, $prefixes, function($uri, $prefix) { - if(contains($uri, 'error')) then $prefix else () - }), - $prefixes[1] - )[1] - return string-join(( - xqgen:header($xml, $url,$base), - xqgen:namespaces($uris, $prefixes), - xqgen:functions($xml, $error, $url,$base) - ), out:nl()) -}; - -declare function xqgen:fetch($url as xs:string) -as document-node(){ - html:parse(fetch:binary(trace($url,"Read: "))) -}; - -(:~ urls for module pages from wiki $base :) -declare function xqgen:modules($base as xs:string) -as xs:string*{ - let $xml := html:parse(fetch:binary($base || '/wiki/Module_Library')) - for $url in $xml//td/a[@title]/@href[ends-with(.,"_Module")] - return resolve-uri($url,$base) -}; - -(:~ module prefix :) -declare function xqgen:prefix($xml as document-node()) -as xs:string{ - $xml//code[starts-with(following-sibling::text()[1], ' prefix.')]/text()=>head() -}; - -(:~ function signatures :) -declare function xqgen:signatures($table as element(table)) -as xs:string+{ - let $sigs:=$table/tbody/tr[td[1]/b = 'Signatures']/td[2]/code - return if($sigs) - then $sigs (: pre basex10 :) - else let $sig:=$table/tbody/tr[td[1]/b = 'Signature']/td[2]/code - return $sig -}; \ No newline at end of file diff --git a/scripts/xqm-from-wiki.xqm b/scripts/xqm-from-wiki.xqm deleted file mode 100644 index 1c1755e..0000000 --- a/scripts/xqm-from-wiki.xqm +++ /dev/null @@ -1,176 +0,0 @@ -(:~ -Create xquery source modules from Wki pages v10+ -@author Andy Bunce -@version 0.2 -:) -module namespace xqgen='urn:quodatum:xqdoc/wiki'; -import module namespace string='http://basex.org/modules/string'; -import module namespace util='http://basex.org/modules/util'; -(:~ - : Serializes the specified nodes. Normalizes links and newlines. - : @param $nodes nodes to be serialized - : @param $url page url - : @return string - :) -declare function xqgen:serialize( - $nodes as node()*, - $url as xs:string, - $base as xs:string -) as xs:string { - normalize-space(serialize( - $nodes update { - descendant-or-self::a/@href ! ( - if(starts-with(., '/')) then replace value of node . with $base || . else - if(starts-with(., '#')) then replace value of node . with $url || . else () - ), - delete node descendant-or-self::a/@*[name() != 'href'], - delete node descendant-or-self::br/@* - } - )) -}; - -(:~ - : Creates the xqdoc header. - : @param $xml page contents - : @param $url page url - : @return string - :) -declare function xqgen:header( - $xml as node(), - $url as xs:string, - $base as xs:string -) as xs:string { - '(:~ ' ||string:nl() || - ' : ' || xqgen:serialize( - $xml//div[@id = 'mw-content-text']/div/p[1]/node(), $url,$base - ) ||string:nl() || - ' :' ||string:nl() || - ' : @author quodatum/xqlint ' || current-dateTime() ||string:nl() || - ' : @see ' || $url ||string:nl() || - ' :)' -}; - -(:~ - : Creates namespace declarations. - : @param $uris namespace URIs - : @param $prefixes namespace prefixed - : @return string - :) -declare function xqgen:namespaces( - $uris as xs:string*, - $prefixes as xs:string* -) as xs:string* { - 'module namespace ' || $prefixes[1] || ' = "' || $uris[1] || '";', - for $i in 2 to count($uris) - return 'declare namespace ' || $prefixes[$i] || ' = "' || $uris[$i] || '";', - '' -}; - -(:~ - : Creates an xqdoc section for a function. - : @param $xml page contents - : @param $prefix prefix of error namespace - : @param $url page url - : @return string - :) -declare function xqgen:functions( - $xml as node(), - $prefix as xs:string?, - $url as xs:string, - $base as xs:string -) as xs:string* { - for $table in $xml//table[preceding::h2][tbody/tr/td[1]/b='Signature'] - let $summary := $table/tbody/tr[td[1]/b = 'Summary']/td[2]/node() - (: xquery 4 style :) - for $signature in xqgen:signatures($table) - let $anns := ( - for $param in tokenize(replace($signature, '^\(|\) .*', ''), ', ') - let $tokens := tokenize($param, ' as ', 'q') - return ' : @param ' || $tokens[1] || ' value of type ' || $tokens[2], - - for $return in replace($signature, '^.* as ', '')[. != 'empty-sequence()'] - return ' : @return value of type ' || $return, - - for $error in $table/tbody/tr[td[1]/b = 'Errors']/td[2]/code - [not(preceding-sibling::node()[1] instance of text())] - (:~ let $code := $error/b ! (contains(., ':') ?? . !! ($prefix || ':' || .)) ~:) - let $code := $error/b ! util:if(contains(., ':') , . ,$prefix || ':' || .) - let $message := ( - let $fs := $error/following-sibling::node() - let $br := ($fs/self::br)[1] - return $fs[empty($br) or . << $br] - ) - return ' : @error ' || $code || ' ' || - replace(xqgen:serialize($message, $url,$base), '^: ', '') - ) - return ( - '(:~ ' ||string:nl() || - ' : ' || string-join(xqgen:serialize($summary, $url,$base)) ||string:nl() || - (' :' ||string:nl() || string-join($anns,string:nl()) ||string:nl())[exists($anns)] || - ' :)' ||string:nl() || - 'declare function ' || $signature || ' external;' ||string:nl() - ) -}; - -(:~ - : Creates an xqdoc page. - : @param $xml page contents - : @param $url page url - : @return string - :) -declare function xqgen:page( - $xml as node(), - $url as xs:string, - $base as xs:string -) as xs:string { - let $uris := $xml//code[starts-with(following-sibling::text()[1], ' namespace')]/text() - let $prefixes := $xml//code[starts-with(following-sibling::text()[1], ' prefix.')]/text() - let $error := ( - for-each-pair($uris, $prefixes, function($uri, $prefix) { - if(contains($uri, 'error')) then $prefix else () - }), - $prefixes[1] - )[1] - return string-join(( - xqgen:header($xml, $url,$base), - xqgen:namespaces($uris, $prefixes), - xqgen:functions($xml, $error, $url,$base) - ),string:nl()) -}; - -declare function xqgen:fetch($url as xs:string) -as document-node(){ - html:parse(fetch:binary(trace($url,"Read: "))) -}; - -(:~ urls for module pages from wiki $base :) -declare function xqgen:modules($base as xs:string) -as xs:string*{ - let $xml := html:parse(fetch:binary($base || '/wiki/Module_Library')) - for $url in $xml//td/a[@title]/@href[ends-with(.,"_Module")] - return resolve-uri($url,$base) -}; - -(:~ module prefix :) -declare function xqgen:prefix($xml as document-node()) -as xs:string{ - $xml//code[starts-with(following-sibling::text()[1], ' prefix.')]/text()=>head() -}; - -(:~ function signatures :) -declare function xqgen:signatures($table as element(table)) -as xs:string+{ - let $sigs:=$table/tbody/tr[td[1]/b = 'Signatures']/td[2]/code - return if($sigs) - then $sigs (: pre basex10 :) - else let $sig:=$table/tbody/tr/td[preceding-sibling::td[1]/b = 'Signature']/string() - let $sig:=replace($sig," "," ") - let $type:= replace($sig,"(.* as )(.*)","$2") - let $name:= substring-before($sig,"(") - let $args:=substring($sig,2+string-length($name),string-length($sig)-string-length($type)-string-length($name)-6) - let $args:=tokenize($args,",") - let $req:=$args!util:if(contains(.,":="),0,1)=>sum() - for $i in 0 to count($args)-$req - let $a:=subsequence($args,1,$i+$req)!normalize-space(substring-before(. ||":=",":=")) - return ``[ `{ $name}`(`{ string-join($a,', ') }`) as `{ $type }`]`` -}; \ No newline at end of file diff --git a/test/features/completer.js b/test/features/completer.js index 26ab8e2..d22c1d2 100644 --- a/test/features/completer.js +++ b/test/features/completer.js @@ -1,5 +1,7 @@ // info about static context at a point in the source +"use strict"; var fs = require('fs'); +var assert = require('assert'); var StaticContext = require('../../lib/compiler/static_context').StaticContext; var XQLint = require('../../lib/xqlint').XQLint; var source = 'import module namespace ns="http://expath.org/ns/http-client"; ns:'; diff --git a/test/features/linter-text.js b/test/features/linter-text.js index f0a9a7e..4bf943e 100644 --- a/test/features/linter-text.js +++ b/test/features/linter-text.js @@ -2,8 +2,8 @@ const txt='declare function local:foo($ex:foo as xs:integer) as xs:integer { $ex:foo }; local:foo(1)'; const opts = { - processor: 'basex-10' - , styleCheck: false + processor: 'basex-10', + styleCheck: false }; var XQLint = require('../../lib/xqlint').XQLint; var linter = new XQLint(txt,opts); diff --git a/test/features/linter.js b/test/features/linter.js index f59ede2..0858d13 100644 --- a/test/features/linter.js +++ b/test/features/linter.js @@ -4,8 +4,8 @@ var fs = require('fs'); var XQLint = require('../../lib/xqlint').XQLint; var file = "test/queries/rbtree.xq/map.xq"; const opts = { - processor: 'basex-9' - , styleCheck: false + processor: 'basex-9', + styleCheck: false }; var linter = new XQLint(fs.readFileSync( file, 'utf-8'),opts); var markers = linter.getErrors(); diff --git a/test/issue_test.js b/test/issue_test.js index d938f33..de5e4f7 100644 --- a/test/issue_test.js +++ b/test/issue_test.js @@ -1,4 +1,4 @@ - +"use strict"; var vows = require('vows'); var assert = require('assert'); var path = require('path'); @@ -37,8 +37,8 @@ vows.describe('Test reported issues').addBatch({ const ast = linter.getAST(); const formatter = new CodeFormatter(ast); const formatted = formatter.format().trim(); - var linter = new XQLint(formatted, { styleCheck: false }); - var markers = linter.getErrors(); + var linter2 = new XQLint(formatted, { styleCheck: false }); + var markers = linter2.getErrors(); console.log(markers); assert.equal(markers.length, 0); }, diff --git a/test/variable_test.js b/test/variable_test.js index 3f96b1c..6139b8e 100644 --- a/test/variable_test.js +++ b/test/variable_test.js @@ -51,7 +51,7 @@ vows.describe('Test Variable declarations').addBatch({ 'XPST0081 (7)': function(){ var linter = new XQLint('declare namespace ex = "http://example.com"; declare function local:foo($ex:foo as xs:integer) as xs:integer { $ex:foo }; local:foo(1)'); var markers = linter.getErrors(); - console.log('test7',markers); + //console.log('test7',markers); assert.equal(markers.length, 0, 'Number of markers'); },