You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Alan Wood <a....@xtensure.com> on 2002/09/17 14:32:45 UTC

does tranformer.setparameter worek in pipes?

Hi

I am using pipes made up of XMLFilters (3 to be exact) one of which is an 
XMLFilter generated from a SAXTransformerFactory. Now if I just use a 
transformer with no pipes It works perfectly, whjen using pipes the 
parameters are not passed through. Thus my question is are parameters 
supported on transformer when the transform is in a pipe?? I could see the 
confusion if the pipe was made from multiple transforms as XMLFilters, in 
this case howver there is just one transform. If the setParameter on the 
transform is not supported is there another way??

... other code

XMLFilter transFilter = stf.newXMLFilter(template);
//where template is teh templates for this stylesheet

//I then assemble to the pipe :
input.setParent(reader);
transFilter.setParent(input);
output.setParent(transFilter);

//get a transformer and set up sources ect.. 
transformer = stf.newTransformer();
transformSource = new SAXSource(output, rh.getResource().getInputSource());

.// Then setup some parameters
Parameter p;
Vector parameters = rh.getParameters();
if(parameters != null){
	Iterator pit = parameters.iterator();
	while(pit.hasNext()){
		p = (Parameter)pit.next();
		transformer.setParameter(p.getName(), p.getValue());
		Log.out("Parameter : " + p.getName() + " value : " + p.getValue());
	}
}
// I can then do the transform on the pipe
transformer.transform(transformSource, result);
// Where result is an output stream.
etc.. 

Al