CATS Setup - Lab #1 - XML Parsing

If you are performing this assignment on the CATS machines, you need to perform the following setup steps before starting your work:

  1. Make sure you're using the most recent version of the Java SDK running on the CATS machines by adding /usr/local/java/j2sdk/bin into your PATH environment variable. This can be accomplished by adding the following line to the end of your .cshrc file (located in your home directory):

    set path=(. /usr/local/java/j2sdk/bin $path )
  2. Load these changes into your active shell:

    unix> source .cshrc
  3. Verify the changes were made:

    unix> printenv PATH
    .:/usr/local/java/j2sdk/bin:/local/bin:/usr/afsws/bin:/...
  4. Now add the Xerces parser into your CLASSPATH environment variable. This is done by adding the following lines to the end of your .cshrc file.

    setenv XERCES /afs/cats.ucsc.edu/class/cmps183-jw.s03/xerces-2_4_0/
    setenv CLASSPATH .:$XERCES/xercesImpl.jar:$XERCES/xercesSamples.jar:$XERCES/xmlParserAPIs.jar

  5. Load these changes into your active shell:

    unix> source .cshrc
  6. Verify the changes were made:

    unix> printenv CLASSPATH
    .:/afs/cats.ucsc.edu/class/cmps183-jw.s03/xerces-2_4_0/xercesImpl.jar:
         /afs/cats.ucsc.edu/class/cmps183-jw.s03/xerces-2_4_0/xercesSamples.jar:
         /afs/cats.ucsc.edu/class/cmps183-jw.s03/xerces-2_4_0/xmlParserAPIs.jar
  7. Verify that Xerces is set up correctly by running a sample program that comes with the Xerces distribution:

    unix> cd $XERCES
    unix> java sax.Counter data/personal.xml
    data/personal.xml: 148 ms (37 elems, 18 attrs, 140 spaces, 128 chars)

    (Note that the execution time reported--the value before the "ms"--will vary, but the other values should match exactly. Also note that the upper case "C" is important in sax.Counter above.)

Last modified: 1/15/2004