Package org.jdom2.output

Examples of org.jdom2.output.XMLOutputter


    }

    // save the configuration file back to the original filename
    try
    {
      XMLOutputter xmlout = new XMLOutputter(Format.getPrettyFormat());
      xmlout.output(worldConfig, new FileOutputStream(worldConfigFile));
    }

    // log errors, report which world did not save
    catch (java.io.IOException e)
    { AutoReferee.log("Could not save world config: " + primaryWorld.getName()); }
View Full Code Here


      version.setText(options.getOptionValue('v'));
    }

    try
    {
      XMLOutputter xmlout = new XMLOutputter(Format.getPrettyFormat());
      File localconfig = new File(world.getWorldFolder(), AutoReferee.CFG_FILENAME);
      xmlout.output(worldConfig, new FileOutputStream(localconfig));
    }
    catch (java.io.IOException e)
    { AutoReferee.log("Could not save world config: " + world.getName()); return true; }

    AutoRefMatch.setupWorld(world, false);
View Full Code Here

            JDOMResult result = new JDOMResult();
            transformer.transform(input, result);
            Document output = result.getDocument();

            XMLOutputter printer = new XMLOutputter(Format.getPrettyFormat());
            printer.output(output, writer);
            writer.flush();

        } catch (Exception ex) {
            throw new TupleQueryResultHandlerException("error while transforming XML results to HTML", ex);
        } finally {
View Full Code Here

            JDOMResult result = new JDOMResult();
            transformer.transform(input,result);
            Document output = result.getDocument();

            XMLOutputter printer = new XMLOutputter(Format.getPrettyFormat());
            printer.output(output, writer);
            writer.flush();
        } catch (Exception ex) {
            throw new IOException("error while transforming XML results to HTML",ex);
        } finally {
            writer.close();
View Full Code Here

    private XmlPrettyPrinter() {
    }

    public static void prettyPrint(Document doc, OutputStream out)
            throws IOException {
        new XMLOutputter(Format.getPrettyFormat()).output(doc, out);
    }
View Full Code Here

      curStud.setAttribute("group", stud.getGroup());
     
      rootElm.addContent(curStud);
    }
   
      XMLOutputter output = new XMLOutputter(Format.getPrettyFormat());
      try {
        FileWriter fw = new FileWriter(BaseName + ".xml");
        output.output(doc, fw);
        fw.close();
      } catch (IOException e) {
        JOptionPane.showMessageDialog(null,
            "error write to "+BaseName+".xml" + "\n" + "error:" + e.getMessage(),
            "Error In/output", JOptionPane.ERROR_MESSAGE);
View Full Code Here

                progressPanel.increment();
                /*
                 * Step 4: write the XML file
                 */
                try {
                    XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
                    FileOutputStream writer = new FileOutputStream(reportPath);
                    outputter.output(kmlDocument, writer);
                    writer.close();
                    Case.getCurrentCase().addReport(reportPath, NbBundle.getMessage(this.getClass(),
                                                                                    "ReportKML.genReport.srcModuleName.text"), "");
                } catch (IOException ex) {
                    logger.log(Level.WARNING, "Could not write the KML file.", ex); //NON-NLS
View Full Code Here

    protected static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S z");

    public Api2XmlConverter()
    {
        xmlOutputter = new XMLOutputter();
        doc = new Document();
        doc.setDocType(new DocType("xml"));
        doc.setProperty("version", "1.0");
        doc.setProperty("encoding", "UTF-8");
    }
View Full Code Here

    protected static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S z");

    public Api1XmlConverter()
    {
        xmlOutputter = new XMLOutputter();
        doc = new Document();
        doc.setDocType(new DocType("xml"));
        doc.setProperty("version", "1.0");
        doc.setProperty("encoding", "UTF-8");
    }
View Full Code Here

            format = Format.getCompactFormat();
        }
        if (encoding != null) {
            format.setEncoding(encoding);
        }
        final XMLOutputter outputter = new XMLOutputter(format);
        return outputter.outputString(doc);
    }
View Full Code Here

TOP

Related Classes of org.jdom2.output.XMLOutputter

Copyright © 2018 www.massapicom. 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.