I tried using Neha's code for smooks-config.xml and XSLT file.
I used smooks filters to execute the transformation.
Smooks smooks = new Smooks("pdm_transformXML2CSV.xml");
| try {
| // Create an exec context - no profiles....
| ExecutionContext executionContext = smooks.createExecutionContext();
| // The result of this transform is a set of CharArray...
| CharArrayWriter outputWriter = new CharArrayWriter();
| // Configure the execution context to generate a report...
| executionContext.setEventListener(new
HtmlReportGenerator("report.html"));
|
| // Filter the input message to extract, using the execution context...
| smooks.filter(new StreamSource(new ByteArrayInputStream(messageIn)), new
StreamResult(outputWriter), executionContext);
|
|
| System.out.println("***************************");
| //System.out.println("Message Status " +
pdm.getMsgHeader().getMessageStatus());
| System.out.println("Message Header is " +
outputWriter.toString());
| System.out.println("***************************");
| } finally {
| smooks.close();
| }
|
|
Everything is working fine and I'm able to get exact CSV being transformed from XML
template. Thanks Neha for your code - helped me.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241970#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...