Author: scabanovich
Date: 2007-09-18 08:24:38 -0400 (Tue, 18 Sep 2007)
New Revision: 3683
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EntityXMLRegistration.java
Log:
JBIDE-898
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java 2007-09-18
12:22:34 UTC (rev 3682)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java 2007-09-18
12:24:38 UTC (rev 3683)
@@ -131,6 +131,7 @@
set("isIncorrect", "yes");
// setErrors(value, hasDTD(), !hasDTD()); //never validate dtd
int resolution =
EntityXMLRegistration.getInstance().resolve(getModelEntity());
+ if(EntityXMLRegistration.isSystemId(value)) resolution =
EntityXMLRegistration.UNRESOLVED;
setErrors(value, resolution == EntityXMLRegistration.DTD, resolution ==
EntityXMLRegistration.SCHEMA);
}
}
@@ -232,6 +233,7 @@
loaderError = null;
// setErrors(body, hasDTD(), !hasDTD()); //never validate dtd
int resolution = EntityXMLRegistration.getInstance().resolve(getModelEntity());
+ if(EntityXMLRegistration.isSystemId(body)) resolution =
EntityXMLRegistration.UNRESOLVED;
setErrors(body, resolution == EntityXMLRegistration.DTD, resolution ==
EntityXMLRegistration.SCHEMA);
boolean errors2 = (get("errors") != null &&
get("errors").length() > 0);
if(errors1 && errors2) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EntityXMLRegistration.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EntityXMLRegistration.java 2007-09-18
12:22:34 UTC (rev 3682)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EntityXMLRegistration.java 2007-09-18
12:24:38 UTC (rev 3683)
@@ -87,4 +87,14 @@
return SCHEMA;
}
+ public static boolean isSystemId(String body) {
+ if(body == null) return false;
+ int i = body.indexOf("<!DOCTYPE");
+ if(i < 0) return false;
+ int j = body.indexOf(">", i);
+ if(j < 0) return false;
+ String dt = body.substring(i, j);
+ return (dt.indexOf("SYSTEM") > 0);
+ }
+
}