This section describes a tutorial example on how to verify the installation of the Xerces2 Java 2.11.0 XML Schema 1.1 Beta version by running a sample program dom.Counter.
After installing the Xerces2 Java 2.11.0 XML Schema 1.1 Beta version,
I want to run some sample programs provided in the xercesSamples.jar file
to verify the installation.
For example, the dom.Counter sample program uses a DOM parser to count
the total number of elements and attributes in an XML file.
dom.Counter is provided as a pre-compiled .class in the xercesSamples.jar.
To run dom.Counter, I need to included xercesSamples.jar and other .jar files
provided in the installation package in the "-cp" option in the "java" command line.
To avoid repeating this long "-cp" option, I
I created as two small .bat files to help me compile and run Java programs:
Note that "^^^" indicates a line break inserted because of the limitation of the book format.
You need to remove "^^^" and join the rest of the line with the previous line.
Now let's try to use jdk8x2r.bat to run dom.Counter:
Okay. The Xerces2 Java 2.11.0 XML Schema 1.1 Beta version seems to be installed correctly.
I see the counts in the output: "1 elems, 0 attrs, 0 spaces, 12 chars".