I have a database with a structure thus:
/data/functions/seminars/seminar
I wanted to add some new seminars to this list. I was working from a spreadsheet, which I converted to tab-separated values and then used regular expressions to rewrite each line as a <seminar/> element.
I don't know to do multiple replaces in a single query, so I did this instead:
let $seminars := /data/functions/seminars let $xs := $seminars/seminar return replace node $seminars with <seminars> {$xs} <seminar/> <seminar/> <seminar/> <seminar/> <seminar/> </seminars>
This corrupted the database to the point where it was unusable. (First error was that there were multiple docs. Then I tracked it down to an index out of bounds error.)
I had to switch to a back-up copy. I then tried simply inserting the seminars one at a time. This didn't work either.
I backed up to BaseX 6.5 and tried again and everything worked perfectly.
Have I done something dumb, or is there a problem here?
Thanks! Chas.