Hello --
As part of a long and involved conversion process, the content starts in a lax version of the target vocabulary and proceeds to a strict version of the target vocabulary.
By local convention, the two vocabularies use the same namespace prefix but are not the same namespace and use different namespace URIs.
Ideally, I would be using the same test functions in a lot of cases, only changing the association for the prefix depending on the data.
So far as I know, there isn't any way to declare a namespace dynamically; I can't create a "test this content" module and tell it which namespace to use in some parameterized way, so I'm going to have to create two versions of the module despite the only difference being a namespace declaration.
Is that right, or is there a way to do this?
Thanks! Graydon
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?
You can pass a namespace node as a function parameter, too, at least in theory (i've never done it) :)
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.
basex-talk@mailman.uni-konstanz.de