Serves as an interface to a TrAX aware XSLT processor such as Xalan or Saxon. The following example shows how to apply an XSL Transformation to a XOM document and get the transformation result in the form of a XOM Nodes:
public static Nodes transform(Document in) throws XSLException, ParsingException, IOException { Builder builder = new Builder(); Document stylesheet = builder.build("mystylesheet.xsl"); XSLTransform transform = new XSLTransform(stylesheet); return transform.transform(doc); } XOM relies on TrAX to perform the transformation. The javax.xml.transform.TransformerFactory Java system property determines which XSLT engine TrAX uses. Its value should be the fully qualified name of the implementation of the abstract javax.xml.transform.TransformerFactory class. Values of this property for popular XSLT processors include:
com.icl.saxon.TransformerFactoryImpl net.sf.saxon.TransformerFactoryImpl org.apache.xalan.processor.TransformerFactoryImpl org.apache.xalan.xsltc.trax.TransformerFactoryImpl jd.xml.xslt.trax.TransformerFactoryImpl oracle.xml.jaxp.JXSAXTransformerFactory com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl This property can be set in all the usual ways a Java system property can be set. TrAX picks from them in this order:
System.setProperty("javax.xml.transform.TransformerFactory", "classname")lib/jaxp.properties properties file in the JRE directory, in a line like this one: javax.xml.parsers.DocumentBuilderFactory=classname
META-INF/services/javax.xml.transform.TransformerFactory file in the JAR archives available to the runtime | |
| |
| |
| |
| |
| |
| |
| |
| |
| |