Fwd: Re: [xsl] XSLT in JDK1.5 from the command line

Subject: Fwd: Re: [xsl] XSLT in JDK1.5 from the command line
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 25 Mar 2005 10:21:54 -0500

This is awesome: you appear to have nailed it. Thanks for finding this. Now it's more findable. Nice score.

So from here on out we'll ship a .jar and not make assumptions about the Java installation. Maybe it's better that way.


Date: Fri, 25 Mar 2005 05:44:14 -0800 (PST)
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Subject: Re: [xsl] XSLT in JDK1.5 from the command line
To: wapiez@xxxxxxxxxxxxxxxx

Hi Wendell,
  I installed J2SE 1.5 and did some fact finding about
"using XSLT from command line in JDK1.5". I
uninstalled J2SE 1.4 completely before trying J2SE

Here are my findings..
This is a bug!

Its listed at Sun's site:

As written at the URL you provided, old package names
(org.apache.xalan.xslt etc) are *now not shipped* with
JDK1.5 . As stated at the URL, its done because newer
versions of Xalan are continuously coming, so users
should be able to install the new builds with ease.
Earlier this was possible with endorsed standard
mechanism. But since that was inconvenient, now with
JDK1.5 the package names are being changed (to
com.sun.org.apache.xalan.internal.xslt , instead of
org.apache.xalan.xslt) . So if we need to run latest
Xalan from command line, we need to download Xalan-J
from Apache's site and put xalan.jar in CLASSPATH.

*But JDK1.5 does provide XSLT processor to be run from
command line.* The class is -
(earlier this was called
But class
com.sun.org.apache.xalan.internal.xslt.Process *has a
bug* (this is also reported on Sun's site at URL
above). It does not have a main method. Instead it has
_main method . This you can verify with JDK utility
javap (to be run as: javap
com.sun.org.apache.xalan.internal.xslt.Process )

Other commands like
com.sun.org.apache.xalan.internal.Version also have
bug. It has no main method.

As written at the bug URL above, Sun will not fix this

As suggested by you, I wrote these wrapper classes to
invoke _main method..
Program 1
public class xalanProcess {
  public static void main(String[] args)
process = new

Please invoke as:
java xalanProcess -in file.xml -xsl file.xsl
(it works as expected)

Program 2
public class xalanVersion {
  public static void main(String[] args)
     com.sun.org.apache.xalan.internal.Version version
= new com.sun.org.apache.xalan.internal.Version();

Please invoke as:
java xalanVersion
(produces output - Xalan Java 2.6.0)

I hope you would agree with my findings..


"Thus I make my own use of the telegraph, without consulting
the directors, like the sparrows, which I perceive use it
extensively for a perch." -- Thoreau

Current Thread