Export GPX 1.1 instead of 1.0.

The only thing not allowed in 1.1 currently used is the track color
tag, which is moved into the "<extensions>" tag to make it conform to
the 1.1 schema.
This commit is contained in:
Jared Casper
2011-02-09 10:54:13 -08:00
parent 04578a4ed1
commit 6ffa40e40d
@@ -67,14 +67,14 @@ public class GpxTrackWriter implements TrackFormatWriter {
Charset.defaultCharset().name()); Charset.defaultCharset().name());
pw.println("<?xml-stylesheet type=\"text/xsl\" href=\"details.xsl\"?>"); pw.println("<?xml-stylesheet type=\"text/xsl\" href=\"details.xsl\"?>");
pw.println("<gpx"); pw.println("<gpx");
pw.println(" version=\"1.0\""); pw.println(" version=\"1.1\"");
pw.println(" creator=\"My Tracks for the G1 running Android\""); pw.println(" creator=\"My Tracks for the G1 running Android\"");
pw.println(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""); pw.println(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
pw.println(" xmlns=\"http://www.topografix.com/GPX/1/0\""); pw.println(" xmlns=\"http://www.topografix.com/GPX/1/1\"");
pw.print(" xmlns:topografix=\"http://www.topografix.com/GPX/Private/" pw.print(" xmlns:topografix=\"http://www.topografix.com/GPX/Private/"
+ "TopoGrafix/0/1\""); + "TopoGrafix/0/1\"");
pw.print(" xsi:schemaLocation=\"http://www.topografix.com/GPX/1/0 "); pw.print(" xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 ");
pw.print("http://www.topografix.com/GPX/1/0/gpx.xsd "); pw.print("http://www.topografix.com/GPX/1/1/gpx.xsd ");
pw.print("http://www.topografix.com/GPX/Private/TopoGrafix/0/1 "); pw.print("http://www.topografix.com/GPX/Private/TopoGrafix/0/1 ");
pw.println("http://www.topografix.com/GPX/Private/TopoGrafix/0/1/" pw.println("http://www.topografix.com/GPX/Private/TopoGrafix/0/1/"
+ "topografix.xsd\">"); + "topografix.xsd\">");
@@ -98,7 +98,7 @@ public class GpxTrackWriter implements TrackFormatWriter {
pw.println("<desc>" + StringUtils.stringAsCData(track.getDescription()) pw.println("<desc>" + StringUtils.stringAsCData(track.getDescription())
+ "</desc>"); + "</desc>");
pw.println("<number>" + track.getId() + "</number>"); pw.println("<number>" + track.getId() + "</number>");
pw.println("<topografix:color>c0c0c0</topografix:color>"); pw.println("<extensions><topografix:color>c0c0c0</topografix:color></extensions>");
} }
} }