@Override public void changed(ChangeEvent event, Actor actor) { String selChapter = (String) chapters.getSelected(); if (selChapter != null && !selChapter.equals(Ctx.project.getSelectedChapter().getId())) { // Save the project when changing chapter try { Ctx.project.saveProject(); } catch (IOException | TransformerException e1) { Ctx.msg.show(getStage(), "Error saving project", 3); EditorLogger.error(e1.getMessage()); } try { if (selChapter != null) Ctx.project.loadChapter(selChapter); doc = Ctx.project.getSelectedChapter(); addElements(doc, doc.getElement(), "scene"); } catch (ParserConfigurationException | SAXException | IOException e1) { e1.printStackTrace(); } } }
public void validate(String request, String xsd) throws SoapExceptionServer, SoapExceptionClient { try { SOAPBody soapBody = getSOAPBody(request); Source xmlSource = createSource(soapBody); Validator validator = createValidator(xsd); validator.validate(xmlSource); } catch (SAXException saxParseEx) { throw new SoapExceptionClient(saxParseEx.getLocalizedMessage(), saxParseEx); } catch (SoapExceptionClient clientEx) { throw clientEx; } catch (IOException | TransformerException ex) { throw new SoapExceptionServer("Error while validating soap-message.", ex.getMessage(), ex); } }