List of usage examples for org.jdom2 Document clone
@Override
public Document clone()
Document
. From source file:org.mycore.frontend.xeditor.target.MCRDebugTarget.java
License:Open Source License
@Override public void handleSubmission(ServletContext context, MCRServletJob job, MCREditorSession session, String parameter) throws Exception { job.getResponse().setContentType("text/html; charset=UTF-8"); PrintWriter out = job.getResponse().getWriter(); out.println("<html><body>"); Map<String, String[]> parameters = job.getRequest().getParameterMap(); session.getSubmission().setSubmittedValues(parameters); Document result = session.getEditedXML().clone(); MCRChangeTracker tracker = session.getChangeTracker().clone(); List<Step> steps = new ArrayList<Step>(); for (String label; (label = tracker.undoLastBreakpoint(result)) != null;) steps.add(0, new Step(label, result.clone())); result = session.getEditedXML().clone(); result = MCRChangeTracker.removeChangeTracking(result); result = session.getXMLCleaner().clean(result); steps.add(new Step("After cleaning", result)); result = session.getPostProcessor().process(result); steps.add(new Step("After postprocessing", result)); for (int i = 0; i < steps.size(); i++) { if (i == steps.size() - 3) outputParameters(parameters, out); steps.get(i).output(out);/*from w w w.ja va 2s .c om*/ } out.println("</body></html>"); out.close(); }