Package org.dom4j.io

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


        document.addDocType( "beans", "-//SPRING//DTD BEAN//EN", //$NON-NLS-1$ //$NON-NLS-2$
            "http://www.springframework.org/dtd/spring-beans.dtd" ); //$NON-NLS-1$

        // Creating the output stream we're going to put the XML in
        OutputStream os = new ByteArrayOutputStream();
        OutputFormat outformat = OutputFormat.createPrettyPrint();
        outformat.setEncoding( "UTF-8" ); //$NON-NLS-1$

        // Writing the XML.
        XMLWriter writer = new XMLWriter( os, outformat );
        writer.write( document );
        writer.flush();
View Full Code Here

        // CustomEditorConfigurer Bean
        createCustomEditorConfigurerBean( root );

        // Creating the output stream we're going to put the XML in
        OutputStream os = new ByteArrayOutputStream();
        OutputFormat outformat = OutputFormat.createPrettyPrint();
        outformat.setEncoding( "UTF-8" ); //$NON-NLS-1$

        // Writing the XML.
        XMLWriter writer = new XMLWriter( os, outformat );
        writer.write( document );
        writer.flush();
View Full Code Here

        
         final String timestamp = DateUtils.format(new Date(), DateUtils.ISO8601_DATETIME_PATTERN);
         root.addAttribute(TIMESTAMP_ATTRIBUTE_LABEL, timestamp);

         // Write the updated suite
         final OutputFormat format = OutputFormat.createPrettyPrint();
         final XMLWriter writer = new XMLWriter(new FileOutputStream(file), format);
         writer.write(document);
         writer.close();
      }
      catch (Exception e)
View Full Code Here

    {
        org.dom4j.io.XMLWriter xmlwriter = null;

        try
        {
            OutputFormat outputFormat = OutputFormat.createPrettyPrint();
            xmlwriter = new org.dom4j.io.XMLWriter( writer, outputFormat );
            xmlwriter.write( doc );
            xmlwriter.flush();
        }
        catch ( IOException e )
View Full Code Here

                field.addAttribute( "dbType", columns.getString( "DATA_TYPE" ) );
                field.addAttribute( "javaType", fieldMap.get( columns.getString( "COLUMN_NAME" ) ).getType().toString() );
               
            }

            OutputFormat format = OutputFormat.createPrettyPrint();
            writer = new XMLWriter( System.out, format );
            //writer.write( document );
        } catch( SQLException e ) {

        } catch( IOException e ) {
View Full Code Here

        // ApacheDS Bean
        createApacheDSBean( root, ( ServerConfigurationV155 ) serverConfiguration );

        // Creating the output stream we're going to put the XML in
        OutputStream os = new ByteArrayOutputStream();
        OutputFormat outformat = OutputFormat.createPrettyPrint();
        outformat.setEncoding( "UTF-8" ); //$NON-NLS-1$

        // Writing the XML.
        XMLWriter writer = new XMLWriter( os, outformat );
        writer.write( document );
        writer.flush();
View Full Code Here

  }

  public static void dump(Element element) {
    try {
      // try to "pretty print" it
      OutputFormat outformat = OutputFormat.createPrettyPrint();
      XMLWriter writer = new XMLWriter( System.out, outformat );
      writer.write( element );
      writer.flush();
      System.out.println( "" );
    }
View Full Code Here

        return DocumentHelper.parseText(content);
    }
   
    public static void saveXmlDocument(final Document xmlDocument, final String xmlFileName) {
       
        OutputFormat format = OutputFormat.createPrettyPrint();
        XMLWriter writer = null;
        try {
            writer = new XMLWriter(new FileWriter(xmlFileName), format);
            writer.write(xmlDocument);
        }
View Full Code Here

         File webInf = new File(tmpWar, "WEB-INF");
         webInf.mkdirs();

         File webXml = new File(webInf, "web.xml");
         FileWriter fw = new FileWriter(webXml);
         OutputFormat format = OutputFormat.createPrettyPrint();
         XMLWriter writer = new XMLWriter(fw, format);
         writer.write(webDoc);
         writer.close();

         File jbossWebXml = new File(webInf, "jboss-web.xml");
View Full Code Here

TOP

Related Classes of org.dom4j.io.OutputFormat

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.