dba/queries
library moduleRA
Summary
Open query.
- Tags
Author: Christian Grün, BaseX Team 2005-21, BSD License
__source : queries/query-open.xqm
Imports
This module is imported by 0 modules. It imports 1 modules.
Variables
None
Functions
4.1 dba:query-open
Arities: dba:query-open#1RA
dba:query-open
(
$name
as
xs:string
)
as
xs:string
- name
as
xs:string
name of query file
xs:string
query string
Invokes 3 functions from 2 modules
- config:directory#0
- config:query#1
- {http://expath.org/ns/file}read-text#1
Invoked by 0 functions from 0 modules
Annotations
%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 |
output | http://www.w3.org/2010/xslt-xquery-serialization |
rest | http://exquery.org/ns/restxq |
Source Code
(:~
: Open query.
:
: @author Christian Grün, BaseX Team 2005-21, 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)
};