Index: trunk/data/mappaint-style.xsd
===================================================================
--- trunk/data/mappaint-style.xsd	(revision 9964)
+++ 	(revision )
@@ -1,129 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://josm.openstreetmap.de/mappaint-style-1.0"
-	xmlns:tns="http://josm.openstreetmap.de/mappaint-style-1.0" elementFormDefault="qualified">
-
-	<!--
-		Localized attributes (for example de.description are not supported by
-		xsd, so root element needs <anyAttribute/>
-	-->
-
-	<element name="rules" type="tns:root"/>
-
-	<complexType name="root">
-		<sequence>
-			<choice minOccurs="0" maxOccurs="unbounded">
-				<element name="rule" type="tns:rule" />
-			</choice>
-		</sequence>
-		<attribute name="name" type="string" />
-		<attribute name="author" type="string" />
-		<attribute name="version" type="string" />
-		<attribute name="shortdescription" type="string" />
-		<attribute name="description" type="string" />
-		<attribute name="link" type="string"/>
-		<attribute name="icon" type="string"/>
-
-		<anyAttribute processContents="skip"/>
-	</complexType>
-
-	<!-- TODO: ensure that at least one of results exists, but only one of each element, except for linemod which may have more,
-	scale is totally optional, but each of the two may come only once -->
-	<complexType name="rule">
-		<sequence>
-			<element name="condition" type="tns:condition" minOccurs="1" maxOccurs="unbounded" />
-			<choice minOccurs="1" maxOccurs="unbounded" >
-				<group ref="tns:results" />
-				<group ref="tns:scale" />
-			</choice>
-		</sequence>
-	</complexType>
-
-	<group name="results">
-		<choice>
-			<element name="icon" type="tns:icon" />
-			<element name="area" type="tns:area" />
-			<element name="line" type="tns:line" />
-			<element name="linemod" type="tns:linemod" maxOccurs="unbounded" />
-		</choice>
-	</group>
-
-	<group name="scale">
-		<choice>
-			<element name="scale_min" type="integer" />
-			<element name="scale_max" type="integer" />
-		</choice>
-	</group>
-
-	<complexType name="condition">
-		<!-- TODO restrict to k, k+v or k+b, other attribute combinations are illegal -->
-		<attribute name="k" type="string" use="required" />
-		<attribute name="v" type="string" />
-		<attribute name="b" type="tns:yesno" />
-	</complexType>
-
-	<complexType name="icon">
-		<attribute name="src" type="string" use="required" />
-		<attribute name="annotate" type="boolean" />
-		<attribute name="priority" type="integer" />
-	</complexType>
-
-	<complexType name="line">
-		<attribute name="width" type="integer" />
-		<attribute name="dashed" type="tns:dashed" />
-		<attribute name="realwidth" type="integer" />
-		<attribute name="colour" type="tns:color" />
-		<attribute name="dashedcolour" type="tns:color" />
-		<attribute name="priority" type="integer" />
-	</complexType>
-
-	<complexType name="area">
-		<attribute name="colour" type="tns:color" />
-		<attribute name="closed" type="boolean" />
-		<attribute name="priority" type="integer" />
-	</complexType>
-
-	<complexType name="linemod">
-		<attribute name="dashed" type="tns:dashed" />
-		<attribute name="realwidth" type="integer" />
-		<attribute name="colour" type="tns:color" />
-		<attribute name="dashedcolour" type="tns:color" />
-		<attribute name="mode" type="tns:modifier_mode" use="required" />
-		<attribute name="width" type="tns:width" />
-	</complexType>
-
-	<simpleType name="yesno">
-		<restriction base="string">
-			<enumeration value="yes"/>
-			<enumeration value="no"/>
-		</restriction>
-	</simpleType>
-
-	<simpleType name="dashed">
-		<restriction base="string">
-			<pattern value="\d+(,\d+)*"/>
-			<pattern value="(true|false)"/>
-		</restriction>
-	</simpleType>
-
-	<simpleType name="modifier_mode">
-		<restriction base="string">
-			<enumeration value="under"/>
-			<enumeration value="over"/>
-		</restriction>
-	</simpleType>
-
-	<simpleType name="color">
-		<restriction base="string">
-			<pattern value="([a-z0-9_]+#)?[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?"/>
-			<!-- name#color or color only, where color is 6 or 8 hex digits -->
-		</restriction>
-	</simpleType>
-
-	<simpleType name="width">
-		<restriction base="string">
-			<pattern value="\d+"/>
-			<pattern value="[+-]\d+"/>
-			<pattern value="\d+%"/>
-		</restriction>
-	</simpleType>
-</schema>
Index: trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 9964)
+++ trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 9965)
@@ -1434,36 +1434,4 @@
      */
     private void removeObsolete(int loadedVersion) {
-        // drop this block march 2016
-        // update old style JOSM server links to use zip now, see #10581, #12189
-        // actually also cache and mirror entries should be cleared
-        if (loadedVersion < 9216) {
-            for (String key: new String[]{"mappaint.style.entries", "taggingpreset.entries"}) {
-                Collection<Map<String, String>> data = getListOfStructs(key, (Collection<Map<String, String>>) null);
-                if (data != null) {
-                    List<Map<String, String>> newlist = new ArrayList<>();
-                    boolean modified = false;
-                    for (Map<String, String> map : data) {
-                         Map<String, String> newmap = new LinkedHashMap<>();
-                         for (Entry<String, String> entry : map.entrySet()) {
-                             String val = entry.getValue();
-                             String mkey = entry.getKey();
-                             if ("url".equals(mkey) && val.contains("josm.openstreetmap.de/josmfile") && !val.contains("zip=1")) {
-                                 val += "&zip=1";
-                                 modified = true;
-                             }
-                             if ("url".equals(mkey) && val.contains("http://josm.openstreetmap.de/josmfile")) {
-                                 val = val.replace("http://", "https://");
-                                 modified = true;
-                             }
-                             newmap.put(mkey, val);
-                         }
-                         newlist.add(newmap);
-                    }
-                    if (modified) {
-                        putListOfStructs(key, newlist);
-                    }
-                }
-            }
-        }
         /* drop in October 2016 */
         if (loadedVersion < 9715) {
@@ -1491,4 +1459,23 @@
             }
         }
+        // drop in November 2016
+        if (loadedVersion < 9965) {
+            Setting<?> setting = settingsMap.get("mappaint.style.entries");
+            if (setting != null && setting instanceof MapListSetting) {
+                List<Map<String, String>> l = new LinkedList<>();
+                boolean modified = false;
+                for (Map<String, String> map: ((MapListSetting) setting).getValue()) {
+                    String url = map.get("url");
+                    if (url != null && url.contains("josm.openstreetmap.de/josmfile?page=Styles/LegacyStandard")) {
+                        modified = true;
+                    } else {
+                        l.add(map);
+                    }
+                }
+                if (modified) {
+                    putListOfStructs("mappaint.style.entries", l);
+                }
+            }
+        }
 
         for (String key : OBSOLETE_PREF_KEYS) {
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java	(revision 9964)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java	(revision 9965)
@@ -39,5 +39,4 @@
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.mappaint.Cascade;
-import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement;
 import org.openstreetmap.josm.gui.mappaint.ElemStyles;
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
@@ -47,5 +46,5 @@
 import org.openstreetmap.josm.gui.mappaint.StyleSource;
 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
-import org.openstreetmap.josm.gui.mappaint.xml.XmlStyleSource;
+import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.gui.widgets.JosmTextArea;
@@ -423,7 +422,5 @@
 
     private static String getSort(StyleSource s) {
-        if (s instanceof XmlStyleSource) {
-            return tr("xml");
-        } else if (s instanceof MapCSSStyleSource) {
+        if (s instanceof MapCSSStyleSource) {
             return tr("mapcss");
         } else {
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 9964)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 9965)
@@ -18,4 +18,5 @@
 
 import javax.swing.ImageIcon;
+import javax.swing.JOptionPane;
 import javax.swing.SwingUtilities;
 
@@ -25,14 +26,16 @@
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Tag;
+import org.openstreetmap.josm.gui.HelpAwareOptionPane;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
+import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
 import org.openstreetmap.josm.gui.mappaint.styleelement.MapImage;
 import org.openstreetmap.josm.gui.mappaint.styleelement.NodeElement;
 import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement;
-import org.openstreetmap.josm.gui.mappaint.xml.XmlStyleSource;
 import org.openstreetmap.josm.gui.preferences.SourceEntry;
 import org.openstreetmap.josm.gui.preferences.map.MapPaintPreference.MapPaintPrefHelper;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.io.CachedFile;
+import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Utils;
@@ -46,4 +49,8 @@
  */
 public final class MapPaintStyles {
+
+    /** To remove in November 2016 */
+    private static final String XML_STYLE_MIME_TYPES =
+             "application/xml, text/xml, text/plain; q=0.8, application/zip, application/octet-stream; q=0.5";
 
     private static ElemStyles styles = new ElemStyles();
@@ -280,10 +287,8 @@
 
     private static StyleSource fromSourceEntry(SourceEntry entry) {
-        CachedFile cf = null;
-        try {
-            Set<String> mimes = new HashSet<>();
-            mimes.addAll(Arrays.asList(XmlStyleSource.XML_STYLE_MIME_TYPES.split(", ")));
-            mimes.addAll(Arrays.asList(MapCSSStyleSource.MAPCSS_STYLE_MIME_TYPES.split(", ")));
-            cf = new CachedFile(entry.url).setHttpAccept(Utils.join(", ", mimes));
+        // TODO: Method to clean up in November 2016: remove XML detection completely
+        Set<String> mimes = new HashSet<>(Arrays.asList(MapCSSStyleSource.MAPCSS_STYLE_MIME_TYPES.split(", ")));
+        mimes.addAll(Arrays.asList(XML_STYLE_MIME_TYPES.split(", ")));
+        try (CachedFile cf = new CachedFile(entry.url).setHttpAccept(Utils.join(", ", mimes))) {
             String zipEntryPath = cf.findZipEntryPath("mapcss", "style");
             if (zipEntryPath != null) {
@@ -293,39 +298,37 @@
             }
             zipEntryPath = cf.findZipEntryPath("xml", "style");
-            if (zipEntryPath != null)
-                return new XmlStyleSource(entry);
+            if (zipEntryPath != null || Utils.hasExtension(entry.url, "xml"))
+                throw new IllegalDataException("XML style");
             if (Utils.hasExtension(entry.url, "mapcss"))
                 return new MapCSSStyleSource(entry);
-            if (Utils.hasExtension(entry.url, "xml"))
-                return new XmlStyleSource(entry);
-            else {
-                try (InputStreamReader reader = new InputStreamReader(cf.getInputStream(), StandardCharsets.UTF_8)) {
-                    WHILE: while (true) {
-                        int c = reader.read();
-                        switch (c) {
-                            case -1:
-                                break WHILE;
-                            case ' ':
-                            case '\t':
-                            case '\n':
-                            case '\r':
-                                continue;
-                            case '<':
-                                return new XmlStyleSource(entry);
-                            default:
-                                return new MapCSSStyleSource(entry);
-                        }
+            try (InputStreamReader reader = new InputStreamReader(cf.getInputStream(), StandardCharsets.UTF_8)) {
+                WHILE: while (true) {
+                    int c = reader.read();
+                    switch (c) {
+                        case -1:
+                            break WHILE;
+                        case ' ':
+                        case '\t':
+                        case '\n':
+                        case '\r':
+                            continue;
+                        case '<':
+                            throw new IllegalDataException("XML style");
+                        default:
+                            return new MapCSSStyleSource(entry);
                     }
                 }
-                Main.warn("Could not detect style type. Using default (xml).");
-                return new XmlStyleSource(entry);
-            }
+            }
+            Main.warn("Could not detect style type. Using default (mapcss).");
+            return new MapCSSStyleSource(entry);
         } catch (IOException e) {
             Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", entry.url, e.toString()));
             Main.error(e);
-        } finally {
-            if (cf != null) {
-                cf.close();
-            }
+        } catch (IllegalDataException e) {
+            String msg = tr("JOSM does no longer support mappaint styles written in the old XML format.\nPlease update ''{0}'' to MapCSS",
+                    entry.url);
+            Main.error(msg);
+            HelpAwareOptionPane.showOptionDialog(Main.parent, msg, tr("Warning"), JOptionPane.WARNING_MESSAGE,
+                    HelpUtil.ht("/Styles/MapCSSImplementation"));
         }
         return null;
Index: trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 9964)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 9965)
@@ -1390,4 +1390,10 @@
                 }
                 readFile();
+                for (Iterator<ExtendedSourceEntry> it = sources.iterator(); it.hasNext();) {
+                    if ("xml".equals(it.next().styleType)) {
+                        Main.debug("Removing XML source entry");
+                        it.remove();
+                    }
+                }
             } catch (IOException e) {
                 if (canceled)
