// Get a refenrence to the translet class
final Class tc = Class.forName(transletName);
// Instanciate and initialise the tranlet object
AbstractTranslet translet = (AbstractTranslet)tc.newInstance();
((AbstractTranslet)translet).setMessageHandler(msgHandler);
// Create output handler
TransletOutputHandlerFactory tohFactory =
TransletOutputHandlerFactory.newInstance();
tohFactory.setOutputType(TransletOutputHandlerFactory.STREAM);
tohFactory.setEncoding(translet._encoding);
tohFactory.setOutputMethod(translet._method);
tohFactory.setWriter(out);
getDOM(documentUrl);
final long start = System.currentTimeMillis();
// Set size of key/id indices
translet.setIndexSize(_dom.getSize());
// If there are any elements with ID attributes, build an index
_dtdMonitor.buildIdIndex(_dom, 0, translet);
// Pass unparsed entities to translet
translet.setUnparsedEntityURIs(_dtdMonitor.
getUnparsedEntityURIs());
// Do the actual transformation
translet.transform(_dom, tohFactory.getTransletOutputHandler());
final long done = System.currentTimeMillis() - start;
out.println("<!-- transformed by XSLTC in "+done+"msecs -->");
}
// Now close up the sink, and return the HTML output in the