DOMCount

Building DOMCount

On Windows Platforms:

Load the <xml4c2InstallDir>\samples\Projects\Win32\VC6\samples. dsw Microsoft Visual C++ workspace inside your MSVC IDE. Then build the project marked DOMCount.

On UNIX (AIX, Solaris, HP-UX, Linux):

Make sure you have set your environment variable ROOTDIR to point to the top-most directory where you installed XML4C.

cd <xml4c2InstallDir>/samples/Projects/ <platform>
make -f DOMCount.mak COMPILESWITCH="-w -O"

where <platform> is the platform you are working on.This will create the object files in the <xml4c2InstallDir>/bin/obj/DOMCount directory and the executable named DOMCount in '<xml4c2InstallDir>/bin' directory. If the 'bin' or 'obj/DOMCount' directory do not exist then the build will fail. In that case you need to create the missing directory(s) under ' <xml4c2InstallDir>' directory.

To delete the object and executable files of DOMCount:

    cd <xml4c2InstallDir>/samples/Projects/<platform>
    make clean -f DOMCount.mak

This would delete all the object files (.o files) from your 'obj/DOMCount' sample directory and the executable from '<xml4c2InstallDir>/bin' directory.

Running DOMCount

The DOMCount sample parses an XML file, using either a validating or non-validating DOM parser configuration, builds a DOM tree, and then counts and prints the number of elements in the tree. To run DOMCount, enter the following:

    domcount <filename>

The -v option is used when you wish to use a validating parser. Here is a sample output for DOMCount when the validating parser is used:

    cd <xml4c2InstallDir>/samples/data
    domcount -v personal.xml
    personal.xml: 20 ms (37 elems).

The output of both versions should be same.

Note: The time reported by the system may be different, depending on your processor type.

Copyright (c) IBM Corp. 1999, Center for Java Technology, Cupertino, USA