Executing a Smooks based transform is is very easy. You use the Smooks class as follows:
// Instantiate Smooks with the config...
(1) Smooks smooks = new Smooks("smooks-config.xml");
// Create an exec context - no profiles....
(2) ExecutionContext executionContext = smooks.createExecutionContext();
// Filter the input message source to the output message result, using the execution context...
(3) smooks.filter(new StreamSource(messageInStream), new StreamResult(messageOutStream), executionContext);
Of course, you'd typically cache the Smooks instance.
Labels