This is a small set of Java utility classes that makes it easy to use XSLTC translets from your application.
The code is under the MIT License. Also note that it contains code taken from XSLTC, which is covered by the Apache Software License (but if you are going to use this utility code, you are going to redistribute XSLTC anyway, so this should be non-issue.)
java -cp xsltc.jar org.apache.xalan.xsltc.cmdline.Compile -j mystylesheet.jar -p com.acme.foo mystylesheet.xslThis will compile a stylesheet into a translet called
com.acme.foo.mystylesheet and create mystylesheet.jar in the current directory.
import org.kohsuke.xsltc.XSLTCTransformer; import javax.xml.transform.Transformer; Transformer t = new XSLTCTransformer(new com.acme.foo.mystylesheet());
Transformer, it should be straightforward to do the transformation as you wish.