One way to use Xalan in the CS environment.

Spring 2010

1. login to a linux machine (station12.cs.utep.edu etc).

2. Follow the instructions at 

http://xml.apache.org/xalan-j/downloads.html to download the file. 

The one I took was  xalan-j_2_7_1-bin.zip from http://mirror.its.uidaho.edu/pub/apache/xml/xalan-j/

3. Unpack the file. I extracted everything to /home/nigel/xalan.

4. Set up the classpath.  There are different ways to do this, but I just opened up a konsole (terminal window) and typed 

export CLASSPATH=$CLASSPATH:/home/nigel/xalan/xalan.jar:/home/nigel/xalan/xercesImpl.jar:/home/nigel/xalan/xml-apis.jar  

if you're afraid you mistyped, it, look at the output of 

echo $CLASSPATH 

it should look something like this: 

:/home/nigel/xalan/xalan.jar:/home/nigel/xalan/xercesImpl.jar:/home/nigel/xalan/xml-apis.jar


5. Test that the classpath is okay. Just type java org.apache.xalan.xslt.EnvironmentCheck (as described at http://xml.apache.org/xalan-j/faq.html#faq-N10064)

the last line of the output should say "seems to be OK"

6. Go ahead and try java org.apache.xalan.xslt.Process, as described in class.

For example, 

  from the xalan directory, cd to samples/SimpleTransform.

  java org.apache.xalan.xslt.Process -IN birds.xml -XSL birds.xsl -OUT listing.txt

then view listing.txt

  If this fails, or if you prefer not to use the command line, try steps 7 and 8.

7. Following the instructions at http://xml.apache.org/xalan-j/getstarted.html#samples, from the xalan directory, cd to samples/SimpleTransform.

create a jar file with javac SimpleTransform.java 

export CLASSPATH=$CLASSPATH:/home/nigel/xalan/samples/SimpleTransform/SimpleTransform.jar

java SimpleTransform

observe that birds.out has been created.

8. From this point you can presumably copy and edit SimpleTransform.java to do what you want.