Package org.apache.xalan.serialize

Examples of org.apache.xalan.serialize.Serializer.asContentHandler()


  f1.setParent(r);
  f2.setParent(f1);
  Serializer sz = SerializerFactory.getSerializer
      (OutputProperties.getDefaultMethodProperties("xml"));
  sz.setOutputStream(System.out);
  f2.setContentHandler(sz.asContentHandler());

  // go!
  f2.parse(new InputSource(System.in));
  System.out.println();
    }
View Full Code Here


          m_outputStream = new java.io.FileOutputStream(fileURL);
          serializer.setOutputStream(m_outputStream);
        }
        else throw new TransformerException("No output specified!");

        handler = serializer.asContentHandler();

        this.setSerializer(serializer);
      }
      catch (UnsupportedEncodingException uee)
      {
View Full Code Here

        serializer = SerializerFactory.getSerializer(m_textformat.getProperties());

        m_resultTreeHandler.setSerializer(serializer);
        serializer.setWriter(sw);

        ContentHandler shandler = serializer.asContentHandler();

        m_resultTreeHandler.init(this, shandler);
      }
      else
      {
View Full Code Here

  f1.setParent(r);
  f2.setParent(f1);
  Serializer sz = SerializerFactory.getSerializer
      (OutputProperties.getDefaultMethodProperties("xml"));
  sz.setOutputStream(System.out);
  f2.setContentHandler(sz.asContentHandler());

  // go!
  f2.parse(new InputSource(System.in));
  System.out.println();
    }
View Full Code Here

          m_outputStream = new java.io.FileOutputStream(fileURL);
          serializer.setOutputStream(m_outputStream);
        }
        else throw new TransformerException("No output specified!");

        handler = serializer.asContentHandler();

        this.setSerializer(serializer);
      }
      catch (UnsupportedEncodingException uee)
      {
View Full Code Here

        serializer = SerializerFactory.getSerializer(m_textformat.getProperties());

        m_resultTreeHandler.setSerializer(serializer);
        serializer.setWriter(sw);

        ContentHandler shandler = serializer.asContentHandler();

        m_resultTreeHandler.init(this, shandler);
      }
      else
      {
View Full Code Here

              serializer.setOutputStream(os);
          }

          transformer.setSerializer(serializer);

          ContentHandler ch = serializer.asContentHandler();

          transformer.setContentHandler(ch);
        }
      }
      catch (java.io.IOException e)
View Full Code Here

   
      // xmlFilter3 outputs SAX events to the serializer.
      Serializer serializer = SerializerFactory.getSerializer
                                   (OutputProperties.getDefaultMethodProperties("xml"));       
      serializer.setOutputStream(System.out);
      xmlFilter3.setContentHandler(serializer.asContentHandler());

      // Perform the series of transformations as follows:
      //   - transformer3 gets its parent (transformer2) as the XMLReader/XMLFilter
      //     and calls transformer2.parse(new InputSource("foo.xml")).
      //   - transformer2 gets its parent (transformer1) as the XMLReader/XMLFilter
View Full Code Here

      // transformer3 outputs SAX events to the serializer.
      Serializer serializer = SerializerFactory.getSerializer
                                   (OutputProperties.getDefaultMethodProperties("xml"));       
      serializer.setOutputStream(System.out);
      tHandler3.setResult(new SAXResult(serializer.asContentHandler()));

      // Parse the XML input document. The input ContentHandler and output ContentHandler
      // work in separate threads to optimize performance.  
      reader.parse("foo.xml");
    }
View Full Code Here

                              (OutputProperties.getDefaultMethodProperties("xml"));
      serializer.setOutputStream(fos);
  
     
      // Set the result handling to be a serialization to the file output stream.
      Result result = new SAXResult(serializer.asContentHandler());
      handler.setResult(result);
     
      // Parse the XML input document.
      reader.parse("birds.xml");
     
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.