&xslt4jc-short;'>

In April 2001, Sun donated &xslt4jc-short; to the Xalan project. &xslt4jc-short; compiles stylesheets into translets and provides a runtime environment for using translets to transform XML documents. Initially, &xslt4jc-short; is available in a separate JAR. Over time, we plan to integrate the two codebases. For more information, see Using &xslt4jc-short;, &xslt4jc-short; Release Notes, and &xslt4jc-short; Design.

'> For &xslt4jc-short; changes since &xslt4jc-short; was incorporated into &xslt4j;, see &xslt4jc-short; software changes.'> If you are using &xslt4jc-short;, see Setting the system classpath for &xslt4jc-short;.

'> translets'>

You can use the TrAX/JAXP 1.2 interfaces to compile and run translets. For this release, you must still use StreamSource objects for the XSL stylesheet and XML input document, and a StreamResult object for the transformation output. For an overview of the usage patterns these samples illustrate, see Calling &xslt4jc-short; with the TrAX/JAXP API.

Important: To run these samples, you must compile the sample class files and adjust the system classpath.

  1. To compile the samples, you can run the Ant build from the root directory as follows:

      build xsltc.samples

  2. Add xsltc.jar, runtime.jar, BCEL.jar, java_cup.jar, and the samples/translets subdirectory to the classpath
The JAR files listed above are in the bin directory. The samples/translets directory contains the sample class files as well as the translet class file that is generated at tun time (todo.class from the todo.xsl stylesheet).

What it does: Uses the &xslt4jc-short; TransformerFactory to compile a translet and use the translet to transform the &xslt4jc-short; to-do list from XML into HTML.

Complete the steps detailed above, and run this sample from the translets subdirectory with

java JAXPTransletOneTransformation

View the result in todo-xsltc.html.

What it does: Uses the &xslt4jc-short; TransformerFactory to compile a translet and use the Templates object associated with the translet to transform the &xslt4jc-short; and Xalan to-do lists from XML into HTML.

Complete the steps detailed above, and run this sample from the translets subdirectory with

java JAXPTransletOneTransformation

View the results in todo-xsltc.html and todo-xalan.html.

Other &xslt4jc-short; samples are located in the following samples subdirectories:

  • CompiledServlet
  • CompiledBrazil
  • CompiledJAXP
  • CompiledApplet
  • CompiledEJB

For information about each of these samples, consult the README file in the subdirectory.

The following paragraphs supply some basic background information for CompiledServlet and CompiledBrazil.

&xslt4jc-short; provides demos for using &xslt4jc-short; as a servlet and as a handler for Brazil (a new and powerful Web techology from Sun labs).

To run the Brazil-handler demo, download Brazil from sunlabs:

    http://research.sun.com/research/download/index.html

The translet must be specified as a pure class name, accessible through the Brazil-handler's classpath. For example:

    translet=mk054

The document must be specified as a valid URL. For example:

    document=http://server/path/to/filename.xml

If the file is local to the Brazil handler, it has to be specified using the "file:filename.xml" format.

In order to run the Brazil-handler demo, you also need to make the Brazil and javax classes available from your classpath

To run the servlet demo, download the java extensions for servlets from Sun:

     http://java.sun.com/products/servlet/download.html

'>