import javax.xml.transform.*;
import javax.xml.transform.stream.*;
import java.io.File;

public class XSLTTest
{
    public static void main( String[] args )
    {
        try
        {
            StreamSource source = new StreamSource( new File( "book.xml" ) );
            StreamResult result = new StreamResult( System.out );
            TransformerFactory factory = TransformerFactory.newInstance();
            Transformer transformer = factory.newTransformer( new StreamSource( new File( "books.xsl" ) ) );
            transformer.transform( source, result );
        }
        catch( Exception e )
        {
            e.printStackTrace();
        }
    }
}
