4

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.

adamretter
  • 3,885
  • 2
  • 23
  • 43
DevNinja
  • 1,459
  • 7
  • 10

1 Answers1

1

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.

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
  • Thx @Mads Hansen... Now it is Working and I am getting auto-completion as well but after adding Modules to Project Structure when i click Apply and Ok I am getting Error Msg saying "Unable to save settings: Failed to save settings. Please restart IntelliJ IDEA" – DevNinja Jul 10 '18 at 11:54