Hi Rob,
one more cute workaround is the following one:
1) create an empty database and open it in the gui 2) write your query and store the result to this database
An example query is attached below (it requires the creation of a "visdb" database).
Hope this helps, Christian ___________________________
(: replaces database contents with new result :) declare %updating function local:visualize($result) { db:replace('visdb', 'visdb', document { $result }) };
local:visualize( (: open database let $db := doc("foo") :) (: alternative: main-memory fragment to make it self-contained :) let $db := document { <some> <xpath> <name>bla</name> <child><name>blu</name></child> </xpath> </some> } return <table> <columns> <column>Name</column> <column>Child name</column> </columns> <rows> { for $item in $db/some/xpath return <row> <cell>{$item/name/text()}</cell> <cell>{$item/child/name/text()}</cell> </row> } </rows> </table> ) ___________________________
I'm using BaseXGUI to develop xqueries. The xqueries transform some data from the database into XML that will be rendered as a table. Will the table visualization view in BasexGUI work this way? My xqueries look something like this:
let $dbName := "foo" return <table> <columns> <column>Name</column> <column>Child name</column> </columns> <rows> { for $item in doc($dbname)/some/xpath return <row> <cell>{$item/name/text()}</cell> <cell>{$item/child/name/text()}</cell> </row> } </rows> </table>
The text view of the results look like I expect it to, and using the xqueries inside the application I'm developing works once I get them written and debugged. I'd like to preview the tables inside BaseXGUI if possible, before returning to the IDE and having to run the application, if possible. Thanks for any guidance.
-- Rob _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk