Index: trunk/src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 2088)
+++ trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 2089)
@@ -395,9 +395,22 @@
                     throwException(tr("Illegal value for attribute ''version'' on OSM primitive with id {0}. Got {1}", Long.toString(current.id), version));
                 }
-                if (current.version <= 0 && current.id > 0) {
-                    throwException(tr("Illegal value for attribute ''version'' on OSM primitive with id {0}. Got {1}", Long.toString(current.id), version));
-                } else if (current.version < 0 && current.id  <=0) {
-                    System.out.println(tr("WARNING: normalizing value of attribute ''version'' of element {0} to 0. Got {1}", current.id, current.version));
-                    current.version = 0;
+                if (ds.version.equals("0.6")){
+                    if (current.version <= 0 && current.id > 0) {
+                        throwException(tr("Illegal value for attribute ''version'' on OSM primitive with id {0}. Got {1}", Long.toString(current.id), version));
+                    } else if (current.version < 0 && current.id  <=0) {
+                        System.out.println(tr("WARNING: normalizing value of attribute ''version'' of element {0} to 0, API version is ''0.6''. Got {1}", current.id, current.version));
+                        current.version = 0;
+                    }
+                } else if (ds.version.equals("0.5")) {
+                    if (current.version <= 0 && current.id > 0) {
+                        System.out.println(tr("WARNING: normalizing value of attribute ''version'' of element {0} to 1, API version is ''0.5''. Got {1}", current.id, current.version));
+                        current.version = 1;
+                    } else if (current.version < 0 && current.id  <=0) {
+                        System.out.println(tr("WARNING: normalizing value of attribute ''version'' of element {0} to 0, API version is ''0.5''. Got {1}", current.id, current.version));
+                        current.version = 0;
+                    }
+                } else {
+                    // should not happen. API version has been checked before
+                    throwException(tr("Unknown or unsupported API version. Got {0}", ds.version));
                 }
             } else {
