Does anybody here understand Xerces? I am working on my XML Certification and it bothers me that I can't get Xerces to run. The run instructions on xerces.apache.org are non-existant.
Step 01 - download the Xerces files to my c drive:
c:\Xerces-J-bin.2.2.1.zip
c:\Xerces-J-src.2.2.1.zip
c:\Xerces-J-tools.2.2.1.zip
Step 02 - unpack the zip files:
c:\>jar xf Xerces-J-bin.2.2.1.zip
c:\>jar xf Xerces-J-src.2.2.1.zip
The above two commands will place the contents into: c:\xerces-2_2_1
c:\>jar xf Xerces-J-tools.2.2.1.zip
The above command will place the contents into: c:\tools
Step 03 - Set the path:
c:\>set path=c:\jdk1.4.0\bin
Step 04 - Set the CLASSPATH:
c:\>set CLASSPATH=c:\xerces-2_2_1\xercesSamples.jar;c:\xerces-2_2_1\xercesImpl.jar;c:\xerces-2_2_1\xmlParserAPIs.jar
Step 05 - Create an XML File named "intro.xml" and place inside xerces-2_2_1 folder:
<?xml version = "1.0"?>
<myMessage>
<message>Figure this stuff out!!!</message>
</myMessage>
Step 06 - Run the sample sax program named "Counter":
c:\>xerces-2_2_1\java sax.Counter intro.xml
I get these results:
intro.xml: 118 ms (2 elems, 0 attrs, 0 spaces, 31 chars)
/////////////////////////////////////
Things are fine so far - but how do I compile my own programs?
This text is from the "Installation" section of the Xerces Apache web site ==> "In order to compile the source code using
Ant or to build the release distributions yourself, you must have the contents of Xerces-J-tools.2.2.1.zip on your classpath; i.e., you will need access to a version of ant.....For ease of use, we recommend extracting Xerces-J-tools.2.2.1.zip in your xerces root directory; the build.sh and build.bat scripts are written for this case."
//////////////////////////////////////////////
Background Story: There are no "readme.txt" files anywhere regarding the "tools" file folder, OR the "build.sh" file or the "build.bat" file.
My questions/comments:
1. In plain English, is this what they mean => If I want to make a change to the sax.Counter program, I need to put the entire tools folder in my classpath and run one of the provided batch files (either build.sh or build.bat).?
2. I guess the "build.bat" file is for windows? NOTE: the build.bat file they provided references two separate jar files that do not appear to exist, so maybe they have errors in their batch files? (I am talking about the c:\tools\bin\xjavac.jar file and also the c:\jdk1.4.0\lib\classes.zip file.)
3. I guess the "build.sh" file is for UNIX?
These are my steps to making my own source code changes (I tried to make out what they are doing in the build.bat file and follow it
Step 01 - set the Path:
c:\xerces-2_2_1>set path=jdk1.4.0\bin
Step 02 - set the JAVA_HOME per their batch file instructions:
c:\xerces-2_2_1> set JAVA_HOME=c:\jdk1.4.0\bin\java.exe;c:\jdk1.4.0\lib\tools.jar
Step 03 - set the CLASSPATH (add the tools jars):
c:\xerces-2_2_1> set CLASSPATH=
c:\xerces-2_2_1\xercesImpl.jar;c:\xerces-2_2_1\xercesSamples.jar;c:\xerces-2_1_1\xmlParserAPIs.jar;c:\tools\ant.jar;c:\tools\xercesImpl.jar;c:\tools\xml-apis.jar
Step 04: I save the sax.Counter program as sax.Counter1 and within the program change all occurances of "Counter" to "Counter1" and try to recompile as follows:
c:\xerces-2_2_1>javac sax.Counter1.java
I get these results:
error: cannot read : sax.Counter1.java
Step 05: Even the provided sax.Counter can not be recompiled:
c:\xerces-2_2_1>javac sax.Counter.java
I get these results:
error: cannot read : sax.Counter.java
MY CONCLUSION AT THIS POINT:
Their batch file instructions refer to two file that do not exit:
c:\jdk1.4.0\lib\classes.zip <- this zip file does not exist as part of JDK1.4.0
c:\tools\bin\xjavac.jar <- this jar file does not exist in Xerces-2_2_1
Interpreting batch files is not one of my strong points. Does anyone have suggestions?