[xsl] Saxon Serializing and COntentHandler

Subject: [xsl] Saxon Serializing and COntentHandler
From: Neville Thomas <nthomas@xxxxxxxxx>
Date: Fri, 17 Dec 2004 14:11:07 -0500
In Xalan I am able to do the following:

Serializer serializer = SerializerFactory.getSerializer
(OutputPropertiesFactory.getDefaultMethodProperties("xml")); serializer.setOutputStream(System.out);
xmlFilter2.setContentHandler(serializer.asContentHandler());


How will I acheive similar with Saxon8b.
I tried using that ContentEmitter along with the ReceivingContentHandler (see below) but I dont think I am setting up the Configuration Object properly.


Properties xep = new Properties();
     NamePool np = NamePool.getDefaultNamePool();
     Configuration config = new Configuration();
     config.setNamePool(np);

XMLEmitter xe = new XMLEmitter();
xe.setStreamResult(new StreamResult(new PrintWriter(System.out, true)));
xe.setOutputProperties(xep);
xe.setConfiguration(config);
ReceivingContentHandler rch = new ReceivingContentHandler();
rch.setReceiver(xe);
rch.setNamePool(np);
xmlFilter2.setContentHandler(rch); xmlFilter2.parse(new InputSource("SouthPole.xml"));



Neville


--
==================================================================
Virtual Technology Corporation |  5510 Cherokee Rd, Suite 350
                               |  Alexandria, VA 22312-2300
   _/   _/_/_/_/_/_/_/_/_/     |
  _/         _/                |
  _/    _/  _/  _/_/_/_/       |               Neville Thomas
  _/   _/  _/  _/              |  E-Mail addr: nthomas@xxxxxxxxx
  _/  _/  _/  _/               |  Office     : 703.333.6233
   _/_/  _/  _/                |  Fax        : 703.658.7057
    _/  _/  _/_/_/_/           |
                               |
===================================================================
        "Software and Systems Engineering Professionals."
===================================================================

Current Thread