Hello, a little question. I would like to write a mini "tool" which loads an XML file into a database, creating the db if it does not yet exist and overwriting the current content if it does already exist. This script achieves the goal: <commands> <drop-db name="mydb"/> <create-db name="mydb">myxmlfile.xml</create-db> <list/> </commands> But as the script interface does not (yet?) support input parameters, I have to edit the script for each use. Using an XQuery script, on the other hand, is not possible as there is no function for creating a database, if I have not overlooked it in the documentation. My question: is there an alternative which allows to specifiy db name and file name as command line parameters, or is that presently not possible? Many thanks for any information, Hans-Juergen Rennau PS: I would not mind the editing myself, but a tool with call parameters is helpful when spreading the word "BaseX" among the colleagues: providing some useful tools to them using BaseX, one has to instruct them first how to load their data into BaseX, and of course it would be nice to give them a simple call, rather than an instruction how to edit a sample and then call it.
Dear Hans-Jürgen,
the necessity for db:create() and db:drop() is getting more and more obvious, which is why we will definitely introduce those two functions with BaseX 7.5. We also thought about adding variable support to command scripts, but this would result in additional challenges (e.g, how to properly encode characters that are not supposed to be evaluated as variables).
Hope this helps, Christian ___________________________
On Mon, Oct 8, 2012 at 12:42 PM, Hans-Juergen Rennau hrennau@yahoo.de wrote:
Hello,
a little question. I would like to write a mini "tool" which loads an XML file into a database, creating the db if it does not yet exist and overwriting the current content if it does already exist. This script achieves the goal:
<commands> <drop-db name="mydb"/> <create-db name="mydb">myxmlfile.xml</create-db> <list/> </commands>
But as the script interface does not (yet?) support input parameters, I have to edit the script for each use. Using an XQuery script, on the other hand, is not possible as there is no function for creating a database, if I have not overlooked it in the documentation.
My question: is there an alternative which allows to specifiy db name and file name as command line parameters, or is that presently not possible?
Many thanks for any information,
Hans-Juergen Rennau
PS: I would not mind the editing myself, but a tool with call parameters is helpful when spreading the word "BaseX" among the colleagues: providing some useful tools to them using BaseX, one has to instruct them first how to load their data into BaseX, and of course it would be nice to give them a simple call, rather than an instruction how to edit a sample and then call it.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de