fixed xml schema by changing the order of wpt rte and trk and adding the osmand namespace to the route and types extensions

This commit is contained in:
jensMF 2021-01-16 01:15:49 +01:00
parent a9c1119c4b
commit f0d54c6217
2 changed files with 20 additions and 21 deletions

View file

@ -1822,6 +1822,25 @@ public class GPXUtilities {
} }
serializer.endTag(null, "metadata"); 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) { for (Track track : file.tracks) {
if (!track.generalTrack) { 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); writeExtensions(serializer, file);
serializer.endTag(null, "gpx"); //$NON-NLS-1$ serializer.endTag(null, "gpx"); //$NON-NLS-1$

View file

@ -20,7 +20,7 @@ public abstract class StringBundleWriter {
public void writeBundle() { public void writeBundle() {
for (Entry<String, Item<?>> entry : bundle.getMap().entrySet()) { for (Entry<String, Item<?>> entry : bundle.getMap().entrySet()) {
writeItem(entry.getKey(), entry.getValue()); writeItem("osmand:" + entry.getKey(), entry.getValue());
} }
} }
} }