Re: [xsl] Xalan-Java Windows installation

Subject: Re: [xsl] Xalan-Java Windows installation
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 02 May 2005 18:15:53 -0400
Hi Maria,

At 05:24 PM 5/2/2005, you wrote:
I am migrating a set of stylesheets from a Microsoft to a Java environment.
The stylesheets were originally written for the MSXML4 parser, but now they
are going to use Xalan-Java.

I'd like to install Xalan-Java for Windows on my desktop so that I can view
transformations locally. So far I have downloaded the current Xalan-Java
binary (xalan-j-current-bin.zip) as well as the Java 2 SDK
(j2sdk-1_4_2_08-windows-i586-p.exe). I'm not sure what to do next.

I'm not an XSL newbie but I am new to Java.

Well there's no such thing as "Xalan-Java for Windows", that's the first lesson. Java is Java, on any platform. :->


Unfortunately, since Xalan is just like most any other Java application, your question isn't really an XSL question, but sits on the edge.

But: you need to install and run a JVM (Java Virtual Machine), an application which in effect provides a little computer to run Java bytecode (the stuff you get when you download Xalan), inside your computer.

Once you've installed the Java SDK and unzipped Xalan, you can invoke Xalan from a command line -- Xalan docs give info on how to do that: see
http://xml.apache.org/xalan-j/commandline.html


The part you'll probably find confusing is the "classpath" bit. A good beginner's book to Java can help, but basically this is a matter of telling Java where to find Xalan. So for example if you have an environment variable XALANHOME you might say

java -cp %XALANHOME%/xalan.jar;%XALANHOME%/xml-apis.jar;%XALANHOME%/xercesImpl.jar -IN foo.xml -XSL foo.xsl -OUT foo.out

which will load Xalan and use it to transform 'foo.xml' into 'foo.out' using 'foo.xsl'. (The "-cp" flag indicates the classpath.)

If you're accomplished with shell scripts (e.g., on Windows, DOS batch files) you'll find that knowledge will come in handy for saving you from repetitive typing. People frequently load entire classpaths into environment variables; in my case I have so much Java all over my system that I tend to wrap these up into scripts.

Alternatively, you could try an XML/XSLT editing environment like oXygen, which installs in Windows, is written in Java, and runs Xalan for its transformations (you can also run Saxon in it if you like). This is a reasonably-priced editor that sets it all up for you: http://www.oxygenxml.com. (I'd make sure your machine has the horsepower to do this, however - it runs okay in a 1GHz processor w/ 384MB RAM.)

Or you could try http://www.xmlcooktop.com/, which isn't very fully-featured, and requires more in the way of setup. But it does wrap things up for you -- and the price is right.

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

Current Thread