You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Dennis Thomas <de...@ensera.com> on 2000/09/28 03:15:49 UTC

Cocoon+XML+XSL --> HTML

HI,
I'm new to Cacoon but have been using xml4j & now Xerces for some time now.
My problem is how do I use Cocoon to parse an XML & XSL files and transform
it to HTML ?
If I were using Xalan then the code is as below. 

Can someone send me the piece of code as to how I could go about it given
that I have the 
XML & XSLs in place.


________________________________
import org.apache.xalan.xslt.XSLTProcessorFactory;
import org.apache.xalan.xslt.XSLTInputSource;
import org.apache.xalan.xslt.XSLTResultTarget;
import org.apache.xalan.xslt.XSLTProcessor;

public class xForm
{
	public static void main(String[] args)
    	throws Exception,org.xml.sax.SAXException
	{
	XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
	processor.process(new XSLTInputSource("foo.xml"),
			  new XSLTInputSource("foo.xsl"),
			  new XSLTResultTarget(System.out));
	}
}
________________________________

TIA,
Dennis T