You can do this (and I do frequently) with the MarkLogic extension to
xmlsh.
http://www.xmlsh.org/ModuleMarkLogic

But it does take the 2 lines. But since this is a scripting language
they could trivially be scripted into arguments to a script.

Example from actual code I use in production:


ml:query -q <{{
import module namespace  spl    =
"http://epocrates.com/marklogic/modules/spl";   at "/modules/spl.xquery"
;
declare variable $uri as xs:string external;
spl:product-from-uri( $uri )
}}> -v uri $uri





----------------------------------------
David A. Lee
Senior Principal Software Engineer
Epocrates, Inc.
[email protected]
812-482-5224

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Eric Bloch
Sent: Monday, March 07, 2011 11:27 AM
To: Clark Richey; General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Reg: xcc API methods for XDBC
connection

Yup... and although I haven't had the cycles to get to it... I've wanted
to re-work that bit :)

-Eric

________________________________________
From: Clark Richey
Sent: Monday, March 07, 2011 8:15 AM
To: General MarkLogic Developer Discussion; Eric Bloch
Subject: Re: [MarkLogic Dev General] Reg: xcc API methods for XDBC
connection

Sort of except that ActiveDocument actually generates Xquery that ends
up
being executed by a single main module on the server via an eval()

----
Clark D. Richey, Jr.
Principal Technologist, Federal
Mark Logic Corporation
7950 Jones Branch Drive
McLean, VA 22102
Phone: 240 - CLARK - 07
            (240 - 252 - 7507)


[email protected] <x-msg://25/[email protected]>


www.marklogic.com <http://www.marklogic.com/>
This e-mail and any accompanying attachments are confidential. The
information is intended solely for the use of the individual to whom it
is
addressed. Any review, disclosure, copying, distribution, or use of this
e-mail communication by others is strictly prohibited. If you are not
the
intended recipient, please notify us immediately by returning this
message
to the sender and delete all copies.  Thank you for your cooperation.












On 3/7/11 11:11 AM, "Eric Bloch" <[email protected]> wrote:

>At a certain-level, this is similar to what Clark's
>http://developer.marklogic.com/code/active-document project does but
from
>a Ruby client.
>
>-Eric
>
>________________________________________
>From: [email protected]
>[[email protected]] On Behalf Of John Snelson
>[[email protected]]
>Sent: Monday, March 07, 2011 2:46 AM
>To: [email protected]
>Subject: Re: [MarkLogic Dev General] Reg: xcc API methods for XDBC
>connection
>
>On 03/03/11 16:12, Eric Bloch wrote:
>> What would keep one from building up a Java library on top of XCC
that
>>does what is being asked for?
>
>That would be simple enough by building up simple XQuery main modules
to
>eval, ie:
>
>import module namespace my = "URI" at "LOCATION";
>my:FUNCTION_NAME($a, $b, $c)
>
>Fill in the blanks, set the correct external variables, and fire off an
>eval request.
>
>John
>
>--
>John Snelson, Senior Engineer                  http://twitter.com/jpcs
>MarkLogic Corporation                         http://www.marklogic.com
>_______________________________________________
>General mailing list
>[email protected]
>http://developer.marklogic.com/mailman/listinfo/general
>_______________________________________________
>General mailing list
>[email protected]
>http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[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