import javax.xml.transform.*;
import javax.xml.transform.stream.*;
public class XmlTransformerTest {

  public static void main(String[] args)
      throws Exception
  {
    String xml="C:\\Lessons\\ExamTest.xml";
    String xsl="C:\\Lessons\\ExamTest.xsl";
    String html="C:\\Lessons\\ExamTest.html";

    TransformerFactory factory=TransformerFactory.newInstance();

    Source style=new StreamSource(xsl);
    Transformer transformer=factory.newTransformer(style);

    Source data=new StreamSource(xml);
    Result output=new StreamResult(html);
    transformer.transform(data,output);


  }
}
