marklogic_coder
marklogic_coder

Reputation: 1510

Call java function using XQuery in MarkLogic

Is it possible to call java function using XQuery in MarkLogic. ?

Please refer - https://stackoverflow.com/questions/65953901/calling-java-method-from-xquery

Example -

declare namespace math="java:java.lang.Math";
math:sqrt(2)

Upvotes: 2

Views: 116

Answers (1)

Dave Cassel
Dave Cassel

Reputation: 8422

There's no way to directly call a Java function from MarkLogic XQuery. If the Java code is accessible through a web service, you can use xdmp:http-get and similar.

As noted by Martin, depending on what functionality you're trying to access, you might not need to use Java.

Upvotes: 1

Related Questions