Package org.dom4j.io

Examples of org.dom4j.io.XMLWriter


                        try
                        {
                            OutputFormat outformat = OutputFormat.createPrettyPrint();
                            outformat.setEncoding( "UTF-8" ); //$NON-NLS-1$
                            XMLWriter writer = new XMLWriter( new FileOutputStream( exportDirectory + "/" //$NON-NLS-1$
                                + project.getName() + ".schemaproject" ), outformat ); //$NON-NLS-1$
                            writer.write( ProjectsExporter.toDocument( project ) );
                            writer.flush();
                        }
                        catch ( UnsupportedEncodingException e )
                        {
                            PluginUtils
                                .logError(
View Full Code Here


    if (delegateElement.hasContent()) {
      try {
        StringWriter stringWriter = new StringWriter();
        // when parsing, it could be to store the config in the database, so we want to make the
        // configuration compact
        XMLWriter xmlWriter = new XMLWriter(stringWriter, OutputFormat.createCompactFormat());
        for (Object node : delegateElement.content()) {
          xmlWriter.write(node);
        }
        xmlWriter.flush();
        configuration = stringWriter.toString();
      }
      catch (IOException e) {
        jpdlReader.addWarning("io problem while parsing the configuration of "
            + delegateElement.asXML());
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( "" );
    }
    catch( Throwable t ) {
      // otherwise, just dump it
      System.out.println( element.asXML() );
View Full Code Here

         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");
         fw = new FileWriter(jbossWebXml);
         writer = new XMLWriter(fw, format);
         writer.write(jbossDoc);
         writer.close();

         return tmpWar.toURL();
      }
      catch (IOException e)
      {
View Full Code Here

        Document document = inputCollection.toDocument();

        AddMessages addMessages = new AddMessages(inputCollection, document);
        addMessages.execute();

        XMLWriter writer = new XMLWriter(new BufferedOutputStream(new FileOutputStream(outputFile)),
                OutputFormat.createPrettyPrint());
        writer.write(document);
        writer.close();
    }
View Full Code Here

    File file = Utils.prepareFile(filename);

    Document document = createDocument(reflections);

    try {
      XMLWriter xmlWriter = new XMLWriter(new FileOutputStream(file), OutputFormat.createPrettyPrint());
      xmlWriter.write(document);
      xmlWriter.close();
    }
    catch (IOException e) {
      throw new ReflectionsException("could not save to file " + filename, e);
    }
View Full Code Here

  public String toString(final Reflections reflections) {
    Document document = createDocument(reflections);

    try {
      StringWriter writer = new StringWriter();
      XMLWriter xmlWriter = new XMLWriter(writer, OutputFormat.createPrettyPrint());
      xmlWriter.write(document);
      xmlWriter.close();
      return writer.toString();
    }
    catch (IOException e) {
      throw new RuntimeException();
    }
View Full Code Here

    public String toXMLString() {
        try {
            OutputFormat format = OutputFormat.createPrettyPrint();
            StringWriter strWriter = new StringWriter(1024);
            XMLWriter metaWriter = new XMLWriter(strWriter, format);
            metaWriter.write(getDocument());
            metaWriter.close();
            return strWriter.toString();
        } catch (IOException ex) {
            ROOT_LOGGER.cannotTransformDeploymentPlanToXML(ex);
            return null;
        }
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( "" );
    }
    catch ( Throwable t ) {
      // otherwise, just dump it
      System.out.println( element.asXML() );
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( "" );
    }
    catch( Throwable t ) {
      // otherwise, just dump it
      System.out.println( element.asXML() );
View Full Code Here

TOP

Related Classes of org.dom4j.io.XMLWriter

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.