Saturday 30 July 2011

Source Update to Handle Stylesheet Parameters

 

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 MainClass {
  public static void main(String[] argsthrows java.io.IOException,
      java.net.MalformedURLException, org.xml.sax.SAXException {

    XSLTProcessor processor = XSLTProcessorFactory.getProcessor();

    processor.setStylesheetParam("greeting""'Hello Mike'");

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

 

No comments:

Post a Comment