Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java	(revision 1332)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java	(revision 1333)
@@ -54,5 +54,5 @@
     protected Color untaggedColor;
     protected Color textColor;
-    protected boolean currentDashed = false;
+    protected int currentDashed = 0;
     protected int currentWidth = 0;
     protected Stroke currentStroke = null;
@@ -246,5 +246,5 @@
         int width = defaultSegmentWidth;
         int realWidth = 0; //the real width of the element in meters
-        boolean dashed = false;
+        int dashed = 0;
         Node lastN;
 
@@ -1084,5 +1084,5 @@
     }
 
-    private void drawSeg(Node n1, Node n2, Color col, boolean showDirection, int width, boolean dashed) {
+    private void drawSeg(Node n1, Node n2, Color col, boolean showDirection, int width, int dashed) {
         profilerSegments++;
         if (col != currentColor || width != currentWidth || dashed != currentDashed) {
@@ -1108,14 +1108,14 @@
 
     protected void displaySegments() {
-        displaySegments(null, 0, false);
-    }
-
-    protected void displaySegments(Color newColor, int newWidth, boolean newDash) {
+        displaySegments(null, 0, 0);
+    }
+
+    protected void displaySegments(Color newColor, int newWidth, int newDash) {
         if (currentPath != null) {
             Graphics2D g2d = (Graphics2D)g;
             g2d.setColor(inactive ? inactiveColor : currentColor);
             if (currentStroke == null && useStrokes > dist) {
-                if (currentDashed)
-                    g2d.setStroke(new BasicStroke(currentWidth,BasicStroke.CAP_BUTT,BasicStroke.JOIN_ROUND,0,new float[] {9},0));
+                if (currentDashed != 0)
+                    g2d.setStroke(new BasicStroke(currentWidth,BasicStroke.CAP_BUTT,BasicStroke.JOIN_ROUND,0,new float[] {currentDashed},0));
                 else
                     g2d.setStroke(new BasicStroke(currentWidth,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java	(revision 1332)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java	(revision 1333)
@@ -68,4 +68,55 @@
     }
 
+    private void error(String message) {
+        System.out.println(styleName + " (" + rule.key + "=" + rule.value + "): " + message);
+    }
+    
+    private void startElementLine(String qName, Attributes atts, LineElemStyle line) {
+        for (int count=0; count<atts.getLength(); count++)
+        {
+            if(atts.getQName(count).equals("width"))
+            {
+                String val = atts.getValue(count);
+                if(val.startsWith("+"))
+                {
+                    line.width = Integer.parseInt(val.substring(1));
+                    line.widthMode = LineElemStyle.WidthMode.OFFSET;
+                }
+                else if(val.startsWith("-"))
+                {
+                    line.width = Integer.parseInt(val);
+                    line.widthMode = LineElemStyle.WidthMode.OFFSET;
+                }
+                else if(val.endsWith("%"))
+                {
+                    line.width = Integer.parseInt(val.substring(0, val.length()-1));
+                    line.widthMode = LineElemStyle.WidthMode.PERCENT;
+                }
+                else
+                    line.width = Integer.parseInt(val);
+            }
+            else if (atts.getQName(count).equals("colour"))
+                line.color=convertColor(atts.getValue(count));
+            else if (atts.getQName(count).equals("realwidth"))
+                line.realWidth=Integer.parseInt(atts.getValue(count));
+            else if (atts.getQName(count).equals("dashed")) {
+                try
+                {
+                    line.dashed=Integer.parseInt(atts.getValue(count));
+                } catch (NumberFormatException nfe) {
+                    boolean dashed=Boolean.parseBoolean(atts.getValue(count));
+                    if(dashed) {
+                        line.dashed = 9;
+                    }                
+                }
+            } else if(atts.getQName(count).equals("priority"))
+                line.priority = Integer.parseInt(atts.getValue(count));
+            else if(atts.getQName(count).equals("mode"))
+                line.over = !atts.getValue(count).equals("under");
+            else
+                error("The element \"" + qName + "\" has unknown attribute \"" + atts.getQName(count) + "\"!");
+        }
+    }
+
     @Override public void startElement(String uri,String name, String qName, Attributes atts) {
         if (inDoc==true)
@@ -97,4 +148,6 @@
                     else if(atts.getQName(count).equals("b"))
                         rule.boolValue = atts.getValue(count);
+                    else
+                        error("The element \"" + qName + "\" has unknown attribute \"" + atts.getQName(count) + "\"!");
                 }
             }
@@ -102,16 +155,8 @@
             {
                 hadLine = inLine = true;
-                for (int count=0; count<atts.getLength(); count++)
-                {
-                    if(atts.getQName(count).equals("width"))
-                        rule.line.width = Integer.parseInt(atts.getValue(count));
-                    else if (atts.getQName(count).equals("colour"))
-                        rule.line.color=convertColor(atts.getValue(count));
-                    else if (atts.getQName(count).equals("realwidth"))
-                        rule.line.realWidth=Integer.parseInt(atts.getValue(count));
-                    else if (atts.getQName(count).equals("dashed"))
-                        rule.line.dashed=Boolean.parseBoolean(atts.getValue(count));
-                    else if(atts.getQName(count).equals("priority"))
-                        rule.line.priority = Integer.parseInt(atts.getValue(count));
+                startElementLine(qName, atts, rule.line);
+                if(rule.line.widthMode != LineElemStyle.WidthMode.ABSOLUTE) {
+                    error("Relative widths are not possible for normal lines");
+                    rule.line.widthMode = LineElemStyle.WidthMode.ABSOLUTE;
                 }
             }
@@ -119,38 +164,5 @@
             {
                 hadLineMod = inLineMod = true;
-                for (int count=0; count<atts.getLength(); count++)
-                {
-                    if(atts.getQName(count).equals("width"))
-                    {
-                        String val = atts.getValue(count);
-                        if(val.startsWith("+"))
-                        {
-                            rule.linemod.width = Integer.parseInt(val.substring(1));
-                            rule.linemod.widthMode = LineElemStyle.WidthMode.OFFSET;
-                        }
-                        else if(val.startsWith("-"))
-                        {
-                            rule.linemod.width = Integer.parseInt(val);
-                            rule.linemod.widthMode = LineElemStyle.WidthMode.OFFSET;
-                        }
-                        else if(val.endsWith("%"))
-                        {
-                            rule.linemod.width = Integer.parseInt(val.substring(0, val.length()-1));
-                            rule.linemod.widthMode = LineElemStyle.WidthMode.PERCENT;
-                        }
-                        else
-                            rule.linemod.width = Integer.parseInt(val);
-                    }
-                    else if (atts.getQName(count).equals("colour"))
-                        rule.linemod.color=convertColor(atts.getValue(count));
-                    else if (atts.getQName(count).equals("realwidth"))
-                        rule.linemod.realWidth=Integer.parseInt(atts.getValue(count));
-                    else if (atts.getQName(count).equals("dashed"))
-                        rule.linemod.dashed=Boolean.parseBoolean(atts.getValue(count));
-                    else if(atts.getQName(count).equals("priority"))
-                        rule.linemod.priority = Integer.parseInt(atts.getValue(count));
-                    else if(atts.getQName(count).equals("mode"))
-                        rule.linemod.over = !atts.getValue(count).equals("under");
-                }
+                startElementLine(qName, atts, rule.linemod);
             }
             else if (qName.equals("icon"))
@@ -165,4 +177,6 @@
                     else if(atts.getQName(count).equals("priority"))
                         rule.icon.priority = Integer.parseInt(atts.getValue(count));
+                    else
+                        error("The element \"" + qName + "\" has unknown attribute \"" + atts.getQName(count) + "\"!");
                 }
             }
@@ -176,6 +190,10 @@
                     else if(atts.getQName(count).equals("priority"))
                         rule.area.priority = Integer.parseInt(atts.getValue(count));
-                }
-            }
+                    else
+                        error("The element \"" + qName + "\" has unknown attribute \"" + atts.getQName(count) + "\"!");
+                }
+            }
+            else
+                error("The element \"" + qName + "\" is unknown!");
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java	(revision 1332)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java	(revision 1333)
@@ -9,5 +9,5 @@
     public int realWidth; //the real width of this line in meter
     public Color color;
-    public boolean dashed;
+    public int dashed;
 
     public boolean over;
@@ -54,5 +54,5 @@
         width = 1;
         realWidth = 0;
-        dashed = false;
+        dashed = 0;
         priority = 0;
         color = null;
