Relative Content

Tag Archive for xmlvalidationexceptionpropagationrt.jar

How to propagate SAXExcetion while validating xml using javax.xml.validation.Validator

public boolean validateXML() throws Exception { sepaRTLogger.info(“Entered validateXML()”); Schema schema = listOfXSDs.get(xmlVersion); sepaRTLogger.debug(“matched schema:::” + schema); System.out.println(“matched schema:::” + schema); try { Validator validator = schema.newValidator(); validator.validate((Source) (new StreamSource(XMLStreamForValidation))); } catch (Exception e){ if(e instanceof IOException) { sepaRTLogger.error(“IOException error:”,e); } if(e instanceof SAXException){ sepaRTLogger.error(“SAXException error:”,e); retriggerException.reThrow(msgTagID, null, new SAXException(), e.getMessage(), “TFLT101”); } throw new Exception( […]