cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gunter D'Hondt" <g...@sofico.be>
Subject doing a Cocoon XSL transformation inside java code
Date Mon, 17 May 2004 14:14:40 GMT
Hello,

Inside my apple (Cocoon block) I've got a org.w3c.dom.Document (coming
from a org.apache.excalibur.source.Source-object) which I'd like to
transform into another org.w3c.dom.Document using an XSL transformation
(stylesheet is available thru a Source-object); how can I do this with
the Cocoon classes?

So something like:
private Document doTheTransformation(Source xmlsrc, Source
stylesheetsrc) {
	Document outputdoc;
	
	//get the document from the source-obj            
	InputSource inputsource = new
InputSource(xmlsrc.getInputStream());
      Document inputdoc = DomHelper.parse(inputsource);	

	//do the xsl transformation using the stylesheetsrc
	Transformer transformer = .. ??
	transformer.transform(inputdoc, outputdoc);

	//return the result document
	return outputdoc;
}

Regards,
Gunter D'Hondt 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message