marklogic - How to get the current working directory in Xquery? -


im writing xquery script need passing absolute path argument, script work if put project on port root, if shift sub-directory v2,v3 ... not work.

relative path work perfect if called function within project root, called function 1 of marklogic library search:search. have pass absolute path it.

this status make code less dynamic, while solution find function give me current working directory can build absolute path dynamically.

i found module library called "file module" in following link:

http://expath.org/spec/file#pr.current-dir

is there function in marklogic me in issue, or support library?. if none of options available can give me work around solution other define global variable handle changes in absolute path?

example:

<constraint name="title">             <custom facet="true">                 <parse apply="parse-facet-thesourous"                        ns="......"                        at="/utilites/custom-constrains.xqy"/>                     .....             </custom> </constraint>  

this snap shot of options. part passing absolute path of custom-constrains file search:search. if put project on weberver port root www.test.com:8050 every thing work fine, if move project inside sub directory www.test.com:8050/v1 link in option should /v1/utilites/custom-constrains.xqy

on other hand making path relative useless since path passed external marklogic module.

but if can in way current working directory absolute path or uri of current running script, can build absolute path dynamically

i believe xdmp:function-module might of use you're attempting.

clay


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -