How to run saxon xslt transformation in java
The documentation is here: http://www.saxonica.com/documentation/index.html#!using-xsl/embedding
Saxon offers two APIs for running XSLT transformations from a Java application: the JAXP API, and the s9api API. JAXP is a standard interface offered by almost all Java XSLT processors, so you want to use this one if you want your application to be portable; its disadvantage is that (a) it's very oriented to XSLT 1.0 and that makes it hard to take advantage of new capabilities in XSLT 2.0 and XSLT 3.0, and (b) it doesn't integrate especially well with APIs for related tasks such as schema processing and XPath evaluation.
The s9api API is much more closely matched to Saxon's capabilities across a variety of tasks including XSLT, XQuery, XPath, and XSD validation, but isn't portable.
It's your choice.
You're best off working with the standard Java APIs for XML and XSLT processing: java.xml.transform
The first class you need to access is javax.xml.transform.TransformerFactory, which you use to create a Transformer object, which you then use to run your XSLT transform. Alternatively, you can use the TransformerFactory to create a Templates object (which will cause Saxon to pre-process/compile/etc your XSLT stylesheet), and then use the Templates object repeatedly to create Transformer objects for your XSLT transforms.
In order to make sure that the javax.xml.transform.TransformerFactory class maps to the Saxon implementation, you can either fiddle around with the boot classpath using command-line options, or use code to do the same:
System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
Once this is done, any calls to TransformerFactory.newInstance() will magically create Saxon TransformerFactory implementations. You're much better off using this method as you'll get the benefits of the standard Java APIs, and you have the freedom to move to other XSLT processors later. You might want to look into using XSLTC, which is part of Apache Xalan, as it is faster for certain types of XSLT stylesheets.