Hi Keith,

You can make that even shorter by using:

resolve-uri(".", xdmp:get-request-path())

;-)

Kind regards,
Geert 

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Keith L. Breinholt
> Sent: vrijdag 12 februari 2010 21:22
> To: General Mark Logic Developer Discussion
> Subject: RE: [MarkLogic Dev General] Getting directory of 
> current module...
> 
> I need the path relative to the current execution context.  
> So xdmp:get-request-path() will get me most of what I need.
> 
>  
> 
> The code to get the directory of the module would then be:
> 
>  
> 
> import module namespace util = 
> "http://marklogic.com/xdmp/utilities"; at 
> "/MarkLogic/utilities.xqy"; util:basepath( xdmp:get-request-path() )
> 
>  
> 
> Thanks Luke. Thanks Geert.
> 
>  
> 
> Keith L. Breinholt
> 
> [email protected] <mailto:[email protected]> 
> 
>  
> 
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Geert Josten
> Sent: Friday, February 12, 2010 12:19 PM
> To: General Mark Logic Developer Discussion
> Subject: RE: [MarkLogic Dev General] Getting directory of 
> current module...
> 
>  
> 
> Keith,
> 
>  
> 
> Append xdmp:get-request-path() to the function suggested by 
> Luke, and you have the full path of the xquery being 
> executed. Mind though that if you are running modules from 
> filesystem, you get a full system path.
> 
>  
> 
> Just out of curiosity, how were you intending to use these 
> paths in templates?
> 
>  
> 
> Kind regards,
> 
> Geert
> 
>        
> 
>  
> 
>  
> 
> drs. G.P.H. (Geert) Josten
> 
> Consultant
> 
>  
> 
> 
> 
>  
> 
> Daidalos BV
> 
> Hoekeindsehof 1-4
> 2665 JZ Bleiswijk
> 
> T +31 (0)10 850 1200
> F +31 (0)10 850 1199
> 
>  
> 
> [email protected] <mailto:[email protected]> 
> 
> www.daidalos.nl <http://www.daidalos.nl/> 
> 
>  
> 
> KvK 27164984
> 
>  
> 
> P Please consider the environment before printing this mail.
> 
> De informatie - verzonden in of met dit e-mailbericht - is 
> afkomstig van Daidalos BV en is uitsluitend bestemd voor de 
> geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, 
> verzoeken wij u het te verwijderen. Aan dit bericht kunnen 
> geen rechten worden ontleend.
> 
>       From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Luke Galloway
>       Sent: vrijdag 12 februari 2010 20:14
>       To: General Mark Logic Developer Discussion
>       Subject: Re: [MarkLogic Dev General] Getting directory 
> of current module...
> 
>       I'll take a stab at this.  
>       
>       xdmp:modules-root 
> <http://developer.marklogic.com/pubs/3.2/apidocs/Extension.htm
> l#modules-root> 
> 
> xdmp:modules-root( ) as xs:string 
> 
>  
> <http://developer.marklogic.com/pubs/3.2/apidocs/images/varspace.gif> 
> 
>  
> <http://developer.marklogic.com/pubs/3.2/apidocs/images/varspa
> ce.gif> Summary: 
> 
> 
> Returns the current root path for modules. 
> 
>  
> <http://developer.marklogic.com/pubs/3.2/apidocs/images/varspa
> ce.gif> Example: 
> 
>   xdmp:modules-root()
> 
>    => Docs
> 
>       
>       
>       Luke
>       
>       
>       
>       
>       
> 
>       On Fri, Feb 12, 2010 at 12:01 PM, Keith L. Breinholt 
> <[email protected]> wrote:
> 
>       Is there a simple way to the current module directory 
> form within XQuery?
> 
>        
> 
>       This would be useful in writing templates or generic 
> header and footer files.
> 
>        
> 
>       Thanks,
> 
>        
> 
>       Keith L. Breinholt
> 
>       Missionary & Public Affairs Portfolio
> 
>       [email protected]
> 
>       "Do what you can, with what you have, where you are." 
> Theodore Roosevelt
> 
>        
> 
>       
>       
>       NOTICE: This email message is for the sole use of the 
> intended recipient(s) and may contain confidential and 
> privileged information. Any unauthorized review, use, 
> disclosure or distribution is prohibited. If you are not the 
> intended recipient, please contact the sender by reply email 
> and destroy all copies of the original message.
> 
>        
> 
>       
>       _______________________________________________
>       General mailing list
>       [email protected]
>       http://xqzone.com/mailman/listinfo/general
> 
>        
> 
>       
> 
>  
> 
> _______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to