Package org.jdom2.output

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


            // rewrite DOM as a string to find differences, since text outside the root element is not tracked
            StringWriter w = new StringWriter();
            Format format = Format.getRawFormat();
            format.setLineSeparator( ls );
            XMLOutputter out = new XMLOutputter( format );
            out.output( document.getRootElement(), w );

            int index = content.indexOf( w.toString() );
            if ( index >= 0 )
            {
                intro = content.substring( 0, index );
View Full Code Here


    try
    {
      XMLOutputter xmlout = new XMLOutputter(Format.getPrettyFormat());
      File dataFolder = new File(primaryWorld.getWorldFolder(), "data");
      xmlout.output(sbroot, new FileOutputStream(new File(dataFolder, "scoreboard.xml")));
    }
    catch (java.io.IOException e)
    { AutoReferee.log("Could not save scoreboard data: " + primaryWorld.getName()); }
  }
View Full Code Here

    // 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

    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

    }
   
      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

                 * 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

        }
        if (encoding != null) {
            format.setEncoding(encoding);
        }
        final XMLOutputter outputter = new XMLOutputter(format);
        outputter.output(doc, writer);
    }

    /**
     * Creates a W3C DOM document for the given WireFeed.
     * <p>
 
View Full Code Here

        // Grab entry element from feed and get JDOM to serialize it
        final Element entryElement = feedDoc.getRootElement().getChildren().get(0);

        final XMLOutputter outputter = new XMLOutputter();
        outputter.output(entryElement, writer);
    }

}
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.