Java code to convert XML TO XSLT
import java.io.*;
import javax.xml.transform.*;
import javax.xml.transform.stream.*;
public class Driver {
public static void main(String[] args)
{
try
{
TransformerFactory tFactory = TransformerFactory.newInstance();
Source xslDoc = new StreamSource("datasheet.xsl");
Source xmlDoc = new StreamSource("datasheet.xml");
String outputFileName = "datasheet.html";
OutputStream htmlFile = new FileOutputStream(outputFileName);
Transformer transformer = tFactory.newTransformer(xslDoc);
transformer.transform(xmlDoc, new StreamResult(htmlFile));
}
catch(Exception e)
{
e.printStackTrace();
}
}
}