Hi Helmut,
What I usually do is create an empty file named .basexhome in the root folder of my project. Then, launch BaseX by going to the command line, change directory to the project
folder, and run basexgui (or basexhttp, etc.). If the .basex config file has not already been created, the config gets created automatically with file paths relative to my project’s root folder.
Vincent
From: basex-talk-bounces@mailman.uni-konstanz.de [mailto:basex-talk-bounces@mailman.uni-konstanz.de]
On Behalf Of helmut
Sent: Sunday, October 08, 2017 4:32 PM
To: basex-talk@mailman.uni-konstanz.de
Subject: Re: [basex-talk] Directory from which xml files are loaded
Dear Christian,
thanks for the quick answer.
Maybe just having an option like WORKPATH in the .basex config file. If
it is set this path ist used instead of the home directory.
Thanks again,
Helmut
Am 2017-10-08 16:49, schrieb Christian Grün:
> Dear Helmut,
>
> File paths in BaseX commands will always be resolved against the
> working directory from which BaseX was started. There’s currently no
> way to change this behavior, but if it turns out that more people have
> stumbled upon this, we could think about altering the default behavior
> with BaseX 9.0. Fedback is welcome.
>
> All the best,
> Christian
>
> Am 07.10.2017 09:23 schrieb "helmut" :
>
>> Hi everyone.
>>
>> I am using basex in embedded mode. I set the basex base directory
>> with System.setProperty("org.basex.path", path). In this path I have
>> a .basexhome file which defines REPRO, DBPATH ... and so on.
>>
>> For loading an xml file to the database I use e.g. new Add(path,
>> file).execute(context). "file" is given as an absolute path.
>> However, when I query the database I get the error [FODC0002]
>> Resource 'path/xyz.xml' does not exist, with a path which points now
>> to my the system property user.home or user.dir.
>>
>> How can I change this behaviour? What I am missing? I don't want to
>> change user.home or user.dir, because other things might depend on
>> the properties.
>>
>> I read through the configuration guide and many other pages, but
>> didn't find something.
>>
>>
http://docs.basex.org/wiki/Configuration [1]
>>
>> Thanks very much,
>> Helmut
>
>
>
> Links:
> ------
> [1]
http://docs.basex.org/wiki/Configuration