Dynamic lookup of namespaces
Sunday, 17 July 2016 · 3 messages
B
buddyonweb-software17 Jul 2016 13:56 #
Is there a way to get a list of the namespaces declared/used?
I am wanting to right a function that does a function lookup, but I want to right it in such a way that I don't have to know the namespaces ahead of time.
Are there any functions that will return a list of the namespaces being used?
Thanks in advance,
Buddy
CG
Christian Grün17 Jul 2016 13:59 #
Hi Buddy,
Try
inspect:static-context with the 'namespaces' argument [1].
Cheers
Christian
[1] http://docs.basex.org/wiki/Inspection_Module#inspect:static-contextQuoted text · buddyonweb-software · 13 lines
On Sun, Jul 17, 2016 at 1:56 PM, <buddyonweb-software at yahoo.com> wrote: > Is there a way to get a list of the namespaces declared/used? > > I am wanting to right a function that does a function lookup, but I want to > right it in such a way that I don't have to know the namespaces ahead of > time. > > Are there any functions that will return a list of the namespaces being > used? > > Thanks in advance, > > Buddy
KK
In XQuery you could use the function in-scope-prefixes together with the function namespace-uri-for-prefix.
Best
Kristian K
17.07.2016 14:56 buddyonweb-software at yahoo.com kirjutas:
Quoted text · buddyonweb-software · 12 lines
> Is there a way to get a list of the namespaces declared/used? > > I am wanting to right a function that does a function lookup, but I > want to right it in such a way that I don't have to know the > namespaces ahead of time. > > Are there any functions that will return a list of the namespaces > being used? > > Thanks in advance, > > Buddy
Written for BaseX 8.5. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery