2
xsltc - optional command wrapper for Apache/Xalan XSLT Compiler
5
xsltc [-o <output>] [-d <directory>] [-j <jarfile>]
6
[-p <package name>] [-uxhsi] [<stylesheet>... ]
9
This command-line tool is a wrapper for the Java class
10
org.apache.xalan.xsltc.cmdline.Compile. (See CODE below)
12
The Sun XSLT Compiler is a Java-based tool for compiling XSLT
13
stylesheets into lightweight and portable Java byte codes
16
The XSLT Compiler can be run on any platform including UNIX,
17
Windows, NT, Mac that supports Java 1.2.x or later. The generated
18
translets can be run on any platform that supports a Java
19
Runtime Environment, including a Palm Pilot with J2ME CLDC
20
(Java 2 Micro Edition, Connected Limited Device Configuration).
24
The following options are supported:
27
Changes the name of the generated translet class.
28
By default, the translet class would be named
29
<stylesheet>, if -o <output> is set, then the
30
translet class would be named <output>. Translet
31
class files are written as .class files.
34
Changes the destination directory. By default, any
35
translet class files generated would be placed in
36
the current working directory. If -d <directory>
37
is specified, the files would be output to <directory>.
40
Outputs all generated translet class files into a
41
jar file named <jarfile>.jar. When this option is
42
used only a jar file will be output.
45
Specify a package name for all generated translet
49
Specifies that <stylesheet> location will be a URI
50
such as 'http://myserver/stylesheet1.xsl'.
53
Specify that the stylesheet should be read from stdin.
56
Turn debugging messages on.
62
Prevent the command line tool from calling System.exit()
67
The following operand is supported:
69
<stylesheet> A path name of an input stylesheet file.
72
Here is an example wrapper script to implement this command.
73
You should define 'INSTALLDIR' to be the directory where you
74
have installed XalanJ, for example, '/usr/local/xml-xalan'.
77
JAR=${INSTALLDIR}/java/lib/xsltc.jar
78
XER=${INSTALLDIR}/java/lib/xercesImpl.jar
79
XML=${INSTALLDIR}/java/lib/xml-apis.jar
80
JCPR=${INSTALLDIR}/java/lib/runtime.jar
81
BCEL=${INSTALLDIR}/java/lib/BCEL.jar
82
JCP=${INSTALLDIR}/java/tools/java_cup.jar
83
JLEX=${INSTALLDIR}/java/tools/JLex.jar
84
REGEXP=${INSTALLDIR}/java/lib/regexp.jar
86
CLASSPATH=.:${JAR}:${XER}:${XML}:${JCPR}:${BCEL}:${JCP}:${JLEX}:${REGEXP}
87
java -cp ${CLASSPATH} org.apache.xalan.xsltc.cmdline.Compile "$@"
91
Example 1: Creating a translet from stylesheet 'hamlet.xsl'.
93
example% xsltc hamlet.xsl
95
would produce a set of class files such as 'hamlet.class',
96
'hamlet$0.class', 'hamlet$1.class'.
98
Example 2: Outputting all classes into a jar file.
100
example% xsltc -j hamlet.jar hamlet.xsl
102
would produce a single jar file output, 'hamlet.jar' which would
103
contain all the generated .class files for the hamlet translet.
105
Example 3: Naming the class file.
107
example% xsltc -o newhamlet hamlet.xsl
109
would produce a set of class files such as 'newhamlet.class',
110
'newhamlet$0.class', etc rather than the default which would
111
be 'hamlet.class', 'hamlet$0.class', etc.
113
Example 4: Multiple stylesheets.
115
example% xsltc hamlet1.xsl hamlet2.xsl hamlet3.xsl
117
would produce a set of class files derived from the three
120
Example 5: Package Specification.
122
example% xsltc -p com.mycompany.translets hamlet.xsl
124
would produce a set of class files such as
125
'com/mycompany/translets/hamlet.class',
126
'com/mycompany/translets/hamlet$0.class', etc.
129
file.xsl input XSLT stylesheet
130
file.class byte code file
131
file.jar java archive file
137
See the Apache JIRA issue tracker: http://issues.apache.org/jira
140
Morten Jorgensen, morten.jorgensen@ireland.sun.com
141
G. Todd Miller, todd.miller@east.sun.com
142
Santiago Pericas-Geertsen