Hi,

I would like to store the results of an xquery extracting some nodes from an 
existing database into a new database.

So I have the DB 'collect' open and then do:

db:create('annotate-abcdef')

and then

for $i at $p in //entry[phraseme[text() = "abcdef"] and selected[text() = 
"yes"]]
    let $query := $i/query
    let $nodeid := $i/node
    let $node := db:open-id('TG-DTA-GerManC-stemming-ws', $nodeid)
    let $nodename := name($node)
    let $nodecontent := string($node)
    return insert node <div>{$nodeid} {$query} {element {$nodename} 
{$nodecontent}} 
</div> as last into db:open('annotate-abcdef')

However, the error message is 

[XUDY0027] Insert target must not be empty.

How would I add a root element to the new DB, as I don't wan't to link it to an 
existing document?  All nodes added to the DB are only results from queries 
over an existing DB. All I can see from the Wiki is using a document as initial 
data for the DB.

How do I set UPDINDEX ON for the new DB?  I will later update the information 
added in the first place by other queries.  To be able to use ft:mark, I would 
have to optimize the DB with db:optimize() after having added nodes, is this 
correct?

Thanks in advance and best regards

Cerstin
-- 
Dr. phil. Cerstin Mahlow

Universität Basel
Departement Sprach- und Literaturwissenschaften
Fachbereich Deutsche Sprach- und Literaturwissenschaft
Nadelberg 4
4051 Basel
Schweiz

Tel:  +41 61 267 07 65
Fax: +41 61 267 34 40
Mail: cerstin.mah...@unibas.ch
Web: http://www.oldphras.net

_______________________________________________
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

Reply via email to