Thanks Leonard and Christian!!!
I have solved it using
final QueryProcessor processor = new QueryProcessor("doc('"+workspace + "\\cabecera.xml')"+query, CONTEXT);
I don't need to create databases and drop them if i only want to get data, understood :)
BaseX team is wonderful, thanks!!!
Hi Bea,
i didn't realize that you're not on the basex-talk list. Sorry for that.
Leo
-------- Original-Nachricht --------
Betreff: Re: [basex-talk] dropping DataBase
Datum: Sun, 30 May 2010 18:34:42 +0200
Von: Leonard Wörteler <leo@woerteler.de>
An: basex-talk@mailman.uni-konstanz.de
Hi again,
Just in case you're interested: A simple way to create a main-memory
based DB in BaseX, given the path to an XML document, would be
final Data db = CreateDB.xml(IO.get(path), CTX.prop);
CTX.openDB(db); // open DB in current Context
By the way, this also works if you feed IO.get(..) an XML string instead
of a path.
Cheers again,
Leo
Am 30.05.2010 17:10, schrieb Leonard Wörteler:
> Hello Beatriz,
>
> Am 30.05.2010 16:32, schrieb Beatriz Sancho:
>> static public Vector queryExtraeDatosCabecera(final String query) throws>> [...]
>> BaseXException, QueryException, IOException {
>> WorkSpace sp1 = new WorkSpace();
>> String workspace = sp1.getWorkspace();
>> new CreateDB(workspace + "\\cabecera.xml", "DBCabecera").execute(CONTEXT);
>> new DropDB("DBCabecera").execute(CONTEXT);> wouldn't it be much easier to use an in-memory DB in this case? No need
>> return datos;
>> }
>
> to explicitly drop it and you probably would even get better performance
> because of reduced I/O.
>
> Just my 0.02$...