2 Replies Latest reply on Dec 3, 2008 6:25 AM by Ashok Sharma

    Java2XML Smooks transformation example

    Ashok Sharma Newbie

      Hi All,

      Could anyone provide me a sample smooks transformation example to convert java to xml.

      I am unable to create mapping file. Please help.

      Thanks in advance.

        • 1. Re: Java2XML Smooks transformation example
          neha2911 Newbie

          Use the following snippet for smooks configuration.

          <?xml version="1.0"?>
          <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
          
           <resource-config selector="global-parameters">
           <param name="stream.filter.type">SAX</param>
           </resource-config>
          
          </smooks-resource-list>


          Or you can use JBoss ESB out of Box action for doing the same.

          <action name="transform" class="org.jboss.soa.esb.actions.converters.ObjectToXStream">


          • 2. Re: Java2XML Smooks transformation example
            Ashok Sharma Newbie

            Neha, Thanks a ton for your quick reply.
            i dont know why some times below configuration works but some times not.
            <?xml version="1.0"?>
            <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">

            <resource-config selector="global-parameters">
            SAX
            </resource-config>

            </smooks-resource-list>

            This code works


            This method transforms the java object into default XML, now i wanted to transform this default XML into some XML in different format.

            So how i can achive this, could you please help me out?

            Thanks in advance...