Package javax.xml.transform

Examples of javax.xml.transform.Result


  }

  public static String toString(Document doc, String encoding, boolean indent) throws TransformerFactoryConfigurationError, TransformerException {
    Source source = new DOMSource(doc);
    StringWriter sw = new StringWriter();
    Result result = new StreamResult(sw);

    Transformer xformer = TransformerFactory.newInstance().newTransformer();
    xformer.setOutputProperty(OutputKeys.ENCODING, encoding);

    if (indent) {
View Full Code Here


    return sw.getBuffer().toString();
  }

  public static void toString(Document doc, String encoding, Writer w, boolean indent) throws TransformerFactoryConfigurationError, TransformerException {
    Source source = new DOMSource(doc);
    Result result = new StreamResult(w);

    Transformer xformer = TransformerFactory.newInstance().newTransformer();
    xformer.setOutputProperty(OutputKeys.ENCODING, encoding);

    if (indent) {
View Full Code Here

  public static void writeXmlFile(Document doc, File file, boolean indent, String encoding) throws TransformerFactoryConfigurationError, TransformerException {
    // Prepare the DOM document for writing
    Source source = new DOMSource(doc);

    // Prepare the output file
    Result result = new StreamResult(file);

    Transformer xformer = TransformerFactory.newInstance().newTransformer();

    xformer.setOutputProperty(OutputKeys.ENCODING, encoding);
   
View Full Code Here

  public static void writeXmlFile(Document doc, File file, Entry<String,String>... outputKeys) throws TransformerFactoryConfigurationError, TransformerException {
    // Prepare the DOM document for writing
    Source source = new DOMSource(doc);

    // Prepare the output file
    Result result = new StreamResult(file);

    // Write the DOM document to the file
    Transformer xformer = TransformerFactory.newInstance().newTransformer();

    if(outputKeys != null){
View Full Code Here

    public byte[] evaluateAsBytes(Exchange exchange) throws Exception {
        initialize(exchange);

        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        Result result = new StreamResult(buffer);
        getExpression().pull(createDynamicContext(exchange), result, properties);
        byte[] bytes = buffer.toByteArray();
        return bytes;
    }
View Full Code Here

        InputSource inputSource = new ObjectInputSource(object);
        Source source = new SAXSource(saxReader, inputSource);

        // Create the trasformation result
        // Result result = new StreamResult(response.getWriter());
        Result result = new StreamResult(response.getOutputStream());

        // Go!
        t.transform(source, result);

    }
View Full Code Here

        InputSource inputSource = new ObjectInputSource(object);
        Source source = new SAXSource(saxReader, inputSource);

        // Create the trasformation result
        // Result result = new StreamResult(response.getWriter());
        Result result = new StreamResult(response.getOutputStream());

        // Go!
        t.transform(source, result);

    }
View Full Code Here

         
      InputStream is = getServletContext().getResourceAsStream(show);     
     
      if (is != null) {
        // Create the trasformation result
        Result result = new StreamResult(response.getOutputStream());

        String mediaType = this.templates.getOutputProperties().getProperty(OutputKeys.MEDIA_TYPE);
         
        if (mediaType == null || identity) {
          mediaType = "text/xml";
View Full Code Here

        ObjectXMLReader saxReader = new ErrorRequestXMLReader();

        Source source = new SAXSource(saxReader, inputSource);

        // Create the trasformation result
        Result result = new StreamResult(response.getWriter());
        // Result result = new StreamResult(response.getOutputStream());

        // Go!
        t.transform(source, result);
View Full Code Here

    }
  }

  public static void writeDocumentToFile(final File outFile, final Document doc) {
    final Source source = new DOMSource(doc);
    final Result result = new StreamResult(outFile);

    // Write the DOM document to the file
    Transformer xformer;
    try {
      xformer = TransformerFactory.newInstance().newTransformer();
View Full Code Here

TOP

Related Classes of javax.xml.transform.Result

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.