From 453bd7f12223fe4e58049bb8f2f40d80d80bccd7 Mon Sep 17 00:00:00 2001 From: kstranacher Date: Tue, 7 Feb 2012 16:15:24 +0000 Subject: =?UTF-8?q?*=20Alte=20MOCCA=20Signaturen=20wieder=20pr=C3=BCfbar?= =?UTF-8?q?=20(Parsererror=20fehlendes=20Target=20Attribut=20in=20Qualifyi?= =?UTF-8?q?ngProperties=20wird=20ignoriert)=20*=20Update=20MOA=20Template?= =?UTF-8?q?=20f=C3=BCr=20B=C3=BCrgerkartenauswahl=20(No-Script-Variante,?= =?UTF-8?q?=20Update=20Bilder=20und=20Text)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@1235 d688527b-c9ab-4aba-bd8d-4036d912da1d --- common/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java | 4 +++- .../main/java/at/gv/egovernment/moa/util/MOAErrorHandler.java | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'common/src/main/java/at/gv') 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; } /** -- cgit v1.2.3