Friday, February 14, 2014

XML to Text transformation using smooks mediator

Smooks mediator can be used to apply transformations. Inputs can be provided as text/xml and smooks transformation resource has to be passed as an external resource.
Here is the sample smooks mediator configuration and smooks configuration which can be used to read an xml element from the input and parse it to a preferred output xml format.

Smooks meditaor config;

<smooks config-key="smooks">
               <input type="xml" expression="//csv/arg0"/>
               <output type="text"/>

Sample request;

<soapenv:Envelope xmlns:soapenv= >

Smooks configuration;

<smooks-resource-list xmlns="">
   <resource-config selector="org.xml.sax.driver">
    <param name="fields" type="string-list">RecordID,FileNumber,CorporationName</param>

<soapenv:Envelope xmlns:soapenv="">
<ax:text xmlns:ax="">
<csv-record number="1">

No comments:

Post a Comment