
Parser parser = ParserFactory.makeParser(PARSER_NAME);
parser.setDocumentHandler(cheapest);
// invokes the parser against the price list
parser.parse(args[0]);
// prints the results
System.out.println(“The cheapest offer is “ +
cheapest.getVendor() +
“ ($” + cheapest.getMinimum() + ‘)’);
}
}
Compiling the Example
To compile this application, you need a Java Development Kit (JDK) for
your platform. For this example, the Java Runtime is not enough. You can
download the JDK from
java.sun.com. Furthermore, you have to download
the IBM parser, XML for Java, from www.alphaworks.ibm.com.
As always, I will post updates on www.mcp.com. So, if you have problems
downloading ...