1 Reply Latest reply on Dec 17, 2008 10:00 AM by ashok_1979

    XML to XML transformation

      Hi All,
      i have one xml in below format

      <ShipmentBO>
       <shipmentID>4407</shipmentID>
       <transMode>3</transMode>
       <carrierID>203976</carrierID>
       <createdTS>407</createdTS>
       <createdBY>2008-10-21 20:34:42.0</createdBY>
       <distance>2088</distance>
       <controllingOrgID>2780</controllingOrgID>
       <statusID>9</statusID>
       <shipHasStopes>0</shipHasStopes>
       <branchID>2882</branchID>
       <bookedBY>409</bookedBY>
      </ShipmentBO>

      i want to transform this xml in below format
      <ShipmentData shipmentID=4407
       transMode=3
       carrierID=203976
       createdTS=407
       createdBY=2008-10-21 20:34:42.0
       distance=2088
       controllingOrgID=2780
       statusID=9
       shipHasStopes=0
       branchID=2882
       bookedBY=409 >
      </ShipmentData>
      

      to achive this i have created one smooks configuration file in this format

      <?xml version="1.0"?>
      <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd" default-target-profile="from:source-java">
      
       <resource-config selector="ShipmentBO">
       <resource type="xsl">
       <![CDATA[
       <ShipmentData
       shipmentID="{shipmentID}"
       transMode="{transMode}"
       carrierID="{carrierID}"
       createdTS="{createdBY}"
       createdBY="{createdTS}"
       distance="{distance}"
       controllingOrgID="{controllingOrgID}"
       statusID="{statusID}"
       shipHasStopes="{shipHasStopes}"
       branchID="{branchID}"
       bookedBY="{bookedBY}" >
       </ShipmentData>
       ]]>
       </resource>
       <param name="is-xslt-templatelet">true</param>
       </resource-config>
      
      </smooks-resource-list>
      


      But i don't know why the transformed xml is same as input xml.
      I am using esb server 4.4 GA, i had tried "transform_XML2XML_stream" quick start that is working fine for me.
      One difference i have observed is that, the input and output xml format is different in the quick start.

      If any one has performed this type of transformation please let me know so i can move forward.