XSLTC utility classes

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.)

Usage

  1. Compile a translet as usual. A typical invocation would look like:
    java -cp xsltc.jar org.apache.xalan.xsltc.cmdline.Compile -j mystylesheet.jar -p com.acme.foo mystylesheet.xsl
    
    This will compile a stylesheet into a translet called com.acme.foo.mystylesheet and create mystylesheet.jar in the current directory.
  2. Write your code that uses this translet. Translets can be turned into JAXP Transformer as follows:
    import org.kohsuke.xsltc.XSLTCTransformer;
    import javax.xml.transform.Transformer;
    
    Transformer t = new XSLTCTransformer(new com.acme.foo.mystylesheet());
    
  3. Once you have a Transformer, it should be straightforward to do the transformation as you wish.

Back to home