REST service : How to run server side query with params?

Sunday, 17 June 2012 · 5 messages
DK
Dirk Kirstenin reply to Anupam Bakshi, 17 Jun 2012, 21:0817 Jun 2012 20:07 #
Hello Anupam, You can use the operation RUN, see [1]. It will execute the file within your HTTPPATH. Variable binding is possible as well. cheers, Dirk [1] http://docs.basex.org/wiki/REST#Operations
Quoted text · Anupam Bakshi · 22 lines
On 06/17/2012 07:08 PM, Anupam Bakshi wrote: > Hello, > I understand that one way to run a rest based XQuery with parameters is > to use the following ... > |http://localhost:8984/rest/DB/mult.xq?a=21&b=2 > <http://localhost:8984/rest/DB/mult.xq?a=21&b=2>| > > This is possible if the query is in the BaseX database. > > I need to use REST, but the query file (.xq) and .xqm, .xsl files need > to be located on the server but not in the database. > > Can someone give me a pointer about how to do that? > > Thanks, > Anupam > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
CG
Christian Grünin reply to Anupam Bakshi, 17 Jun 2012, 22:3717 Jun 2012 20:52 #
Hi Anupam, thanks Dirk,
Quoted text · Anupam Bakshi · 2 lines
> Any idea where to put the .xqm and .xsl files? I'm using them in the query. > Can I simply put them in the HTTPPATH dir as well?
Just try.. It should work as expected, at least with XQuery. Note that BaseX has no native support for XSLT. Christian
AB
Anupam Bakshi17 Jun 2012 21:08 #
Hello, I understand that one way to run a rest based XQuery with parameters is to use the following ... http://localhost:8984/rest/DB/mult.xq?a=21&b=2 This is possible if the query is in the BaseX database. I need to use REST, but the query file (.xq) and .xqm, .xsl files need to be located on the server but not in the database. Can someone give me a pointer about how to do that? Thanks, Anupam
AB
Anupam Bakshi17 Jun 2012 22:37 #
Thanks Dirk for the pointer. Any idea where to put the .xqm and .xsl files? I'm using them in the query. Can I simply put them in the HTTPPATH dir as well? Thanks, Anupam ________________________________ From: Anupam Bakshi <bakshia at yahoo.com> To: "basex-talk at mailman.uni-konstanz.de" <basex-talk at mailman.uni-konstanz.de> Sent: Sunday, June 17, 2012 1:08 PM Subject: REST service : How to run server side query with params? Hello, I understand that one way to run a rest based XQuery with parameters is to use the following ... http://localhost:8984/rest/DB/mult.xq?a=21&b=2 This is possible if the query is in the BaseX database. I need to use REST, but the query file (.xq) and .xqm, .xsl files need to be located on the server but not in the database. Can someone give me a pointer about how to do that? Thanks, Anupam
AB
Anupam Bakshiin reply to Christian Grün, 17 Jun 2012, 20:5217 Jun 2012 23:08 #
Yes indeed it works! For XSLT 2.0 I had to add saxon9.jar to the webapps\BaseX721\WEB-INF\lib directory. Thanks once again to Christian and Dirk. Best regards, Anupam ________________________________ From: Christian Grün <christian.gruen at gmail.com> To: Anupam Bakshi <bakshia at yahoo.com> Cc: "basex-talk at mailman.uni-konstanz.de" <basex-talk at mailman.uni-konstanz.de> Sent: Sunday, June 17, 2012 2:52 PM Subject: Re: [basex-talk] REST service : How to run server side query with params? Hi Anupam, thanks Dirk,
Quoted text · Christian Grün · 2 lines
> Any idea where to put the .xqm and .xsl files? I'm using them in the query. > Can I simply put them in the HTTPPATH dir as well?
Just try.. It should work as expected, at least with XQuery. Note that BaseX has no native support for XSLT. Christian

⚡Generated with XQuery