Package org.jdom.output

Examples of org.jdom.output.XMLOutputter.output()


      format.setEncoding("UTF-8");
      try {
         setStatusMessage("writing swapped.xml");
         XMLOutputter xmlOut = new XMLOutputter(format);
         FileOutputStream fos = new FileOutputStream(processDirectory + File.separator + "swapped.xml");
         xmlOut.output(doc, fos);
         fos.close();
         //TODO: Don't catch Exception (the super class)
      } catch (Exception e) {
        logger.warn("Exception:", e);
         setStatusMessage(e.getClass().getName() + " in xmlOut.output: " + e.getMessage());
View Full Code Here


                    Document doc = AtomService.serviceToDocument(service);
                    res.setContentType("application/atomsvc+xml; charset=utf-8");
                    Writer writer = res.getWriter();
                    XMLOutputter outputter = new XMLOutputter();
                    outputter.setFormat(Format.getPrettyFormat());
                    outputter.output(doc, writer);
                    writer.close();
                    res.setStatus(HttpServletResponse.SC_OK);
                }
                else if (handler.isCollectionURI(pathInfo)) {
                    // return a collection
View Full Code Here

                    Document feedDoc = wireFeedOutput.outputJDom(col);
                    res.setContentType("application/atom+xml; charset=utf-8");
                    Writer writer = res.getWriter();
                    XMLOutputter outputter = new XMLOutputter();
                    outputter.setFormat(Format.getPrettyFormat());
                    outputter.output(feedDoc, writer);
                    writer.close();
                    res.setStatus(HttpServletResponse.SC_OK);
                }
                else if (handler.isEntryURI(pathInfo)) {
                    // return an entry
View Full Code Here

        XMLOutputter outputter = new XMLOutputter();
        outputter.setFormat(Format.getPrettyFormat());
       
        if (log.isDebugEnabled()) {
            StringWriter sw = new StringWriter();
            outputter.output(entryElement, sw);
            log.debug(sw.toString());
            writer.write(sw.toString());
        } else {
            outputter.output(entryElement, writer);
        }
View Full Code Here

            StringWriter sw = new StringWriter();
            outputter.output(entryElement, sw);
            log.debug(sw.toString());
            writer.write(sw.toString());
        } else {
            outputter.output(entryElement, writer);
        }
    }
   
    /**
     * Parse entry from reader.
View Full Code Here

  private void debugMyNode(Node inNode, String fileName) {
    try {
      XMLOutputter outputter = new XMLOutputter();
      Document tempDoc = new DOMBuilder().build(inNode.getOwnerDocument());
      FileOutputStream output = new FileOutputStream(fileName);
      outputter.output(tempDoc.getRootElement(), output);
    } catch (FileNotFoundException e) {
      myLogger.error("debugMyNode(Node, String)", e);
    } catch (IOException e) {
      myLogger.error("debugMyNode(Node, String)", e);
    }
View Full Code Here

            }
        });

        XMLOutputter xml = new XMLOutputter();
        xml.setFormat(Format.getPrettyFormat());
        xml.output(changesDoc, new FileWriter(changesXmlFile));

    }

    private Element findOrCreateReleaseElement(Element bodyElement, String relVersion) {
        List<Element> releases = bodyElement.getChildren("release");
View Full Code Here

            XmlOutputBuilder xmlOutputBuilder = createXmlOutputBuilder();
            xmlOutputBuilder.setDocument(document);
            xmlOutputBuilder.setSolution(solution);
            xmlOutputBuilder.writeSolution();
            XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
            outputter.output(document, out);
        } catch (IOException e) {
            throw new IllegalArgumentException("Could not write the file (" + outputFile.getName() + ").", e);
        } catch (JDOMException e) {
            throw new IllegalArgumentException("Could not format the XML file (" + outputFile.getName() + ").", e);
        } finally {
View Full Code Here

                }
                public String escapeElementEntities(String str) {
                    return StringEscapeUtils.escapeXml(str);
                }
            };
            outp.output(doc, osw);
            fos.close();
        }
    }

    protected Element getElementForLocale(List<Element> elements, Locale l) {
View Full Code Here

     */
    private void  sendResult (org.jdom.Document responseDoc)
        throws org.jdom.JDOMException, IOException
    {
        XMLOutputter xmlWriter = new XMLOutputter (XML_REPONSE_INDENT, true);
        xmlWriter.output (responseDoc, resp.getWriter());
    }
   
    /**
     * Method createErrorResult
     *
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.