Hello, When using basexgui, after opening a database and go to properties and then information one can see all the namespaces in the document. When not using the gui how does one extract the same information? Been reading the wiki but I have not been able to find a module or a function that accomplish exactly that. Also Im trying to use the information from index:facets("db") to create a simple visual interface so users, without xquery knowledge, can click on nodes and add filters and those choices are then translated into xquery commands. Any information in this area would greatly appreciated.
- Henning
Virusfritt. www.avast.com
Hi Henning,
When using basexgui, after opening a database and go to properties and then information one can see all the namespaces in the document. When not using the gui how does one extract the same information?
the INFO STORAGE command will list the database structure and, at the very end, the used namespaces.
Apart from that, you can always use XQuery to dump namespaces. If you don’t care about namespace hierarchy, and namespaces overwriting other namespaces, the attached query may help.
Also Im trying to use the information from index:facets("db") to create a simple visual interface so users, without xquery knowledge, can click on nodes and add filters and those choices are then translated into xquery commands. Any information in this area would greatly appreciated.
What information do you need?
Christian ______________________________________________
distinct-values( for $node in //*/(self::*, attribute::*) let $name := $node/node-name() let $uri := namespace-uri-from-QName($name) where $uri let $pref := prefix-from-QName($name) return if ($pref) then ( $pref || ' = ' || '"' || $uri || '"' ) else ( '"' || $uri || '"' ) )
Example document:
<a:a xmlns:a='A'> <b xmlns='B'> <c c:c='c' xmlns:c='C'/> </b> </a:a>
Output (similar to the one you find in the database properties dialog):
a = "A" "B" c = "C"
On Sat, Jun 18, 2016 at 1:47 AM, Henning Phan henningphan@hotmail.com wrote:
Hello,
When using basexgui, after opening a database and go to properties and then information one can see all the namespaces in the document. When not using the gui how does one extract the same information? Been reading the wiki but I have not been able to find a module or a function that accomplish exactly that.
Also Im trying to use the information from index:facets("db") to create a simple visual interface so users, without xquery knowledge, can click on nodes and add filters and those choices are then translated into xquery commands. Any information in this area would greatly appreciated.
- Henning
Virusfritt. www.avast.com
basex-talk@mailman.uni-konstanz.de