diff options
Diffstat (limited to 'common/src/main/java/at/gv/egovernment/moa')
-rw-r--r-- | common/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java | 4 | ||||
-rw-r--r-- | common/src/main/java/at/gv/egovernment/moa/util/MOAErrorHandler.java | 10 |
2 files changed, 11 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; } /** |