I need a format to transfer data from program A to program B, and obviously I'd prefer to use a standard format. On the face of it XML would be perfect for this job, or possibly JSON.
The fly in the ointment is that I need the format to be incremental: program A appends data to the file from time to time, then program B slurps the whole lot when it is ready. From what I've read, neither XML nor JSON can do this, because they both require exactly one top-level element in a file.
Is there anything I'm missing?
Clarification:
I need structure of the kind XML provides and CSV doesn't. (Well I could make a mutant variant of CSV that nothing else would be able to read, but that's what I'm trying to avoid.)
A doesn't know when it will be finished (depends on user actions, availability of network connections and other such unpredictable variables), so A can't say "now I will write the last end tag and handover to B" because A might be called again before B.