StaticFunc expression: no updating expression allowed with db:add()

Wednesday, 25 June 2014 · 2 messages
DS
Daum, Simon25 Jun 2014 20:30 #
Hi there, I have a question about the db:add() function if it is included in a xquery function which is installed as module in the repo. As I set up this function in a module
declare function cms:addToDb($dbName as xs:string, $rootNodeAndFileName as xs:string, $content)
{
                db:add($dbName,  concat('<',$rootNodeAndFileName, '>', $content ,'</',$rootNodeAndFileName, '>'),  concat($rootNodeAndFileName, ".xml"))
};
And call it from the GUI app I get: [XUST0001] StaticFunc expression: no updating expression allowed. The error code say something about granting permissions but also states that "Permissions are only relevant in the client/server architecture: the Standalone Mode<http://docs.basex.org/wiki/Standalone_Mode> and the GUI<http://docs.basex.org/wiki/GUI> is run with admin permissions." Any tip from the BaseX'ers? Regards Simon - - - - - - - - - Dipl.-Ing. Simon Daum Lehrstuhl für Computergestützte Modellierung und Simulation Technische Universität München Arcisstraße 21 D-80290 München Tel: +49 89 289 25065 Fax: +49 89 289 25051 Web: www.cms.bv.tum.de<http://www.cms.bv.tum.de> - - - - - - - - -
AG
Arve Gengelbach25 Jun 2014 22:42 #
Hi, How about adding a %updating to the function’s annotation:
declare %updating function cmd:adToDb(...) {...}
Hope this helps, Arve
Quoted text · Simon · 35 lines
On 25 Jun 2014, at 20:30, Daum, Simon <simon.daum at tum.de> wrote: > Hi there, > > I have a question about the db:add() function if it is included in a xquery function which is installed as module in the repo. > > As I set up this function in a module > > declare function cms:addToDb($dbName as xs:string, $rootNodeAndFileName as xs:string, $content) > { > db:add($dbName, concat('<',$rootNodeAndFileName, '>', $content ,'</',$rootNodeAndFileName, '>'), concat($rootNodeAndFileName, ".xml")) > }; > > > And call it from the GUI app I get: > [XUST0001] StaticFunc expression: no updating expression allowed. > > The error code say something about granting permissions but also states that “Permissions are only relevant in the client/server architecture: the Standalone Mode and the GUI is run with admin permissions.” > Any tip from the BaseX’ers? > > Regards Simon > > > - - - - - - - - - > > Dipl.-Ing. Simon Daum > Lehrstuhl für Computergestützte Modellierung und Simulation > Technische Universität München > Arcisstraße 21 > D-80290 München > > Tel: +49 89 289 25065 > Fax: +49 89 289 25051 > Web: www.cms.bv.tum.de > > - - - - - - - - -

⚡Generated with XQuery