Package org.jdom.output

Examples of org.jdom.output.XMLOutputter.output()


        }
        if(stream == null){
            ArgCheck.isNotNull(stream,CorePlugin.Util.getString("JdomHelper.The_OutputStream_reference_may_not_be_null_46")); //$NON-NLS-1$
        }
        XMLOutputter outputter = new XMLOutputter(getFormat(indent, newlines));
        outputter.output( doc, stream );
    }
   
    /**
     * <p>
     * Ouput the current JDOM <code>Document</code> to the output stream.
View Full Code Here


        }
        if(writer == null){
            ArgCheck.isNotNull(writer,CorePlugin.Util.getString("JdomHelper.The_Writer_reference_may_not_be_null_48")); //$NON-NLS-1$
        }
        XMLOutputter outputter = new XMLOutputter(getFormat(indent, newlines));
        outputter.output( doc, writer );
    }
   
    /**
     * <p>
     * Return the current JDOM <code>Document</code> as a String.
View Full Code Here

        if(doc == null){
            ArgCheck.isNotNull(doc,CorePlugin.Util.getString("JdomHelper.The_Document_reference_may_not_be_null_49")); //$NON-NLS-1$
        }
        XMLOutputter outputter = new XMLOutputter(getFormat(indent, newlines));
        StringWriter writer = new StringWriter();
        outputter.output( doc, writer );
       
        return writer.getBuffer().toString();
    }

    public static void print( PrintStream stream, Document doc ) {
View Full Code Here

      }

      // Output xml
      XMLOutputter outputter = new XMLOutputter(JdomHelper.getFormat(
        "  ", true)); //$NON-NLS-1$
      outputter.output(new Document(rootElement), outputStream);

  } catch (SQLException e) {
      throw new QueryTestFailedException(
        "Failed to convert results to JDOM: " + e.getMessage()); //$NON-NLS-1$
  } catch (JDOMException e) {
View Full Code Here

      rootElement.addContent(resultElement);

      // Output xml
      XMLOutputter outputter = new XMLOutputter(JdomHelper.getFormat(
        "  ", true)); //$NON-NLS-1$
      outputter.output(new Document(rootElement), outputStream);

  } catch (SQLException e) {
      throw new QueryTestFailedException(
        "Failed to convert error results to JDOM: " + e.getMessage()); //$NON-NLS-1$
  } catch (JDOMException e) {
View Full Code Here

  public final synchronized boolean isValid(Document inDoc) {
    XMLOutputter xmlOut = new XMLOutputter();
    ByteArrayOutputStream bArray = new ByteArrayOutputStream();
    String parserName = "org.apache.xerces.parsers.SAXParser";
    try {
      xmlOut.output(inDoc, bArray);
    }
    catch (IOException e) {
      logger.fatal(e.getMessage(), e);
    }
    byte[] b = bArray.toByteArray();
View Full Code Here

     */
    private static String formatDocument(Document document) throws IOException {       
        final XMLOutputter outputter = new XMLOutputter();
        final StringWriter writer = new StringWriter();
       
        outputter.output(document, writer);
       
        return writer.getBuffer().toString();
    }
   
    /**
 
View Full Code Here

    if (msgDumpDir.lastIndexOf("/") != msgDumpDir.length() - 1) {
      msgDumpDir = msgDumpDir + "/";
    }
    logger.info("Writing message to file: " + msgDumpDir + fileName);
    try {
       xmlOut.output(doc, new FileOutputStream(msgDumpDir + fileName));
    }
    catch (Exception e) {
      String msg = "Error dumping message to a file.  Exception: " + e.getMessage();
      logger.fatal(msg);
      throw new IOException(msg);
View Full Code Here

  }

  protected String convertToString(Document doc) throws IOException {
    XMLOutputter xmlOut = new XMLOutputter();
    ByteArrayOutputStream bArray = new ByteArrayOutputStream();
    xmlOut.output(doc, bArray);
    return new String(bArray.toByteArray());
  }

  /**
  * Takes the release number passed in which is generally pulled from a message
View Full Code Here

        Document doc = invokeService(SERVICE_NAME,
                                     "/org/codehaus/xfire/addressing/testcases/echo/soap12/duplicateFaultToRequest.xml");

       
        XMLOutputter output = new XMLOutputter();
        output.output(doc, System.out);
        addNamespace("wsa", "http://www.w3.org/2005/08/addressing");
        assertValid("/soap:Envelope/soap:Header/wsa:Action[text()='http://www.w3.org/2005/08/addressing/fault']",
                    doc);
        assertValid("/soap:Envelope/soap:Body/soap:Fault/soap:Code/soap:Value[text()='ns1:Sender']",
                    doc);
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.