// Create a ParserContext to listen for Metadata
// events. We are using a custom listener to extend the
// behaviour of the standard ones.
ParserContext ctx = new ParserContext();
StringBufferXMLParserListener listener = new StringBufferXMLParserListener("bmp.dtd");
ctx.addListener(listener);
// Attempt to harvest the metadata.
try {
// Make sure the Harvester System is initialised.
Config.getInstance();