Examples of OutputFormat


Examples of org.dom4j.io.OutputFormat

    return document;
 
  public void serializetoXML(OutputStream out, String aEncodingScheme, Document doc)
      throws Exception {
    OutputFormat outformat = OutputFormat.createPrettyPrint();
    outformat.setXHTML(true);
    outformat.setEncoding(aEncodingScheme);
    XMLWriter writer = new XMLWriter(out, outformat);
    writer.write(doc);
    writer.flush();
    writer.close();
    out.close();
View Full Code Here

Examples of org.dom4j.io.OutputFormat

   *            xml File to write
   * @throws IOException
   */
  public static void writeXmlFile(Document domDoc, File outFile) throws IOException {
    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(outFile));
    OutputFormat format = OutputFormat.createPrettyPrint();
    format.setEncoding("UTF-8");
    XMLWriter xmlFileWriter = new XMLWriter(bos, format);
    xmlFileWriter.write(domDoc);
    xmlFileWriter.flush();
    xmlFileWriter.close();
  }
View Full Code Here

Examples of org.dom4j.io.OutputFormat

            node.addAttribute("name", plugablePanel.getPluginName());
            plugablePanel.getJobNode(node, savePasswords);
            LOG.info(GettextResource.gettext(i18nMessages, plugablePanel.getPluginName()+ " node environment loaded."));
          }
          BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(outFile));
          OutputFormat format = OutputFormat.createPrettyPrint();
          format.setEncoding("UTF-8");
          XMLWriter xmlWriter = new XMLWriter(bos, format);
          xmlWriter.write(document);
          xmlWriter.flush();
          xmlWriter.close();
        }
View Full Code Here

Examples of org.exolab.castor.xml.OutputFormat

     */
    public static OutputFormat getOutputFormat(final AbstractProperties properties) {

        boolean indent = properties.getBoolean(XMLProperties.USE_INDENTATION, false);

        OutputFormat format = getSerializerFactory(
                properties.getString(XMLProperties.SERIALIZER_FACTORY)).getOutputFormat();
        format.setMethod(OutputFormat.XML);
        format.setIndenting(indent);
       
        // There is a bad interaction between the indentation and the
        // setPreserveSpace option. The indentated output is strangely indented.
        if (!indent) {
            format.setPreserveSpace(true);
        }

        return format;
    } //-- getOutputFormat
View Full Code Here

Examples of org.jasig.portal.serialize.OutputFormat

                log.error("unable to obtain proper markup serializer : ", e);
            }

            if (serOut == null) {
                // default to XML serializer
                final OutputFormat frmt = new OutputFormat("XML", "UTF-8", true);
                serOut = new XMLSerializer(printWriter, frmt);
            }

            localRenderXML(serOut);
        }
View Full Code Here

Examples of org.mapfish.print.output.OutputFormat

        PJsonObject specJson = MapPrinter.parseSpec(jsonConfig);
        if (Log.isDebugEnabled(LOGGER_NAME)) {
            Log.debug(LOGGER_NAME, "Generating thumbnail from config: " +
                jsonConfig);
        }
        final OutputFormat outputFormat =
                getMapPrinter().getOutputFormat(specJson);

        File tempFile = File.createTempFile("thumbnail",
                "." + outputFormat.getFileSuffix());
        FileOutputStream out = null;
        try {
            out = new FileOutputStream(tempFile);
            PrintParams params = new PrintParams(
                    getMapPrinter().getConfig(),
                    configFile.getParentFile(),
                    specJson,
                    out,
                    new HashMap<String, String>());
            outputFormat.print(params);
        } catch (IOException e) {
            throw e;
        } catch (InterruptedException e) {
            e.printStackTrace();
        } finally {
            if (out != null) {
                out.close();
            }
        }

        if (rotationAngle != null) {
            rotate(tempFile, outputFormat.getFileSuffix(), rotationAngle);
        }
        return tempFile;
    }
View Full Code Here

Examples of org.openinvoice.ubl4j.core.common.text.OutputFormat

        }
        return outFile;
    }

    public OutputFormat parseCommandlineOutputFormat() throws UBL4JException {
        OutputFormat outputFormat = null;
        String outputFormatStr = options.outputFormat;
        if (outputFormatStr != null) {
            try {
                outputFormat = OutputFormat.valueOf(outputFormatStr.toUpperCase());
            } catch (IllegalArgumentException e) {
View Full Code Here

Examples of org.xooof.xmlserializer.OutputFormat

   }

   static public void xsToXMLWriter(XmlStruct xmlStruct, Writer writer, SerializationOptions serializationOptions)
   throws IOException, SAXException, XmlStructException
   {
       OutputFormat of = new OutputFormat("XML", null, false);
       of.setPreserveSpace(true);
       of.setOmitXMLDeclaration(true);
       XMLSerializer serializer = new XMLSerializer(writer, of);
       ContentHandler ch = serializer.asContentHandler();
       ch.startDocument();
       xmlStruct.xsToSAX(ch,serializationOptions);
       ch.endDocument();
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.