Explanation
Activity XML is the XML format we are using to transport any and all data that is received from any garmin device … current or future. We have support for any measurement you can think of and it is a fairly efficient format. The schema takes a different philosophy than Training Center XML in that it is extremely flexible so we lose the integrity checking of TCX validation, but gain the ability to add measurements without having to change the schema through extension.
So let me give you a taste of a trackpoint…
History
<series type="history" id="series1"> <sample id=”s1” <measurement id=”m1” value=”35.38” context=”dist”/> <measurement id=”m2” value=”93” context=”hr”/> <measurement id=”m3” value=”3992” context=”power”/> </sample> <sample id=”s2” <measurement id=”m1” value=”35.38” context=”dist”/> <measurement id=”m2” value=”93” context=”hr”/> <measurement id=”m3” value=”3992” context=”power”/> </sample> ... <sample id=”s389” <measurement id=”m1” value=”35.38” context=”dist”/> <measurement id=”m2” value=”93” context=”hr”/> <measurement id=”m3” value=”3992” context=”power”/> </sample> </series>
Notice the above is rather efficient although fairly self-explanatory. The uom is the default base SI unit as defined by the document.
Laps
<section id=”sections1” type=”laps” series="series1"> <section id=”section1” seriesStart=”s1” seriesEnd=”s389”> <measurement id=”m50” value=”3823” context=”dist” modifier=”sum”/> <measurement id=”m51” value=”88” context=”hr” modifier=”weightedMean”/> <measurement id=”m52” value=”150” context=”hr” modifier=”high”/> </section> </sections>
Notice we introduce a few concepts here…
Dictionary
At the beginning of the document is a dictionary that defines most any item. The values in modifier, context and many other attributes must resolve to an definition ID in the dictionary. The dictionary is necessary to define the dynamic values that are populating the flexible elements of the AXM Document.
<dictionary>
<modifier idValue="max" id="modifier_max" class="modifier">
<display lang="en" format="format_singular">max</display>
</modifier>
<modifier idValue="sum" id="modifier_sum" class="modifier">
<display lang="en" format="format_singular">sum</display>
</modifier>
<context uom="unit_centimeter" idValue="distance" id="context_distance" class="context">
<display lang="en" format="format_abbreviated">dist</display>
<display lang="en" format="format_singular">Distance</display>
</context>
<context uom="unit_bpm" idValue="heartRate" id="context_heartRate" class="context">
<display lang="en" format="format_abbreviated">hr</display>
<display lang="en" format="format_singular">Heart Rate</display>
</context>
<unit idValue="kilometer" id="unit_kilometer" class="unit">
<display lang="en" format="format_plural">kilometers</display>
<display lang="en" format="format_abbreviated">km</display>
<display lang="en" format="format_singular">km</display>
</unit>
</dictionary>
Samples