Index: applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java
===================================================================
--- applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java	(revision 3589)
+++ applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java	(revision 3590)
@@ -16,5 +16,7 @@
 {
     boolean inDoc, inRule, inCondition, inElemStyle, inLine, inIcon, inArea;
-    ElemStyle curStyle;
+    ElemStyle curLineStyle=null;
+    ElemStyle curIconStyle=null;
+    ElemStyle curAreaStyle=null;
     ElemStyles styles;
     String curKey, curValue ;
@@ -140,5 +142,19 @@
         {
             inRule = false;
-            styles.add (curKey, curValue, curStyle);
+			if(curLineStyle != null)
+			{
+            	styles.add (curKey, curValue, curLineStyle);
+				curLineStyle = null;
+			}
+			if(curIconStyle != null)
+			{
+            	styles.add (curKey, curValue, curIconStyle);
+				curIconStyle = null;
+			}
+			if(curAreaStyle != null)
+			{
+            	styles.add (curKey, curValue, curAreaStyle);
+				curAreaStyle = null;
+			}
         }
         else if (inCondition && qName.equals("condition"))
@@ -147,5 +163,5 @@
         {
             inLine = false;
-            curStyle = new LineElemStyle(curWidth,curRealWidth, curColour,
+            curLineStyle = new LineElemStyle(curWidth,curRealWidth, curColour,
 										curMinZoom);
 						curWidth=1;
@@ -155,10 +171,10 @@
         {
             inIcon = false;
-            curStyle = new IconElemStyle(curIcon,curAnnotate,curMinZoom);
+            curIconStyle = new IconElemStyle(curIcon,curAnnotate,curMinZoom);
         }
         else if (inArea && qName.equals("area"))
         {
             inArea = false;
-            curStyle = new AreaElemStyle (curColour,curMinZoom);
+            curAreaStyle = new AreaElemStyle (curColour,curMinZoom);
         }
 
Index: applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyles.java
===================================================================
--- applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyles.java	(revision 3589)
+++ applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyles.java	(revision 3590)
@@ -17,4 +17,17 @@
 	{
 		String key = k + "=" + v;
+		
+		/* unfortunately, there don't seem to be an efficient way to */
+		/* find out, if a given OsmPrimitive is an area or not, */
+		/* so distinguish only between way and node here - for now */
+		if(style instanceof AreaElemStyle) {
+			key = key + "way";
+		}
+		else if(style instanceof LineElemStyle) {
+			key = key + "way";
+		}
+		else if(style instanceof IconElemStyle) {
+			key = key + "node";
+		}
 		styles.put(key, style);
 	}
@@ -24,9 +37,16 @@
 		if(p.keys!=null)
 		{
+			String classname;
+			
+			if(p instanceof org.openstreetmap.josm.data.osm.Node) {
+				classname = "node";
+			} else {
+				classname = "way";
+			}
 			Iterator<String> iterator = p.keys.keySet().iterator();
 			while(iterator.hasNext())	
 			{
 				String key = iterator.next();
-				String kv = key + "=" + p.keys.get(key);
+				String kv = key + "=" + p.keys.get(key) + classname;
 				if(styles.containsKey(kv))
 				{
