IDEA-26409 Major regression (‚Äčagain‚Äč): valid XML with schemas gives errors
authorMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Mon, 7 Dec 2009 12:50:10 +0000 (15:50 +0300)
committerMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Mon, 7 Dec 2009 12:50:10 +0000 (15:50 +0300)
xml/impl/src/com/intellij/xml/actions/ValidateXmlActionHandler.java
xml/impl/src/com/intellij/xml/util/XmlResourceResolver.java

index 13d808f4e55323e1e9e9415ac6d0aea628187bb8..341739dfd375bf1f707a2c5034c570b8c9c66102 100644 (file)
@@ -497,7 +497,10 @@ public class ValidateXmlActionHandler implements Function<PsiFile, Void> {
         if (schemaChecking) {
           parser.setProperty(JAXPConstants.JAXP_SCHEMA_LANGUAGE,JAXPConstants.W3C_XML_SCHEMA);
           parser.getXMLReader().setFeature(SCHEMA_FULL_CHECKING_FEATURE_ID, true);
-          parser.getXMLReader().setFeature("http://apache.org/xml/features/honour-all-schemaLocations", true);
+          
+          if (Boolean.TRUE.equals(Boolean.getBoolean(XmlResourceResolver.HONOUR_ALL_SCHEMA_LOCATIONS_PROPERTY_KEY))) {
+            parser.getXMLReader().setFeature("http://apache.org/xml/features/honour-all-schemaLocations", true);
+          }
 
           parser.getXMLReader().setFeature("http://apache.org/xml/features/validation/warn-on-undeclared-elemdef",Boolean.TRUE);
           parser.getXMLReader().setFeature("http://apache.org/xml/features/validation/warn-on-duplicate-attdef",Boolean.TRUE);
index 11fdea2a04512b39b38109f6abc6660bac1f3a91..5a792b6649f93af5313854796be2a62fa41ee901 100644 (file)
@@ -64,7 +64,7 @@ public class XmlResourceResolver implements XMLEntityResolver {
   private final Map<String,String> myExternalResourcesMap = new HashMap<String, String>(1);
   private boolean myStopOnUnDeclaredResource;
   @NonNls
-  public static final String FILE_PREFIX = "file://";
+  public static final String HONOUR_ALL_SCHEMA_LOCATIONS_PROPERTY_KEY = "idea.xml.honour.all.schema.locations";
   private final ValidateXmlActionHandler.ErrorReporter myErrorReporter;
 
   public XmlResourceResolver(XmlFile _xmlFile, Project _project, final ValidateXmlActionHandler.ErrorReporter errorReporter) {