Using XSLT in Java Applications
As you saw yesterday, JAXP provides a javax.xml.transform.Transformer class that is used to transform XML documents using XSLT. A javax.xml.transform.TransformerFactory is used to create a Transformer object. A new TransformerFactory object is created by the static newInstance() method in the factory class.
The following code creates a new TransformerFactory:
TransformerFactory factory = TransformerFactory.newInstance();
A Transformer object is created by a newTransformer() method in the factory object and optionally takes an XSLT stylesheet as a parameter to the method. The XSLT stylesheet must be accessed using a javax.xml.transform.stream.Source object. A StreamSource object can be constructed from a java.io.InputStream ...