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 |
Cheers, Wendell
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 1.5.
Here are my findings.. ---------------------- This is a bug!
Its listed at Sun's site: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5099865
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 - com.sun.org.apache.xalan.internal.xslt.Process (earlier this was called org.apache.xalan.xslt.Process) 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 bug.
As suggested by you, I wrote these wrapper classes to invoke _main method.. Program 1 --------- public class xalanProcess { public static void main(String[] args) { com.sun.org.apache.xalan.internal.xslt.Process process = new com.sun.org.apache.xalan.internal.xslt.Process(); process._main(args); } }
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(); version._main(args); } }
Please invoke as: java xalanVersion (produces output - Xalan Java 2.6.0)
I hope you would agree with my findings..
Regards, Mukul
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSLT in JDK1.5 from the c, Wendell Piez | Thread | Re: Fwd: Re: [xsl] XSLT in JDK1.5 f, Kevin Rodgers |
Re: [xsl] in this xsl , why dont ge, Joe Fawcett | Date | [xsl] Attribute List, Carmelo Montanez |
Month |