XML Setup for Windows

©2001 by Wayne Pollock, Tampa Florida USA.  All Rights Reserved.


(See additional XML Resources for additional software and training sites.)

First setup the JDK (now known as the JSDK) by following these steps.  This setup must be modified by installing some additional software into the correct locations.  These steps are discussed below.

  1. Download the latest stable version of xerces for Java (xerces-J) and extract the contents of the .zip file to any location you wish.  (Ignore the .zip.sig files, you only are interested in the .zip for Windows systems.)  I used C:\jdk\xerces-j\ when I installed the Xerces-j 1.3.0 version.  (That is, extract to the directory C:\jdk or where ever you installed the jdk.)

    You can use jar to extract the archive or WinZip.  If you use WinZip you will probably end up creating an extra directory called meta-inf containing a single file manifest.mf.  You should delete this directory and the file.

  2. In the directory xerces-1_3_0 is a file called readme.html.  You should bookmark (add to Favorites) this file.  It includes lots of useful information on xerces including the API JavaDocs, sample programs, etc.
  3. To use the xerces parser the xerces.jar file must be found, possibly on your CLASSPATH, or by some other means.  This file contains all the packages and classes you need for XML parsing.  There are several different ways to set up your system to use this jar file.  For developement work, you are likely to use this XML parser often so I recommend installing it as a standard extension to Java.  In this way you don't need to change CLASSPATH or your javac commands at all.

    To setup the xerces.jar file of packages as a standard extension you need only put the jar file (or a copy) in the right directory.  The right directory depends on which JRE you use.  When you set up the JDK usually two separate JREs are installed!  If you also installed a newer version of the Java Plug-in (say 1.3.0_01) then you have another JRE to deal with.

    If you're not using the JDK (or JSDK as it is now known) then the simplist course is to modify your CLASSPATH, or use whatever mechanism your tool uses to locate packages.  (For example, both java and javac support a -classpath or -cp option, allowing you to specify jar files and directories containing packages.)

    For the standard setup used at HCC you should copy the xerces.jar file to the following directories:


    C:\jdk\jre\lib\ext
    C:\Program Files\Javasoft\JRE\1.3\lib\ext
    C:\Program Files\Javasoft\JRE\1.3.0_01\lib\ext

    (If one of the ext directories is missing, go ahead and create it.)


Deployment

The above setup works great on your system to develop and run stand-alone programs, or applets using the Java2 Plug-in.  However if you don't use the plug-in, or run the program/applet on a different system, or wish to make a single double-clickable jar, then you need to distribute the xerces.jar file with your applet or application.

For Applets not running on your system, you need to add the xerces.jar file to the <APPLET> tag as follows (addition is in boldface):

<APPLET CODE="SomeClass" HEIGHT="200" WIDTH="350" ARCHIVE="xerces.jar"> If your applet already uses a jar, it is ok to list more than one.  This APPLET tag should work even if you use HTMLConverter and run the Applet with the plug-in.

For deployment of a stand-alone clickable jar, I recommend you simply extract the contects of xerces.jar and add them to your own jar.  Now you only have a single jar for your application.




Additional XML Resources

See the XML FAQ (PDF).  (The latest version can be found at http://xml.silmaril.ie/.)

You may wish to install the Microsoft XML Notepad Editor.  This tool allows you to easily create and edit well-formed (and optionally validated) XML files.  (While you're at www.microsoft.com you may wish to upgrade Internet Explorer to the latest version (5.5 or newer), which contains a validating XML parser built-in.  You can also update the JVM (Java Virtual Machine) built into Windows 98.)

Information on other Apache XML related tools can be found on xml.apache.org.

Information can be found about XML in general at www.xml.org

One Java specific XML API is called JDOM.  You can get software and information on JDOM from www.jdom.org.

Many web standards include some XML, and these standards can be found at w3c.org (The World Wide Web Consortium).

You can find answers to questions and current information on the netnews group comp.text.xml.  (Newgroups can be access from groups.google.com, formerly known as www.deja.com.

Training on many web related technologies, including XML (but not necessarily Java-XML) can be found at www.w3schools.com.  (I recommend this site highly.)




Send comments and mail to the WebMaster.