XML format change
Dirk Hohndel
dirk at hohndel.org
Sun Dec 23 10:12:56 PST 2012
On Dec 23, 2012, at 10:06 AM, Linus Torvalds wrote:
> On Sun, Dec 23, 2012 at 9:53 AM, Dirk Hohndel <dirk at hohndel.org> wrote:
>>
>> Comments?
>
> Just two:
>
> - check out old versions of subsurface to make sure they don't break.
> Our XML parsing is fairly relaxed (very much designed that way, since
> it also parses other formats), but just in case.
>
> - ditch the "program" entry entirely, and just use the divelog one,
> and make the root just be
>
> <divelog program='subsurface' version='2'>
> ..
> </divelog>
>
> instead.
Cool - I looked at that but wasn't sure if that would break parsing with older versions…
> With a small additional note:
>
> - I really think you should index the dive computer nickname not by
> "deviceid", but by the <model,deviceid> tuple. I'm not at all
> convinced that the deviceid is unique across models: I think that
> libdivecomputer tends to use something like a serial number, and who
> knows if two different models might not have overlapping serial
> numbers.
>
> So the nickname should be something like
>
> <divecomputer model='Suunto Vyper Air' deviceid='abc' nickname='my
> computer' />
>
> which would also (I think) be nice documentation for the user in case
> you end up deleting all the dives that actually use that computer...
Funny you should mention that. I have been pondering that problem in my lookups
already… and hate the fact that the current code is rather inconsistent in how it uses
model and/or deviceid. I'll go back through the code and make sure that we consistently
use model AND deviceid to identify a dive computer. And store it that way in the XML
file.
Thanks
/D
More information about the subsurface
mailing list