~vcs-imports/xena/trunk

« back to all changes in this revision

Viewing changes to ext/src/xalan-j_2_7_1/xdocs/sources/xsltc/README.xsltc

  • Committer: matthewoliver
  • Date: 2009-12-10 03:18:07 UTC
  • Revision ID: vcs-imports@canonical.com-20091210031807-l086qguzdlljtkl9
Merged Xena Testing into Xena Stable for the Xena 5 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
NAME
 
2
        xsltc - optional command wrapper for Apache/Xalan XSLT Compiler 
 
3
 
 
4
SYNOPSIS
 
5
        xsltc [-o <output>] [-d <directory>] [-j <jarfile>] 
 
6
              [-p <package name>] [-uxhsi] [<stylesheet>... ]
 
7
 
 
8
DESCRIPTION
 
9
        This command-line tool is a wrapper for the Java class
 
10
        org.apache.xalan.xsltc.cmdline.Compile. (See CODE below)
 
11
 
 
12
        The Sun XSLT Compiler is a Java-based tool for compiling XSLT
 
13
        stylesheets into lightweight and portable Java byte codes 
 
14
        called translets.  
 
15
 
 
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).
 
21
 
 
22
OPTIONS
 
23
 
 
24
        The following options are supported:
 
25
 
 
26
        -o <output>
 
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.
 
32
 
 
33
        -d <directory>
 
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>.
 
38
 
 
39
        -j <jarfile>
 
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.
 
43
 
 
44
        -p <package name>
 
45
                Specify a package name for all generated translet
 
46
                class.
 
47
 
 
48
        -u
 
49
                Specifies that <stylesheet> location will be a URI
 
50
                such as 'http://myserver/stylesheet1.xsl'.
 
51
 
 
52
        -i
 
53
                Specify that the stylesheet should be read from stdin.
 
54
 
 
55
        -x
 
56
                Turn debugging messages on.
 
57
 
 
58
        -h
 
59
                Output help screen.
 
60
 
 
61
        -s
 
62
                Prevent the command line tool from calling System.exit()
 
63
 
 
64
 
 
65
OPERANDS
 
66
 
 
67
        The following operand is supported:
 
68
 
 
69
        <stylesheet>    A path name of an input stylesheet file. 
 
70
 
 
71
CODE
 
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'.
 
75
 
 
76
        #!/bin/sh
 
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
 
85
 
 
86
        CLASSPATH=.:${JAR}:${XER}:${XML}:${JCPR}:${BCEL}:${JCP}:${JLEX}:${REGEXP}
 
87
        java -cp ${CLASSPATH} org.apache.xalan.xsltc.cmdline.Compile "$@"
 
88
        
 
89
 
 
90
EXAMPLES
 
91
        Example 1:  Creating a translet from stylesheet 'hamlet.xsl'.
 
92
 
 
93
        example%  xsltc hamlet.xsl
 
94
 
 
95
        would produce a set of class files such as 'hamlet.class',
 
96
        'hamlet$0.class', 'hamlet$1.class'.
 
97
 
 
98
        Example 2:  Outputting all classes into a jar file.
 
99
 
 
100
        example%  xsltc -j hamlet.jar hamlet.xsl
 
101
 
 
102
        would produce a single jar file output, 'hamlet.jar' which would
 
103
        contain all the generated .class files for the hamlet translet.
 
104
 
 
105
        Example 3: Naming the class file.  
 
106
 
 
107
        example%  xsltc -o newhamlet hamlet.xsl
 
108
 
 
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.       
 
112
 
 
113
        Example 4: Multiple stylesheets. 
 
114
 
 
115
        example%  xsltc hamlet1.xsl hamlet2.xsl hamlet3.xsl
 
116
 
 
117
        would produce a set of class files derived from the three
 
118
        stylesheets. 
 
119
 
 
120
        Example 5: Package Specification.
 
121
 
 
122
        example% xsltc -p com.mycompany.translets hamlet.xsl
 
123
 
 
124
        would produce a set of class files such as 
 
125
        'com/mycompany/translets/hamlet.class',
 
126
        'com/mycompany/translets/hamlet$0.class', etc.
 
127
 
 
128
FILES
 
129
        file.xsl                input XSLT stylesheet
 
130
        file.class              byte code file
 
131
        file.jar                java archive file
 
132
        
 
133
SEE ALSO
 
134
        xslt, jar.
 
135
 
 
136
BUGS
 
137
        See the Apache JIRA issue tracker: http://issues.apache.org/jira
 
138
 
 
139
AUTHORS
 
140
        Morten Jorgensen,                  morten.jorgensen@ireland.sun.com
 
141
        G. Todd Miller,                            todd.miller@east.sun.com
 
142
        Santiago Pericas-Geertsen
 
143
        Jacek Ambroziak