/** * Processes XML * * @param strXML * XML string * @param isGGTOrDefaults * whether to treat the XML as defaults * @param info * EvalInfo (can be null) * @throws Exception * on trouble with parsing or running commands */ final public synchronized void processXML(String strXML, boolean isGGTOrDefaults, EvalInfo info) throws Exception { boolean randomize = info == null || info.updateRandom(); construction.setFileLoading(true); construction.setCasCellUpdate(true); construction.getXMLio().processXMLString(strXML, true, isGGTOrDefaults, true, randomize); construction.setFileLoading(false); construction.setCasCellUpdate(false); }
/** * Tries to build the new construction from the given XML string. */ private void buildConstruction(StringBuilder consXML, String oldXML, EvalInfo info) throws Exception { // try to process the new construction try { ensureUndoManagerExists(); undoManager.processXML(consXML.toString(), false, info); kernel.notifyReset(); // Update construction is done during parsing XML // kernel.updateConstruction(); } catch (Exception e) { restoreAfterRedefine(oldXML); throw e; } catch (MyError err) { restoreAfterRedefine(oldXML); throw err; } if (kernel.getConstruction().getXMLio().hasErrors()) { restoreAfterRedefine(oldXML); throw new MyError(getApplication().getLocalization(), "ReplaceFailed"); } }