Examples of StreamResult


Examples of javax.xml.transform.stream.StreamResult

          }
          try {
            Transformer t = TransformerFactory.newInstance().newTransformer();
            StringWriter writer = new StringWriter();
            //TODO: prevent this from being too large
                t.transform(source, new StreamResult(writer));
            String param = Util.httpURLEncode(this.executionFactory.getXMLParamName())+"="+Util.httpURLEncode(writer.toString()); //$NON-NLS-1$
            endpoint = WSConnection.Util.appendQueryString(endpoint, param);
          } catch (TransformerException e) {
            throw new WebServiceException(e);
          }
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

    }
   
    @Override
    public void translate(Writer writer) throws TransformerException, IOException {
        Transformer t = TransformerFactory.newInstance().newTransformer();
        t.transform(source, new StreamResult(writer));
    }
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

    }
   
    TransformerFactory transformerFactory = TransformerFactory.newInstance();
    Transformer transformer = transformerFactory.newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT, "yes");
    transformer.transform(new DOMSource(tld), new StreamResult(targetFile));
  }
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

       
        @Override
        public void translate(Writer writer) throws TransformerException {
                  //transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); //$NON-NLS-1$
                  // Feed the resultant I/O stream into the XSLT processor
          transformer.transform(xmlParam, new StreamResult(writer));
        }
      });
      return new ClobType(new ClobImpl(result.getStreamFactory(), -1));
    } finally {
      Util.closeSource(styleSource);
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

         transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");

         for (Element element : extraMarkupHeaders)
         {
            DOMSource source = new DOMSource(element);
            StreamResult result = new StreamResult(new StringWriter());

            // we want to ouput xhtml text that will still work on html browsers.
            // In order to do this we need to have the script tag be not self closing
            // which it will try and do with the xml or xhtml method. If we just use
            // the html method then the other tags will not be closed.
            if (element.getNodeName().equalsIgnoreCase("script"))
            {
               transformer.setOutputProperty(OutputKeys.METHOD, "html");
            }
            else
            {
               transformer.setOutputProperty(OutputKeys.METHOD, "xml");
            }
            transformer.transform(source, result);
            markupHeaders.add(result.getWriter().toString());
         }
      }
     
       return markupHeaders;
   }
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

    Transformer transformer =
      TransformerFactory.newInstance().newTransformer();
    Source source = new DOMSource(doc);

    CharArrayWriter writer = new CharArrayWriter();
    Result output = new StreamResult(writer);
    transformer.transform(source, output);
    writer.flush();

    return writer.toString();
  }
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

    public void setUp() throws Exception{
      streamResultHolder = new CharArrayWriter()
        SAXTransformerFactory factory = new TransformerFactoryImpl();
    handler = factory.newTransformerHandler();
    handler.setResult(new StreamResult(streamResultHolder));
    handler.startDocument();
    }
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

        try {
            TransformerFactory factory = TransformerFactory.newInstance();
            Transformer transformer = factory.newTransformer();
            transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
            StringWriter output = new StringWriter();
            transformer.transform(new DOMSource(target), new StreamResult(output));
           
            return output.toString();
        } catch (TransformerConfigurationException e) {
            // Things must be in pretty bad shape to get here so
            // rethrow as runtime exception
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

        this.xml.setEncoding(encoding);
        SAXTransformerFactory factory = new TransformerFactoryImpl();
        try {
      //SAX2.0 ContentHandler
      handler = factory.newTransformerHandler();
      handler.setResult(new StreamResult(fsisf.getOuputStream()));
    } catch (Exception e) {
      throw new TeiidComponentException(e);
    }
        transformer = handler.getTransformer();
        transformer.setOutputProperty(OutputKeys.ENCODING, encoding);
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

          .newTransformer();
      StringWriter reader = new StringWriter();

      CategoryDataset dataset = null;

      transformer.transform(getChartInput.getXmlData(), new StreamResult(
          reader));
      dataset = DatasetReader
          .readCategoryDatasetFromXML(new ByteArrayInputStream(reader
              .getBuffer().toString().getBytes()));
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.