Source for Transformation Application : XSLTProcessor « XML « Java Tutorial






import org.xml.sax.SAXException;
import org.apache.xalan.xslt.XSLTProcessorFactory;
import org.apache.xalan.xslt.XSLTInputSource;
import org.apache.xalan.xslt.XSLTResultTarget;
import org.apache.xalan.xslt.XSLTProcessor;

import java.io.FileOutputStream;

public class xalantransform {
  public static void main(String[] args) throws java.io.IOException,
      java.net.MalformedURLException, org.xml.sax.SAXException {

    XSLTProcessor processor = XSLTProcessorFactory.getProcessor();

    processor.process(new XSLTInputSource(args[0]), new XSLTInputSource(args[1]),
        new XSLTResultTarget(new FileOutputStream(args[2])));
  }
}








33.17.XSLTProcessor
33.17.1.Source for Transformation Application
33.17.2.Source for Transforming org.w3c.dom.Node