Deleting one of many resources at the same path (sorry for hoging the email distribution list)
DPDimitar Popov1 Jun 2012 21:15 # Quoted text · 10:53:30 · 10 lines
Am Freitag, 1. Juni 2012, 10:53:30 schrieb Anupam Bakshi:
> Hi Dimitar,
> Since collections are sequences, can I use [1] or [last()] to specify which
> one to delete? As per my requirement, I need to be able to delete older
> resources after some processing (data consolidation).
>
> Thanks for your help.
>
> Best regards,
> Anupam
Hi Anupam,
sorry, but as far as I can tell, you can't do that. I would recommend deleting the existing document before you add the new one.
If you remove this line [1] from BaseX source code, then you could use something like this:
delete node collection('sample1.xml')[1]
However, I'm not sure what side effects that would have. Maybe someone else on the ML can tell better.
hth,
Dimitar
PS: you are not hogging the list - it's always nice to have some user feedback :)
[1]https://github.com/BaseXdb/basex/blob/master/src/main/java/org/basex/query/up/expr/Delete.java#L36
⚡Generated with XQuery