marklogic_coder
marklogic_coder

Reputation: 1510

Unable to Use functx library with intellij idea community edition

I am trying to import functx library using following import statement but i am not able to import it to my .xqy file in intellij idea community edition - 2018.1

    xquery version "1.0-ml";
    import module namespace functx = "http://www.functx.com" at "/MarkLogic/functx/functx-1.0-nodoc-2007-01.xqy";

    functx:get-matches(
       'abc123def', '[a-z]{2}')

I am getting this error saying - cannot resolve function 'functx:get-matches'

Please help me to resolve this issue.

Upvotes: 4

Views: 360

Answers (1)

Mads Hansen
Mads Hansen

Reputation: 66783

In order for it to resolve the functx library module you need to add the path to the Modules directory of your MarkLogic installation to your project.

  • Go to File -> Project Structure (Ctrl+Alt+Shift+S)
  • Select Modules
  • Click + Add Content Root
  • Browse to your MarkLogic installation and select the Modules directory (i.e. C:\Program Files\MarkLogic\Modules)

Now, it should resolve the methods, allow you to ctrl click to jump to the function in the functx module, and will provide auto-completion for functx functions as you type.

Upvotes: 1

Related Questions