1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
public class XSLTransform {
public static void main(String [] argl)throws javax.xml.transform.TransformerException {
File xmlFile = new File("/var/www/html/tomcat/sogescom/doc",arg[0]);
File xsltFile = new File("/var/www/html/tomcat/sogescom/gestion",arg[1]);
File htmlFile = new File("/var/www/html/tomcat/sogescom/gestion",arg[2]);
javax.xml.transform.Source xmlSource =
new javax.xml.transform.stream.StreamSource(xmlFile);
javax.xml.transform.Source xsltSource =
new javax.xml.transform.stream.StreamSource(xsltFile);
javax.xml.transform.Result result =
new javax.xml.transform.stream.StreamResult(htmlFile);
javax.xml.transform.TransformerFactory transFact =
javax.xml.transform.TransformerFactory.newInstance();
javax.xml.transform.Transformer trans =
transFact.newTransformer(xsltSource);
trans.transform(xmlSource, result);
} |