Deekshant
Deekshant

Reputation: 127

Alternative of xdmp:functions() in MarkLogic 5.0?

Is there any API to get all in-scope functions in MarkLogic 5.0?

Upvotes: 1

Views: 80

Answers (2)

legspeleo
legspeleo

Reputation: 87

can you not query the docs?

xquery version "1.0-ml";

declare namespace xhtml="http://www.w3.org/1999/xhtml";

let $doc := xdmp:http-get("https://docs.marklogic.com/5.0/all",
    <options xmlns="xdmp:http-get">
       <format xmlns="xdmp:document-get">xml</format>
    </options>)[2]

let $table := $doc/node()//xhtml:table[@class="api_table"]

return $table//xhtml:td/xhtml:a/fn:string(.)

Upvotes: 0

mblakele
mblakele

Reputation: 7840

As mentioned there is no direct API in ML5. I would discourage a regex approach: XQuery needs to be parsed. But a debugger-based approach could work. Take a look at https://github.com/robwhitby/xray/blob/coverage/src/coverage.xqy for some ideas.

Upvotes: 1

Related Questions