Thats a little tougher ... I dont know of a tool that can parse the XQuery to 
determine its declared external variables.
Stylus Studio can do this for on-filesystem (not marklogic) XQuery ...
Its quite nice that way ... but unfortunately SS dropped MarkLogic support 
about 5 years ago :(
Oxygen might be able to ... but I havent run into it.

-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
[email protected]
Phone: +1 812-482-5224
Cell:  +1 812-630-7622
www.marklogic.com<http://www.marklogic.com/>


From: [email protected] 
[mailto:[email protected]] On Behalf Of Danny Sinang
Sent: Wednesday, September 05, 2012 12:25 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Xquery invoker

Hi David,

This is indeed easier than calling xdmp:invoke() in CQ, but I was hoping to 
also save myself the effort of finding out what variables a script accepts and 
typing in the variable name.

Regards,
Danny

On Wed, Sep 5, 2012 at 12:10 PM, David Lee 
<[email protected]<mailto:[email protected]>> wrote:
You might look at the marklogic extension to xmlsh.
Its not a web app but a terminal app (but it also has a GUI now).
This allows you to invoke stored xqueries easily using "invoke"

e.g.
import module ml=marklogic
...

ml:invoke test.xqy

Let me know if you would like further info

http://www.xmlsh.org/MarkLogicInvoke
http://www.xmlsh.org/HomePage
http://www.xmlsh.org/ModuleMarkLogic

-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
[email protected]<mailto:[email protected]>
Phone: +1 812-482-5224<tel:%2B1%20812-482-5224>
Cell:  +1 812-630-7622<tel:%2B1%20812-630-7622>
www.marklogic.com<http://www.marklogic.com/>

From: 
[email protected]<mailto:[email protected]>
 
[mailto:[email protected]<mailto:[email protected]>]
 On Behalf Of Danny Sinang
Sent: Wednesday, September 05, 2012 11:56 AM
To: general
Subject: [MarkLogic Dev General] Xquery invoker

Hi,

I find myself having to call xdmp:invoke() via CQ and entering the .xqy path 
and its parameters is tedious.

Am thinking of writing a web app that would list all .xqy files in a given 
folder. Once the user has chosen a .xqy file, the web app will then display a 
label + text input field for each parameter that the said .xqy file accepts.

But before I dive in, a few questions :

1. Is there already a tool like this (why reinvent the wheel) ?

2. Is there an Xquery parser out there that will readily tell me what 
parameters a given xqy file accepts ?

    I saw some mention of XQYSP. I guess I can look for "literal" elements with 
the value "declare" and "variable" and then look for the next literal to get 
the name of the variable. Would this be the best way to go about it ?

Regards,
Danny





_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to