Also, 
  Look at the PIPE and FILTER examples that come in the Xalan samples.

Bart Jenkins, CTO
Globeflow SA
Cardenal Marcelo Spinola 2, D1, Planta 6
28016 Madrid, Spain
telephone: +34 667 65 10 75
mailto:[EMAIL PROTECTED]
 

-----Original Message-----
From: Paul Brown [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 22, 2001 4:39 PM
To: [EMAIL PROTECTED]
Subject: RE: Help piping XSLs from one transformer to another


> I am quite new to Xalan, and have been trying to figure out how to pipe 
> an XSL from one SAX transformer handler to another (while passing 
> different xml files to each one). Any help or code samples would be 
> very much appreciated.

You want:

/* relevant imports go here... */
SAXTransformerFactory stf = SAXTransformerFactory.newInstance();
TransformerFactory tf = TransformerFactory.newInstance();
/* This will be the first transformer. */
TransformerHandler t = tf.newTransformer();
/* This will create the second transformer. */
TransformerHandler th = stf.newTransformerHandler();
/* I assume that you already have your sources set up... */
t.transform(input,new SAXResult(th));
Transformer t2 = th.getTransformer();
t2.transform(input2,finalOutput);

Or something pretty close to that.

        -- Paul

Reply via email to