dba/queries
library moduleRA
Summary
Open query.
- Authors
- Christian Grün, BaseX Team 2005-23, BSD License
Imports
This module is imported by 0 modules. It imports 1 modules.
Variables
None
Functions
4.1 dba:query-open
Arities: #1RA
dba:query-open
(
$name
as
xs:string
) as
xs:string
- name
as
xs:string
name of query file
xs:string
query string
Invoked by 0 functions from 0 modules
Annotations (3)
%rest:path | ('/dba/query-open') |
%rest:query-param | ('name','{$name}') |
%output:method | ('text') |
Source ( 6 lines)
function dba:query-open(
$name as xs:string
) as xs:string {
config:query($name),
file:read-text(config:directory() || $name)
}
Namespaces
The following namespaces are defined:
Prefix | Uri |
---|---|
config | dba/config |
dba | dba/queries 2 3 4 5 |
file | http://expath.org/ns/file |
output | http://www.w3.org/2010/xslt-xquery-serialization |
rest | http://exquery.org/ns/restxq |
xs | http://www.w3.org/2001/XMLSchema |
Source Code
(:~
: Open query.
:
: @author Christian Grün, BaseX Team 2005-23, BSD License
:)
module namespace dba = 'dba/queries';
import module namespace config = 'dba/config' at '../lib/config.xqm';
(:~
: Returns the contents of a query file.
: @param $name name of query file
: @return query string
:)
declare
%rest:path('/dba/query-open')
%rest:query-param('name', '{$name}')
%output:method('text')
function dba:query-open(
$name as xs:string
) as xs:string {
config:query($name),
file:read-text(config:directory() || $name)
};