Merge pull request #10542 from jensMF/fix_gpx_xml_schema_alternative

fix #1326 and #10209 by adding the XML namespace 'osmand' to the header and the writeExtensions function
This commit is contained in:
vshcherb 2021-01-08 17:40:26 +01:00 committed by GitHub
commit 0e991a5e87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1790,6 +1790,7 @@ public class GPXUtilities {
serializer.attribute(null, "creator", file.author); //$NON-NLS-1$ serializer.attribute(null, "creator", file.author); //$NON-NLS-1$
} }
serializer.attribute(null, "xmlns", "http://www.topografix.com/GPX/1/1"); //$NON-NLS-1$ //$NON-NLS-2$ serializer.attribute(null, "xmlns", "http://www.topografix.com/GPX/1/1"); //$NON-NLS-1$ //$NON-NLS-2$
serializer.attribute(null, "xmlns:osmand", "https://osmand.net");
serializer.attribute(null, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); serializer.attribute(null, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
serializer.attribute(null, "xsi:schemaLocation", serializer.attribute(null, "xsi:schemaLocation",
"http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"); "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd");
@ -1938,7 +1939,7 @@ public class GPXUtilities {
serializer.startTag(null, "extensions"); serializer.startTag(null, "extensions");
if (!extensions.isEmpty()) { if (!extensions.isEmpty()) {
for (Entry<String, String> s : extensions.entrySet()) { for (Entry<String, String> s : extensions.entrySet()) {
writeNotNullText(serializer, s.getKey(), s.getValue()); writeNotNullText(serializer,"osmand:" + s.getKey(), s.getValue());
} }
} }
if (extensionsWriter != null) { if (extensionsWriter != null) {