Package org.jdom.output

Examples of org.jdom.output.XMLOutputter


            ArgCheck.isNotNull(doc,CorePlugin.Util.getString("JdomHelper.The_Document_reference_may_not_be_null_45")); //$NON-NLS-1$
        }
        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 );
    }
View Full Code Here


            ArgCheck.isNotNull(doc,CorePlugin.Util.getString("JdomHelper.The_Document_reference_may_not_be_null_47")); //$NON-NLS-1$
        }
        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 );
    }
View Full Code Here

     */
    public static String write( Document doc , String indent, boolean newlines ) throws IOException {
        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();
    }
View Full Code Here

    rootElement.addContent(exceptionElement);

      }

      // 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

      // add the results elements to the root element
      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

      Element eResult = (Element)aResult.buildOutputFromObject();
      eControlArea.addContent(eResult);
      syncErrorDoc.getRootElement().removeContent(eControlArea);
      syncErrorDoc.getRootElement().addContent(eControlArea);
      TextMessage syncErrorMessage = getSyncErrorPublisher().createTextMessage();
      XMLOutputter xmlOut = new XMLOutputter();
      syncErrorMessage.setText(xmlOut.outputString(syncErrorDoc));
      if (getSyncErrorPublisher().getDefaultCommandName().length() == 0 ||
        getSyncErrorPublisher().getDefaultCommandName() == null) {
        getSyncErrorPublisher().setDefaultCommandName("EnterpriseSyncErrorSync");
      }
      syncErrorMessage.setStringProperty(MessageProducer.MESSAGE_ID,msgId.toString());
View Full Code Here

  * Uses the Xerces SAXParser to validate an existing JDOM Document object.
  *<P>
  * @return boolean true if the document is valid, false if the document is not valid
  */
  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

    // response to that queue.  The QueueRequestor will wait for a response on
    // that TemporaryQueue.

    Document responseDoc = null;
    TextMessage outMessage = createTextMessage();
    XMLOutputter xmlOut = new XMLOutputter();
    String requestBody = xmlOut.outputString(doc);
    logger.debug("Producing Request:\n" + requestBody);
    try {
      outMessage.setText(requestBody);
      outMessage.setStringProperty(MessageProducer.COMMAND_NAME, theObject.getCommandName());
      outMessage.setStringProperty(MessageProducer.MESSAGE_NAME, theObject.getCommandName());   // backward compatibility
View Full Code Here

    logger.debug("eLayout is " + layoutName);

    java.util.List lFields = eLayout.getChildren("Field");
    logger.debug("There are " + lFields.size() + " Fields in the " + layoutName + " Layout.");

    XMLOutputter xmlOut = new XMLOutputter();
    for (int i=0; i<lFields.size(); i++) {
      Element eField = (Element)lFields.get(i);
      buildElement(xeo, eOutput, eField, true);
      logger.debug("eOutput is now " + xmlOut.outputString(eOutput));
    }

    logger.debug("XmlLayout - Build Output From Object - Ended Processing.");

    return eOutput;
View Full Code Here

     *
     * @param document the Document to format
     * @return a String containing XML
     */
    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

TOP

Related Classes of org.jdom.output.XMLOutputter

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.