1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| import org.apache.xalan.xslt.XSLTProcessorFactory;
import org.apache.xalan.xslt.XSLTInputSource;
import org.apache.xalan.xslt.XSLTResultTarget;
import org.apache.xalan.xslt.XSLTProcessor;
import org.xml.sax.SAXException;
public class JCreateHTML {
try {
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
// Paramètre
processor.setStylesheetParam("version","'1.0'");
// Sources XML et XSL
XSLTInputSource xml = new XSLTInputSource("biens.xml");
XSLTInputSource xsl = new XSLTInputSource("affiche_biens.xsl");
// Résultat
XSLTResultTarget result = new XSLTResultTarget("affiche.html");
// Transformation
processor.process(xml, xsl, result);
}
catch(SAXException se) {}
} |
Partager