dba/queries  library module
RA

Summary

Open query.
Tags

Author: Christian Grün, BaseX Team 2005-21, BSD License

__source : queries/query-open.xqm

Related documents
ViewDescriptionFormat
xqdocxqDoc xml file from the source modulexml
xqparsexqparse xml file from the source modulexml

Imports

This module is imported by 0 modules. It imports 1 modules.

(None)
imports
this
imports

Variables

None

Functions

4.1 dba:query-open

Arities: dba:query-open#1RA

Summary
Returns the contents of a query file.
Signature
dba:query-open ( $name as xs:string )  as xs:string
Parameters
  • name as xs:string name of query file
Return
  • xs:stringquery string
Invokes 3 functions from 2 modules
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:

    PrefixUri
    configdba/config
    dbadba/queries 2 3 4 5
    outputhttp://www.w3.org/2010/xslt-xquery-serialization
    resthttp://exquery.org/ns/restxq

    6 RestXQ

    Paths defined 1.

    PathMethodFunction
    /dba/query-opendba:query-open#1

    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)
    };