On Thu, Jul 07, 2022 at 07:12:27PM -0400, Liam R. E. Quin scripsit:
On Thu, 2022-07-07 at 17:18 -0400, Graydon Saunders wrote:
So far as I know, there isn't any way to declare a namespace dynamically;
https://www.w3.org/TR/xquery-31/#id-computed-namespaces
may help?
The thing I'm after is to be able to go
declare namespace prefix = $URI;
in a module prolog, and to be able set or pass a value for $URI when the module is loaded so the prefix gets bound in the static context to whatever is in $URI.
I'm pretty sure there isn't a way to do that, but I've certainly been wrong before.
(The use case is handling versions of the same notional vocabulary with the same prefix; most of the tests I want to run apply to things like references and metadata which follow the same rules in the strict and lax versions of the vocabulary, so it would be nice not to duplicate the testing functions.)
You can pass a namespace node as a function parameter, too, at least in theory (i've never done it) :)
I have!
Important to remember the namespaces go before the attributes, but otherwise handy for putting things together.