EXPAT is a library for parsing XML documents. It's the underlying
XML parser for the open source Mozilla project, perl's XML::Parser, and
other open-source XML parsers.
EXPAT is a stream-oriented parser. You register callback (or handler)
functions with the parser and then start feeding it the document. As the
parser recognizes parts of the document, it will call the appropriate
handler for that part, if you've registered one. The document is fed to
the parser in pieces, so you can start parsing before you have the whole
document. This also allows you to parse really huge documents that won't
fit into memory.
Author James Clark's web site:
On any ARC cluster, check the installation details
by typing "module spider expat".
EXPAT requires that the appropriate module be loaded before it can be run.
One version of the appropriate commands for use on NewRiver is:
module purge module load gcc/5.2.0 module load expat/2.2.4
The following batch file demonstrates the use of a program that
works with the EXPAT library, reading an XML file and producing an
outline of the data it contains:
#! /bin/bash # #PBS -l walltime=00:05:00 #PBS -l nodes=1:ppn=1 #PBS -W group_list=newriver #PBS -q open_q #PBS -j oe # cd $PBS_O_WORKDIR # module purge module load gcc/5.2.0 module load expat/2.2.4 # echo "EXPAT_NEWRIVER: Normal beginning of execution." # gcc -c -I$EXPAT_INC expat_test.c if [ $? -ne 0 ]; then echo "EXPAT_NEWRIVER: Compile error!" exit 1 fi # gcc -o expat_test expat_test.o -L$EXPAT_LIB -lexpat if [ $? -ne 0 ]; then echo "EXPAT_NEWRIVER: Load error!" exit 1 fi rm expat_test.o # ./expat_test < expat_test.xml > expat_newriver.txt if [ $? -ne 0 ]; then echo "EXPAT_NEWRIVER: Run error!" exit 1 fi rm expat_test # echo "EXPAT_NEWRIVER: Normal end of execution." exit 0
A complete set of files to carry out a similar process are available in