G. Todd Miller has begun integrating the translet with the TrAX/JAXP 1.1 API. See The Translet API & TrAX. Accordingly, it is now possible to set a system property and use a TransformerFactory to generate a Transformer that performs a transformation by compiling and running a translet.
-
When you use the JAXP 1.1 API to run &xslt4j;, the javax.xml.transformer.TransformerFactory system property is set to org.apache.xalan.processor.TransformerFactoryImpl. As it currently stands, this Xalan implementation of TransformerFactory always uses the Xalan Transformer to perform transformations. To use translets to perform transformations, set this system property to org.apache.xalan.xsltc.runtime.TransformerFactoryImpl. For information on setting this and related system properties designating XML parsere and XSL transformer, see Plugging in a Transformer and XML parser.
+
When you use the JAXP 1.1 API to run &xslt4j;, the javax.xml.transform.TransformerFactory system property is set to org.apache.xalan.processor.TransformerFactoryImpl. As it currently stands, this Xalan implementation of TransformerFactory always uses the Xalan Transformer to perform transformations. To use translets to perform transformations, set this system property to org.apache.xalan.xsltc.trax.TransformerFactoryImpl. For information on setting this and related system properties designating XML parsere and XSL transformer, see Plugging in a Transformer and XML parser.
To Use the JAXP 1.1 API to perform transformations with translets do the following:
-
Set the javax.xml.transformer.TransformerFactory system property as indicated above.
+
Set the javax.xml.transform.TransformerFactory system property as indicated above.
Instantiate a TransformerFactory.
Assuming you want to perform a series of transformations with the same translet, use the TransformerFactory and a
StreamSource XSL stylesheet to generate a Templates object (the translet). If you are performing a single
@@ -336,7 +336,7 @@
// Set the TransformerFactory system property.
// Note: For more flexibility, load properties from a properties file.
String key = "javax.xml.transform.TransformerFactory";
-String value = "org.apache.xalan.xsltc.runtime.TransformerFactoryImpl";
+String value = "org.apache.xalan.xsltc.trax.TransformerFactoryImpl";
Properties props = System.getProperties();
props.put(key, value);
System.setProperties(props);
@@ -368,7 +368,7 @@
// Set the TransformerFactory system property.
// Note: For more flexibility, load properties from a properties file.
String key = "javax.xml.transform.TransformerFactory";
-String value = "org.apache.xalan.xsltc.runtime.TransformerFactoryImpl";
+String value = "org.apache.xalan.xsltc.trax.TransformerFactoryImpl";
Properties props = System.getProperties();
props.put(key, value);
System.setProperties(props);
1.4 +2 -2 xml-xalan/java/xdocs/sources/xsltc/xsltc_trax.xml
Index: xsltc_trax.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xsltc/xsltc_trax.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- xsltc_trax.xml 2001/08/10 16:35:58 1.3
+++ xsltc_trax.xml 2001/09/13 18:43:20 1.4
@@ -166,8 +166,8 @@
The crux of the integration strategy is the pluggable TransformerFactory class. The
JAXP specifies that the actual TransformerFactory implementation be controlled by the
-a Java system property (javax.xml.transformer.TransformerFactory) . This system property can be specified in the usual ways, for
-example in a properties file or on the command line as a -D optionpassed to thejava
+a Java system property (javax.xml.transform.TransformerFactory) . This system property can be specified in the usual ways, for
+example in a properties file or on the command line as a -D option passed to the java
engine itself. The strategy involves writing a TransformerFactory for Translets.
In the JAXP the TransformerFactory is an abstract class. In Xalan, the system
property specifies the implementation class TransformerFactoryImpl (org.apache.xalan.processor.TransformerFactoryImpl).
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org