Hi Computer Software Developer,
I had a look at your issue - I attached my setup for reproduction, to make sure there aren't any errors on my side. You can start it by calling * 'java -cp BaseX.jar org.basex.BaseX < commands.txt'*
For me it works fine with the actual release you can get from [1]. Which version of BaseX are you using?
Regarding the insert issue: Are you trying to insert something into an APPLICATION element which is deleted by the delete statement - in this case the insert operation is not carried out at all - as a result of optimization processes. Depending on what you want to do, I'd be happy to help you out ... just let me know.
Feel free to ask for more.
Regards, Lukas
[1] http://basex.org/products/download/all-downloads/
On Tue, May 10, 2011 at 2:53 PM, Computer Software Developer < computer.software.developer@gmail.com> wrote:
Hi,
I have a collection MyData/Test and another collection MyData/Real. I have the following XML occurring about five times in total, 4 times in collection MyData/Test and once in MyData/Real:
<APPLICATION> <APPLICATION_ID>1</APPLICATION_ID> </APPLICATION>
When I seek to delete this application only from MyData/Test using updating xquery like so: xquery version "1.0";
declare namespace fn="http://www.w3.org/2005/xpath-functions";
let $dataSet := 'Test' let $databaseName := 'MyData' let $applicationID := '1'
let $finalURL := fn:concat($databaseName, "/",$dataSet) let $applicationsModified := <APP-DATA-ROOT xmlns:xforms="http://www.w3.org/2002/xforms%22%3E; <APPLICATION> <APPLICATION_ID>2</APPLICATION_ID> </APPLICATION> </APP-DATA-ROOT>
for $all in fn:collection($finalURL) for $anApp in $all/APPLICATION[APPLICATION_ID=$applicationID] return ( delete nodes $anApp )
The application gets deleted from MyData/Real collection as well!
Moreover, an insert statement to insert an APPLICATION element in the return block above, such insert statement placed after the deletion statement above, does not appear to insert anything.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk