Hi Michael,
thank you for the quick response. Is it planned to add a rename-document-command in the future? Deleting and re-adding is not really an option, because I cannot perform these two operations in one transaction.
Actually I was looking for this functionality because I have a big problem with an insert query which corrupts the whole database. I can easily reproduce the problem with the following steps, so I think it is a bug in BaseX:
1. Create database 'db' 2. Insert a document called 'doca' into 'db': ADD as 'doca' <...complex XML data...> 3. Insert a document called 'docb' into 'db': ADD as 'docb' <...complex XML data...> 4. Perform the following XQuery: insert node collection('db/docb')/somenode after collection('db/doca')/someothernode
The XQuery returns an error "[XQST0054] Circular variable definition?", although the query contains no variables. However, the query still adds parts of docb into doca and after the query the database is corrupt. With corrupt I mean that the GUI returns either an OutOfBounds exception or a StackOverflow exception or a NotExpected exception when re-opening the database. Which exception is thrown is random. With simple XML data in doca and docb (e.g. <a><b>test</b></a>) the steps work properly, however with my XML dataset it does not work. I can supply a sample dataset so you can reproduce the problem, but I would prefer to not post my dataset to the mailing list if possible.
Thanks for your help!
Grüße aus Österreich, Thomas
-----Original Message----- From: Michael Seiferle [mailto:michael.seiferle@uni-konstanz.de] Sent: Wednesday, April 20, 2011 6:22 PM To: thomas@kaltofen.at; Thomas Kaltofen Cc: basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] Renaming of documents
Hi Thomas,
this is due to the specification - renaming documents inside collections or databases is out of scope: XQuery Update does not allow modifications outside the root node - and this is where actual document node, that contains the document name, resides.
I am sorry that at the moment we can not provide a command that does this for you. You could however delete and re-add that document.
Hope this helps for the moment.
Grüße aus Konstanz Michael
Am 20.04.2011 um 17:13 schrieb Thomas Kaltofen:
Hi, why is it not possible to rename a document in a database with an update XQuery? Thanks for helping out!
Regards, Thomas _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk