API XSLT Java 1.4 |
Java 1.4 contient un moteur XSLT dans le package javax.xml.transform
import javax.xml.transform.stream.*; import javax.xml.transform.*; class XSLT { public static void main(String args[]){ String xslt=args[0]; String xml =args[1]; try{ TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new StreamSource(xslt)); transformer.transform(new StreamSource(xml), new StreamResult(System.out)); } catch (Exception e){ e.printStackTrace(); } } } |
Pour lancer le moteur de feuille de style :
java XSLT file.xsl file.xml |
XPath/XSLT/XSLT 5/3/2004 |
41/53 |