XML format change

Miika Turkia miika.turkia at gmail.com
Fri Jan 4 08:06:27 PST 2013

On Thu, Dec 27, 2012 at 5:55 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
> Miika Turkia <miika.turkia at gmail.com> writes:
>> On Thu, Dec 27, 2012 at 1:48 AM, Dirk Hohndel <dirk at hohndel.org> wrote:
>>> On Dec 23, 2012, at 9:53 AM, Dirk Hohndel wrote:
>>>> Linus, Miika,
>>>> the two of you have been rather deeply involved in dealing with the XML side of things (and Linus obviously has very strong feelings about the prettiness and readability of our XML).
>>>> So here is what I proposed a few days ago:
>>>> <settings>
>>>> <divecomputer deviceid='abc' nickname='my computer' />
>>>> <divecomputer deviceid='def' nickname='my backup computer' />
>>>> <autogroup value='TRUE' />
>>>> <other settings ... />
>>>> </settings>
>>>> <dives>
>>>> <program name='subsurface' version='1'></program>
>>>> <trip date='…
>>> One more question about this.
>>> We have a <divecomputer> tag inside the dive tag. Is there any issue with having a <divecomputer> tag under settings as well or should I give it a unique name (like <divecomputerid>)?
>> You can have multiple tags with same name if you reference them using
>> the parent tag and not wild cards. With the current proposal, if you
>> test with:
>> xpath -e '//divecomputer' <file>
>> you will get the settings and dive samples. //settings/divecomputer
>> would give you only the settings part. So from XML point of view, this
>> will work fine. (I am not sure how these are parsed in Subsurface, but
>> the context should be clear in there as well.)
>> On the other hand, clarity of the XML might become an issue when using
>> same tags on different contexts.
> That was my worry. Readability and clarity. So I went with
> <settings>
> <divecomputerid model='' deviceid='' [nickname='']/>
> ...
> with the nickname part being optional (and when missing it means there
> is no nickname set, just use the model, as most people with only one
> dive computer won't need a nickname - unless they don't like the long
> name that libdivecomputer assigns. One example might be people with an
> "OSTC" might not want "Heinrichs Weikamp OSTC")

I could use the serial number of the device, preferably in the GUI but
at least in the XML file. Currently I need to report that to Suunto
due to a fault in my device and I would assume I am not the only one
needing the serial number.. (libdivecomputer's universal app did the
trick for me but probably not for the masses starting to use
Subsurface soon :)


More information about the subsurface mailing list