Author: jleroux
Date: Tue Feb 24 22:59:45 2009
New Revision: 747596
URL:
http://svn.apache.org/viewvc?rev=747596&view=revLog:
Prevent false warnings in case of ${.*} syntax
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java?rev=747596&r1=747595&r2=747596&view=diff==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java Tue Feb 24 22:59:45 2009
@@ -28,6 +28,8 @@
import java.net.URL;
import java.util.List;
import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -691,13 +693,16 @@
}
public void error(SAXParseException exception) {
- if (localResolver.hasDTD()) {
+ String exceptionMessage = exception.getMessage();
+ Pattern valueFlexExpr = Pattern.compile("value '\\$\\{.*\\}'");
+ Matcher matcher = valueFlexExpr.matcher(exceptionMessage.toLowerCase());
+ if (localResolver.hasDTD() && !matcher.find()) {
Debug.logError("XmlFileLoader: File "
+ docDescription
+ " process error. Line: "
+ String.valueOf(exception.getLineNumber())
+ ". Error message: "
- + exception.getMessage(), module
+ + exceptionMessage, module
);
}
}