Examples of OutputFormat


Examples of org.apache.xml.serialize.OutputFormat

    payload.appendChild(request);

    requestXml.appendChild(envelope);

    StringWriter out = new StringWriter();
    XMLSerializer serializer = new XMLSerializer(out, new OutputFormat(
        requestXml));
    serializer.serialize(requestXml);
    String xmlRequest = out.toString();
    spooler_log_debug3(xmlRequest);
    return xmlRequest;
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

          orderElement.removeChild(child);
        }
      }

      StringWriter out = new StringWriter();
      OutputFormat format = new OutputFormat(orderDoc);
      XMLSerializer serializer = new XMLSerializer(out, format);
      serializer.serialize(orderDoc);
      out.close();

      executeCommandOnOneOrAllSchedulers(host, port, out.toString());
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

    try {
      getLogger().debug("writing " + file.getAbsolutePath());
      OutputStream fout = new FileOutputStream(file, false);
      OutputStreamWriter out = new OutputStreamWriter(fout, "UTF-8");
      OutputFormat format = new OutputFormat(xml);
      format.setEncoding("UTF-8");
      format.setIndenting(true);
      format.setIndent(2);
      XMLSerializer serializer = new XMLSerializer(out, format);
      serializer.serialize(xml);
      out.close();
      if (!isWindows() && !startscript) {
        // notify Job Scheduler
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

          else  getLog().debug3("ignore_runtime: No");
      
         
         
        StringWriter out = new StringWriter();
        XMLSerializer serializer = new XMLSerializer(out, new OutputFormat(xmlDoc));
        serializer.serialize(xmlDoc);
        getLog().info("adding order [" + scheduler_order_id + "] to job chain [" + scheduler_order_job_chain + "]: ");
        getLog().debug3(out.toString());

        return  out.toString();
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

      SOSFile.copyFile(resultFile, resultLogFile);
      File eventFile = new File(stylesheetLogDir, "events_" + timeStamp + ".xml");
      // write current events to eventFile
      OutputStream fout = new FileOutputStream(eventFile, false);
      OutputStreamWriter out = new OutputStreamWriter(fout, "UTF-8");
      OutputFormat format = new OutputFormat(getEvents());
      format.setEncoding("UTF-8");
      format.setIndenting(true);
      format.setIndent(2);
      XMLSerializer serializer = new XMLSerializer(out, format);
      serializer.serialize(getEvents());
      out.close();
      getLogger().debug("current events logged to: " + eventFile.getAbsolutePath());
      getLogger().debug("transformation result logged to: " + resultLogFile.getAbsolutePath());
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

      DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
      DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
      Document document = docBuilder.newDocument();
      document.appendChild(document.importNode(node, true));
      StringWriter out = new StringWriter();
      XMLSerializer serializer = new XMLSerializer(out, new OutputFormat(document));
      serializer.serialize(document);
      return out.toString();
    }
    catch (Exception e) {
      throw new Exception("error occurred transforming node: " + e.getMessage());
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

   * return XML String
   */
  public String xmlDocumentToString(Document document) throws Exception {
    try {
      StringWriter out = new StringWriter();
      XMLSerializer serializer = new XMLSerializer(out, new OutputFormat(document));
      serializer.serialize(document);
      return out.toString();
    }
    catch (Exception e) {
      throw new Exception("error occurred transforming document: " + e.getMessage());
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

   * return XML String
   */
  public String xmlElementToString(Element element) throws Exception {
    try {
      StringWriter out = new StringWriter();
      XMLSerializer serializer = new XMLSerializer(out, new OutputFormat());
      serializer.serialize(element);
      return out.toString();
    }
    catch (Exception e) {
      throw new Exception("error occurred transforming document: " + e.getMessage());
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

        addNode(tempDocument, tempRootElement, tempRootNode);
        tempDocument.appendChild(tempRootElement);
       
        // write the XML Document
        File tempFile = new File(inFileName);
        OutputFormat    format  = new OutputFormat( tempDocument );   //Serialize DOM
        format.setIndenting(true);
        format.setLineSeparator("\n");
        FileWriter  fout = new FileWriter(tempFile);        //Writer will be a String
        XMLSerializer    serial = new XMLSerializer( fout, format );
        serial.asDOMSerializer();                            // As a DOM Serializer
        serial.serialize( tempDocument.getDocumentElement() );
        fout.close();
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

        addNode(tempDocument, tempRootElement, tempRootNode);
        tempDocument.appendChild(tempRootElement);
       
        // write the XML Document
        File tempFile = new File(inFileName);
        OutputFormat    format  = new OutputFormat( tempDocument );   //Serialize DOM
        format.setIndenting(true);
        format.setLineSeparator("\n");
        FileWriter  fout = new FileWriter(tempFile);        //Writer will be a String
        XMLSerializer    serial = new XMLSerializer( fout, format );
        serial.asDOMSerializer();                            // As a DOM Serializer
        serial.serialize( tempDocument.getDocumentElement() );
        fout.close();
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.