Examples of OutputFormat


Examples of org.apache.xml.serialize.OutputFormat

        StringWriter tXMLWriter = new StringWriter();

        try
        {
            // a serializer
            OutputFormat outputFormat = new OutputFormat( mXMLDocument, null, true );   //@XERCES
            outputFormat.setEncoding(mEncoding);                                        //@XERCES
            XMLSerializer ser = new XMLSerializer( tXMLWriter, outputFormat );          //@XERCES
            ser.serialize( mXMLDocument );                                              //@XERCES
        }
        catch( IOException e )
        {
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

    factory.setExpandEntityReferences(true);
    return factory.newDocumentBuilder().parse(new InputSource(source));
  }
 
  public static void write(Document doc, Writer writer) throws IOException {
    OutputFormat format = new OutputFormat();
    format.setIndenting(INDENTING);
    XMLSerializer serializer = new XMLSerializer(format);
    serializer.setNamespaces(true);
    serializer.setOutputCharStream(writer);
    serializer.serialize(doc);
  }
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

    serializer.setOutputCharStream(writer);
    serializer.serialize(doc);
  }

  public static void write(Element elem, Writer writer) throws IOException {
    OutputFormat format = new OutputFormat();
    format.setIndenting(INDENTING);
    XMLSerializer serializer = new XMLSerializer(format);
    serializer.setNamespaces(true);
    serializer.setOutputCharStream(writer);
    serializer.serialize(elem);
  }
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

    String jobName = "";   
    try{
      Element updatedJob = updatedJobDoc.getDocumentElement();
      jobName = updatedJob.getAttribute("name");     
      StringWriter out = new StringWriter();
      OutputFormat format = new OutputFormat(updatedJobDoc);
      format.setEncoding("ISO-8859-1");
      format.setIndenting(true);
      format.setIndent(2);
          XMLSerializer serializer = new XMLSerializer(out, format);
          serializer.serialize(updatedJobDoc);
          logger.debug3("submitting job... ");
          logger.debug9(out.toString());
          String answer = spooler.execute_xml(out.toString());
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

      String fileName = normalizeJobName(jobName);
      updatedJob.removeAttribute("name");
      jobFile = new File(schedulerCronConfigurationDir, fileName+".job.xml");
      OutputStream fout = new FileOutputStream(jobFile,false);         
          OutputStreamWriter out = new OutputStreamWriter(fout, "UTF-8");
      OutputFormat format = new OutputFormat(updatedJobDoc);
      format.setEncoding("UTF-8");
      format.setIndenting(true);
      format.setIndent(2);
          XMLSerializer serializer = new XMLSerializer(out, format);
          logger.debug3("Writing file "+jobFile.getAbsolutePath());
          serializer.serialize(updatedJobDoc);
          out.close();
    } catch (Exception e){
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

    try{
      Document configurationDocument = cronFile2SchedulerXML(cronFile, new HashMap());
      logger.debug("writing "+schedulerXML.getAbsolutePath());
      OutputStream fout = new FileOutputStream(schedulerXML,false);         
          OutputStreamWriter out = new OutputStreamWriter(fout, "UTF-8");
      OutputFormat format = new OutputFormat(configurationDocument);
      format.setEncoding("UTF-8");
      format.setIndenting(true);
      format.setIndent(2);
          XMLSerializer serializer = new XMLSerializer(out, format);
          serializer.serialize(configurationDocument);
          out.close();
    } catch (Exception e){
      throw new Exception ("Error writing Job Scheduler configuration file: "+e,e);
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

        // can later be deleted (keep only else branch)
        usedNewRunTime = false;
        Document runTimeDocument = docBuilder.newDocument();
        runTimeDocument.appendChild(runTimeDocument.importNode(runTimeElement, true));
        StringWriter out = new StringWriter();
        OutputFormat format = new OutputFormat(runTimeDocument);   
        format.setIndenting(true);
        format.setIndent(2);
        format.setOmitXMLDeclaration(true);
            XMLSerializer serializer = new XMLSerializer(out, format);
            serializer.serialize(runTimeDocument);
            Comment runTimeComment = jobDoc.createComment("This run_time is currently not supported:\n"+out.toString());
            jobElement.appendChild(runTimeComment);
      } else{
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

              String name = keyIterator.next().toString();
              String value = eventParameters.get(name).toString();
              addParam(paramsElement, name, value);
            }
            StringWriter out = new StringWriter();
            OutputFormat of = new OutputFormat(addOrderDocument);
            of.setEncoding("iso-8859-1");
            XMLSerializer serializer = new XMLSerializer(out, of);
            serializer.serialize(addOrderDocument);
            return out.toString();
    } catch (Exception e) {
      throw new Exception("Error creating add_order xml: "+e,e);
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

              //    writer.write( data_node.getTextContent() );   // getTextContent() ist erst in einer neueren Version vorhanden
              //}
              //else
                if( data_element != null ) //  &&  data_element.getNodeType() == Node.ELEMENT_NODE )
                {
                    new XMLSerializer( output_stream, new OutputFormat( service_request_element.getOwnerDocument(), encoding, false ) )
                    .serialize( data_element );
                }
                else
                    throw new Order_exception( "<content> enthält kein Element" );
                    //throw new Order_exception( "<content> enthält kein Element und keinen Text" );
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

           
            OutputStream        output_stream = http_connection.getOutputStream();
            //OutputStreamWriter  writer        = new OutputStreamWriter( output_stream, encoding );

            Element data_element = get_data_element( service_request_element );
            new XMLSerializer( output_stream, new OutputFormat( service_request_element.getOwnerDocument(), encoding, false ) )
            .serialize( data_element );
           
            //writer.write( "<?xml version='1.0'?>\n" );
            //writer.write( "<my_request>bla äöü </my_request>\n" );
            //writer.flush();
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.