Hi Randy,

XQuery is not designed to mingle with foreign languages. MarkLogic Server does 
support some support for such interaction, but not with JS. You can invoke XSLT 
from XQuery, and there are modules that use xdmp:http-get and related to do 
some background processing in Java (MLJAM), or accessing of relational 
databases (MLSQL), to name a few..

Is it an option to execute your js code from within Java, and use MLJAM to 
access it from MarkLogic Server?

Kind regards,
Geert

-----Oorspronkelijk bericht-----
Van: [email protected] 
[mailto:[email protected]] Namens Randy Smith
Verzonden: vrijdag 17 juni 2011 19:05
Aan: General MarkLogic Developer Discussion
Onderwerp: [MarkLogic Dev General] Calling Javascript from Xquery

Basic question here for something new to me:

I have an app that is intended to:

     - Do an xquery in an .xqy app, grab part of the result, then send 
the result part to a .js module, to eventually be sent to an Excel 
spreadsheet using the MarkLogic plug-ins.

- When I get the results back (while in the .xqy function)  I'm trying 
to call a .js module e.g. "reportexcel(facet-items)"  (or whatever might 
work) to send the result string or numbers to the .js module. This is 
new to me so no success yet.

Any short examples, general pointers, and/or cautions etc... would be 
helpful. Like, do I have to declare the .js module in the .xqy file, etc...
Thank,
Randy

_______________________________________________
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