On Tue, 24 Jan 2012 22:35:45 +0100, Piotr BaĆski bansp@o2.pl wrote:
Hi all,
This is, I'm afraid, a basic question, that in my hasty searches I just must have missed a solution to.
I would like to find a clean way of referencing the default context of my main module, where I can easily do "let $x := //whatever", but after I move this line to a function declaration.
Is there any kind of database-root() function that would provide such a reference? I realise that I can pass the relevant node as one of the function's arguments, or use a doc() there with the appropriate path, or maybe even use the "declare context item" functionality that i haven't been successful in putting to work so far, but maybe there exists a much simpler way out? I'll be grateful for a hint.
Hi Piotr,
I'm not sure if you need this, but since you asked for "database-root()", you can obtain the root node of any given node using fn:root() [1].
Regards, Dimitar