From f0d54c62178765ba7f2e651a57e1364863a884d5 Mon Sep 17 00:00:00 2001 From: jensMF Date: Sat, 16 Jan 2021 01:15:49 +0100 Subject: [PATCH] fixed xml schema by changing the order of wpt rte and trk and adding the osmand namespace to the route and types extensions --- .../main/java/net/osmand/GPXUtilities.java | 39 +++++++++---------- .../net/osmand/binary/StringBundleWriter.java | 2 +- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java b/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java index bee9fa2b19..ede3b6f8cf 100644 --- a/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java +++ b/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java @@ -1822,6 +1822,25 @@ public class GPXUtilities { } serializer.endTag(null, "metadata"); + for (WptPt l : file.points) { + serializer.startTag(null, "wpt"); //$NON-NLS-1$ + writeWpt(format, serializer, l); + serializer.endTag(null, "wpt"); //$NON-NLS-1$ + } + + for (Route track : file.routes) { + serializer.startTag(null, "rte"); //$NON-NLS-1$ + writeNotNullText(serializer, "name", track.name); + writeNotNullText(serializer, "desc", track.desc); + + for (WptPt p : track.points) { + serializer.startTag(null, "rtept"); //$NON-NLS-1$ + writeWpt(format, serializer, p); + serializer.endTag(null, "rtept"); //$NON-NLS-1$ + } + writeExtensions(serializer, track); + serializer.endTag(null, "rte"); //$NON-NLS-1$ + } for (Track track : file.tracks) { if (!track.generalTrack) { @@ -1844,26 +1863,6 @@ public class GPXUtilities { } } - for (Route track : file.routes) { - serializer.startTag(null, "rte"); //$NON-NLS-1$ - writeNotNullText(serializer, "name", track.name); - writeNotNullText(serializer, "desc", track.desc); - - for (WptPt p : track.points) { - serializer.startTag(null, "rtept"); //$NON-NLS-1$ - writeWpt(format, serializer, p); - serializer.endTag(null, "rtept"); //$NON-NLS-1$ - } - writeExtensions(serializer, track); - serializer.endTag(null, "rte"); //$NON-NLS-1$ - } - - for (WptPt l : file.points) { - serializer.startTag(null, "wpt"); //$NON-NLS-1$ - writeWpt(format, serializer, l); - serializer.endTag(null, "wpt"); //$NON-NLS-1$ - } - writeExtensions(serializer, file); serializer.endTag(null, "gpx"); //$NON-NLS-1$ diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/StringBundleWriter.java b/OsmAnd-java/src/main/java/net/osmand/binary/StringBundleWriter.java index 2f607aef3a..d3c151c12a 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/StringBundleWriter.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/StringBundleWriter.java @@ -20,7 +20,7 @@ public abstract class StringBundleWriter { public void writeBundle() { for (Entry> entry : bundle.getMap().entrySet()) { - writeItem(entry.getKey(), entry.getValue()); + writeItem("osmand:" + entry.getKey(), entry.getValue()); } } }