How can I feed an Xquery module with a global variable from main script?

wakslamulk

New Member
Currently I am feeding the name of 2 databases to my main xql file through an external variable. I would like to pass these values to any of my XQL modules.For example, I could have a main script importing module "mylib"\[code\] import module namespace mylib = "http://example.org/mylib" at "myLib.xqm"; declare variable $dbName external; $mylib:print()\[/code\]Then I feed main script with dbName external variable, and it works, but I would like to pass it someway to my module\[code\] module namespace mylib = "http://example.org/mylib"; declare variable $mylib:dbName external; declare function mymod:print() as xs:string { $mymod:dbName };\[/code\]How can I bind the value of local dbName to the module
 
Back
Top