Package javax.xml.transform.stream

Examples of javax.xml.transform.stream.StreamResult


     *
     * @see de.netseeker.ejoe.adapter.SerializeAdapter#write(java.lang.Object, java.io.OutputStream)
     */
    public void write( Object obj, OutputStream out ) throws Exception
    {
        _transformer.serialize( obj, new StreamResult( out ) );
    }
View Full Code Here


    DOMSource source = new DOMSource(testDoc);

    // PrintStream will be responsible for writing
    // the text data to the file
    PrintStream ps = new PrintStream(file);
    StreamResult result = new StreamResult(ps);

    // Once again we are using a factory of some sort,
    // this time for getting a Transformer instance,
    // which we use to output the XML
    TransformerFactory transformerFactory = TransformerFactory
View Full Code Here

        try{

            TransformerFactory tf = TransformerFactory.newInstance();
            Transformer transformer = tf.newTransformer();
            DOMSource source = new DOMSource(document);
            StreamResult result;

            if (fname == null)
                result = new StreamResult(System.out);
            else
                result = new StreamResult(new FileWriter(fname));

            transformer.transform(source, result);
        }
        catch(Exception e)
        {
View Full Code Here

   */
  public String toString() {
    StringWriter sresult = new StringWriter();
       try {
           DOMSource source = new DOMSource(getDOMrepresentation());
           StreamResult result = new StreamResult(sresult);
           Transformer trans = TransformerFactory.newInstance().newTransformer();
           trans.setOutputProperty(OutputKeys.INDENT, "yes");
           trans.transform(source, result);
          }
          catch (Exception e) {
View Full Code Here

   */
  public String toString() {
    StringWriter sresult = new StringWriter();
       try {
           DOMSource source = new DOMSource(getDOMrepresentation());
           StreamResult result = new StreamResult(sresult);
           Transformer trans = TransformerFactory.newInstance().newTransformer();
           trans.setOutputProperty(OutputKeys.INDENT, "yes");
           trans.transform(source, result);
          }
          catch (Exception e) {
View Full Code Here

      barcode.generateBarcode(provider, message);
      Document svgDoc = provider.getDOM();

      Source source = new DOMSource(svgDoc);
      StringWriter outWriter = new StringWriter();
      Result output = new StreamResult(outWriter);
      Transformer transformer = TransformerFactory.newInstance()
          .newTransformer();
      transformer.transform(source, output);

      String svgString = outWriter.toString();
View Full Code Here

                                                       InputStream templateIs,
                                                       Properties outputProps)
   throws TransformerException, IOException
   {
      StreamSource source = new StreamSource(srcIs);
      StreamResult result = new StreamResult(destOs);
      StreamSource template = new StreamSource(templateIs);

      /*
        Pre-compile the stylesheet. This Templates object may be used
        concurrently across multiple threads. Creating a Templates object
View Full Code Here

                                                       Properties outputProps,
                                                       Properties xslParams)
   throws TransformerException, IOException
   {
      StreamSource source = new StreamSource( srcIs );
      StreamResult result = new StreamResult( destOs );
      StreamSource template = new StreamSource( templateIs );

      Templates templates = transformerFactory.newTemplates( template );

      // set output properties
View Full Code Here

        VerifyingWriter ps = ss.getWriter();
        MODSDatabase md = new MODSDatabase(database, keySet);

        try {
            DOMSource source = new DOMSource(md.getDOMrepresentation());
            StreamResult result = new StreamResult(ps);
            Transformer trans = TransformerFactory.newInstance().newTransformer();
            trans.setOutputProperty(OutputKeys.INDENT, "yes");
            trans.transform(source, result);
        }
        catch (Exception e) {
View Full Code Here

  }

  public void saveOrUpdateTemplate(PrintTemplate template) throws PrintingException {
    StringWriter sw = new StringWriter();
    try {
      marshaller.marshal(template.getPage(), new StreamResult(sw));
      template.setPageXml(sw.toString());
      printTemplateDao.merge(template);
    } catch (XmlMappingException e) {
      throw new PrintingException(e, PrintingException.PRINT_TEMPLATE_XML_PROBLEM);
    } catch (IOException e) {
View Full Code Here

TOP

Related Classes of javax.xml.transform.stream.StreamResult

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.