summaryrefslogtreecommitdiffstats
path: root/save-xml.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-02 07:03:03 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-02 07:03:03 -0700
commitf554c2d16cb5816b6b1a97b0349488bc70b512b0 (patch)
tree60811b1d64c2f37378ed20147f829cf74849d1dd /save-xml.c
parent1d59b028c91ab7943cfece4a113948c61110dfc3 (diff)
parent0a0a6f07d5dbb2c24184d22c3c2cedf89ffdc7ac (diff)
downloadsubsurface-f554c2d16cb5816b6b1a97b0349488bc70b512b0.tar.gz
Merge branch 'taxonomy'
Diffstat (limited to 'save-xml.c')
-rw-r--r--save-xml.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/save-xml.c b/save-xml.c
index 988ede1bf..a81d4258d 100644
--- a/save-xml.c
+++ b/save-xml.c
@@ -539,7 +539,20 @@ void save_dives_buffer(struct membuffer *b, const bool select_only)
}
show_utf8(b, ds->description, " description='", "'", 1);
show_utf8(b, ds->notes, " notes='", "'", 1);
- put_format(b, "/>\n");
+ if (prefs.geocoding.enable_geocoding && ds->taxonomy.nr) {
+ put_format(b, ">\n");
+ for (int j = 0; j < ds->taxonomy.nr; j++) {
+ struct taxonomy *t = &ds->taxonomy.category[j];
+ if (t->category != NONE) {
+ put_format(b, "<geo cat='%d'", t->category);
+ put_format(b, " origin='%d'", t->origin);
+ show_utf8(b, t->value, " value='", "'/>\n", 1);
+ }
+ }
+ put_format(b, "</site>\n");
+ } else {
+ put_format(b, "/>\n");
+ }
}
put_format(b, "</divesites>\n<dives>\n");
for (trip = dive_trip_list; trip != NULL; trip = trip->next)