Loading Configuration from Files

dscape edited this page Mar 3, 2011 · 1 revision

Loading Configuration from Files

If you want to save your routing & path configuration in a file you can use the xdmp:document-get function to retrieve the file:

 xquery version "1.0-ml" ;
 
 import module namespace r = "routes.xqy" at "/lib/routes.xqy" ;
 
 declare function local:documentGet( $path ) { 
   xdmp:document-get( fn:concat( xdmp:modules-root(), $path ) ) } ;
 
 declare variable $routesCfg := local:documentGet( "config/routes.xml" ) ;
 
 r:selectedRoute( $routesCfg )