Dear Daniël,
thanks for your e-mail.
I have a question regarding the add command -- ADD (AS [name]) (TO [target]) [input]. It seems it is not possible to add a document to the database which you want to give a custom name (for whatever reason) that contains a space like so:
add as "test x.xml" "/path/to/test 1.xml"
To reduce the number of potential side effects, we have simplified the command parser to ignore special characters, including spaces. However, this is a useful hint, which I've just added to our todo list (similar issues will have to be checked on other commands, such as delete).
I wonder if this is a minor bug in the syntax checking of this command, or that this is intended behavior. In case of the latter, I wonder if there is another way to specify names which contain spaces.
Currently, you could use the BaseX API and the Add command (new Add(...)...) to specify names with spaces.
While we are at it (the add command): I was expecting the TO [target] part to refer to a database. For example, if I have two databases 'misc' and 'col', I would expect a command such as:
add to misc "/path/to/test.xml"
The TO option allows you to specify a target path within the currently opened database. This was a frequent feature request, as the source and target path may be different..
add to path/one "path/two/test.xml"
Next, we have decided to limit the ADD command to operate on a single database instance, as the combination of the database name, target path and input data could lead to confusion. Last but not least, the adding of single documents will be faster if the database is opened only once.
Hope this helps, Christian