XML format change

Miika Turkia miika.turkia at gmail.com
Wed Dec 26 23:20:27 PST 2012


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.

miika


More information about the subsurface mailing list