XML format change

Linus Torvalds torvalds at linux-foundation.org
Sun Dec 23 10:23:17 PST 2012


On Sun, Dec 23, 2012 at 10:12 AM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
> On Dec 23, 2012, at 10:06 AM, Linus Torvalds wrote:
>>
>> - 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…

So as far as I know, we've never actually parsed the 'program' tag at
all, it was always just there purely as human documentation.

Our xml parsing doesn't actually recognize "native" format at all: it
does the reverse, and recognizes some special formats (ie matching
against a "Divinglog" tag and "uddf" tags in order to notice that it's
not native).

So you have to be careful about adding those tags (currently
"Divinglog" and "uddf", but before we used the xslt thing, we used to
match "SUUNTO" and "JDiveLog" etc)

> 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.

Actually, I think it's consistent. The code I wrote should
consistently check the model (with a "strcasecmp()") first, and then
check deviceid second. And your nickname code consistently only checks
deviceid.

I think. But you may be right that there are inconsistencies even
within those rules ;)

                Linus


More information about the subsurface mailing list