aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java4
-rw-r--r--common/src/main/java/at/gv/egovernment/moa/util/MOAErrorHandler.java10
-rw-r--r--common/src/main/resources/resources/properties/common_messages_de.properties1
3 files changed, 12 insertions, 3 deletions
diff --git a/common/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java
index 316dee3b8..a3416d44a 100644
--- a/common/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java
+++ b/common/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java
@@ -271,7 +271,7 @@ public class DOMUtils {
if(null != baStream)
parser.parse(new InputSource(baStream));
else
- parser.parse(new InputSource(inputStream));
+ parser.parse(new InputSource(inputStream));
} catch(SAXException e) {
if(true == Logger.isDebugEnabled() && null != buffer) {
String xmlContent = new String(buffer);
@@ -353,6 +353,8 @@ public class DOMUtils {
String externalNoNamespaceSchemaLocation)
throws SAXException, IOException, ParserConfigurationException {
+
+
return parseDocument(
inputStream,
validating,
diff --git a/common/src/main/java/at/gv/egovernment/moa/util/MOAErrorHandler.java b/common/src/main/java/at/gv/egovernment/moa/util/MOAErrorHandler.java
index ba253edb5..3769b264d 100644
--- a/common/src/main/java/at/gv/egovernment/moa/util/MOAErrorHandler.java
+++ b/common/src/main/java/at/gv/egovernment/moa/util/MOAErrorHandler.java
@@ -41,6 +41,7 @@ import at.gv.egovernment.moa.logging.Logger;
*/
public class MOAErrorHandler extends DefaultErrorHandler {
+
/**
* Logs a warning message.
*
@@ -56,8 +57,13 @@ public class MOAErrorHandler extends DefaultErrorHandler {
* @see org.xml.sax.ErrorHandler#error(SAXParseException)
*/
public void error(SAXParseException exception) throws SAXException {
- warn("parser.01", messageParams(exception), null);
- throw exception;
+ warn("parser.01", messageParams(exception), null);
+
+ // if Target attribute is missing in QualifyingProperties - don't throw exception (bug fix for old MOCCA signatures)
+ if (exception.getMessage().startsWith("cvc-complex-type.4: Attribute 'Target' must appear on element"))
+ warn("parser.04", new Object[] {"Attribute 'Target' must appear on element 'QualifyingProperties' - ignored for compatibility reasons."}, null);
+ else
+ throw exception;
}
/**
diff --git a/common/src/main/resources/resources/properties/common_messages_de.properties b/common/src/main/resources/resources/properties/common_messages_de.properties
index ac05b7996..a58d07625 100644
--- a/common/src/main/resources/resources/properties/common_messages_de.properties
+++ b/common/src/main/resources/resources/properties/common_messages_de.properties
@@ -10,6 +10,7 @@
parser.00=Leichter Fehler beim Parsen: {0}, SystemID={1}, Zeile={2}, Spalte={3}
parser.01=Fehler beim Parsen: {0}, SystemID={1}, Zeile={2}, Spalte={3}
parser.02=Schwerer Fehler beim Parsen: {0}, SystemID={1}, Zeile={2}, Spalte={3}
+parser.04=Fehler beim Parsen: {0}
xpath.00=Fehler beim Auswerten des XPath-Ausdruckes: {0}