Index: /trunk/src/org/openstreetmap/josm/io/GpxReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 5397)
+++ /trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 5398)
@@ -5,5 +5,4 @@
 
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.Utils.equal;
 
 import java.io.IOException;
@@ -32,9 +31,12 @@
 
 /**
- * Read a gpx file. Bounds are not read, as we caluclate them. @see GpxData.recalculateBounds()
+ * Read a gpx file.
+ * 
+ * Bounds are not read, as we caluclate them. @see GpxData.recalculateBounds()
+ * Both GPX version 1.0 and 1.1 are supported.
+ *
  * @author imi, ramack
  */
 public class GpxReader {
-    // TODO: implement GPX 1.0 parsing
 
     private String version;
@@ -247,6 +249,9 @@
                 } else if (version.equals("1.0") && qName.equals("email")) {
                     currentData.attr.put(GpxData.META_AUTHOR_EMAIL, accumulator.toString());
+                } else if (qName.equals("url") || qName.equals("urlname")) {
+                    currentData.attr.put(qName, accumulator.toString());
                 } else if ((currentState == State.metadata && qName.equals("metadata")) ||
                         (currentState == State.gpx && qName.equals("gpx"))) {
+                    convertUrlToLink(currentData.attr);
                     currentState = states.pop();
                 }
@@ -296,9 +301,11 @@
             case wpt:
                 if (   qName.equals("ele")  || qName.equals("magvar")
-                        || qName.equals("name") || qName.equals("geoidheight")
-                        || qName.equals("type") || qName.equals("sym")) {
+                        || qName.equals("name") || qName.equals("src")
+                        || qName.equals("geoidheight") || qName.equals("type")
+                        || qName.equals("sym") || qName.equals("url")
+                        || qName.equals("urlname")) {
                     currentWayPoint.attr.put(qName, accumulator.toString());
-                } else if(qName.equals("hdop") /*|| qName.equals("vdop") ||
-                        qName.equals("pdop")*/) {
+                } else if(qName.equals("hdop") || qName.equals("vdop") ||
+                        qName.equals("pdop")) {
                     try {
                         currentWayPoint.attr.put(qName, Float.parseFloat(accumulator.toString()));
@@ -314,10 +321,13 @@
                 } else if (qName.equals("rtept")) {
                     currentState = states.pop();
+                    convertUrlToLink(currentWayPoint.attr);
                     currentRoute.routePoints.add(currentWayPoint);
                 } else if (qName.equals("trkpt")) {
                     currentState = states.pop();
+                    convertUrlToLink(currentWayPoint.attr);
                     currentTrackSeg.add(currentWayPoint);
                 } else if (qName.equals("wpt")) {
                     currentState = states.pop();
+                    convertUrlToLink(currentWayPoint.attr);
                     currentData.waypoints.add(currentWayPoint);
                 }
@@ -332,9 +342,10 @@
                 if (qName.equals("trk")) {
                     currentState = states.pop();
+                    convertUrlToLink(currentTrackAttr);
                     currentData.tracks.add(new ImmutableGpxTrack(currentTrack, currentTrackAttr));
                 } else if (qName.equals("name") || qName.equals("cmt")
                         || qName.equals("desc") || qName.equals("src")
                         || qName.equals("type") || qName.equals("number")
-                        || qName.equals("url")) {
+                        || qName.equals("url") || qName.equals("urlname")) {
                     currentTrackAttr.put(qName, accumulator.toString());
                 }
@@ -350,4 +361,5 @@
                 } else if (qName.equals("rte")) {
                     currentState = states.pop();
+                    convertUrlToLink(currentRoute.attr);
                     currentData.routes.add(currentRoute);
                 }
@@ -359,4 +371,20 @@
                 throw new SAXException(tr("Parse error: invalid document structure for GPX document."));
             data = currentData;
+        }
+
+        /**
+         * convert url/urlname to link element (GPX 1.0 -> GPX 1.1).
+         */
+        private void convertUrlToLink(Map<String, Object> attr) {
+            String url = (String) attr.get("url");
+            String urlname = (String) attr.get("urlname");
+            if (url != null) {
+                if (!attr.containsKey(GpxData.META_LINKS)) {
+                    attr.put(GpxData.META_LINKS, new LinkedList<GpxLink>());
+                }
+                GpxLink link = new GpxLink(url);
+                link.text = urlname;
+                ((Collection<GpxLink>) attr.get(GpxData.META_LINKS)).add(link);
+            }
         }
 
