5 Replies Latest reply on Feb 2, 2011 5:15 PM by tfennelly

    Transform issue

    bglasco1

      I am doing a transform with smooks freemarker. It seems to work fine with the major exception that it does not iterate the data. I send through an xml file with 4 items to transform. It returns 4 items but all with the same data as the first item. Am I missing something?

       

      <ftl:freemarker applyOnElement="programme">

          <ftl:template><![CDATA[ 

           <programme ppv='No' trick-play-restricted=''  channel='${.vars["tv"]["programme/LINEUP_ID"]}'>

          </programme> 

      ]]></ftl:template>

       

      result should be 66, 67, 68, 69:

       

      [Stream Templating Result ...]

          |--

          |<tv>

          |    

          |     <programme ppv='No' trick-play-restricted=''  channel='66'>

          |    </programme> 

          |

          |    

          |     <programme ppv='No' trick-play-restricted=''  channel='66'>

          |    </programme> 

          |

          |       

          |     <programme ppv='No' trick-play-restricted=''  channel='66'>

          |    </programme> 

          |

          |       

          |     <programme ppv='No' trick-play-restricted=''  channel='66'>

          |    </programme> 

          |

          |   </tv>

          |--

        • 1. Re: Transform issue
          beve

          Hi,

           

          can you post the rest of you Smooks configuration?

           

          Also, you enable the 'reportPath' property on the SmooksAction it will generate a report that might help you locate the cause:

          <property name="reportPath" value="/tmp/smooks-report.html" />
          

           

          Regards,

           

          /Daniel

          • 2. Transform issue
            bglasco1

            <?xml version="1.0" encoding="UTF-8"?><smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd">

              <params>

                <param name="inputType">input.xml</param>

                <param name="input.xml" type="input.type.deactived">File:/C:\jbossesb\ftp\epgout.xml</param>

                <param name="input.xml" type="input.type.actived">File:/C:\jbossesb\ftp\export2.xml</param>

                <param name="default.serialization.on">false</param>

                <param name="stream.filter.type">SAX</param>

              </params>

             

              <ftl:freemarker applyOnElement="programme">

                <ftl:template><![CDATA[ <tv>

                 <programme ppv='No' trick-play-restricted=''  channel='${.vars["tv"]["programme/LINEUP_ID"]}'>

                </programme> 

            </tv>]]></ftl:template>

                <param name="modelSrc">File:/C:\jbossesb\ftp\sourceEPG.xml</param>

                <param name="modelSrcType">XML</param>

                <param name="messageType">XML</param>

                <param name="templateDataProvider">input</param>

              </ftl:freemarker>

              <resource-config selector="tv">

                <resource>org.milyn.delivery.DomModelCreator</resource>

              </resource-config>

            </smooks-resource-list>

            • 3. Transform issue
              tfennelly

              So this is generated by the Smooks Editor.  Looks like you have not identified the collection fragment in the message... you just mapped the values across from source to target.

              • 4. Transform issue
                bglasco1

                Ok what is the collection fragment?

                • 5. Transform issue
                  tfennelly

                  Check out these screencasts, in particular how collections are handled... http://smooks.org/mediawiki/index.php?title=Eclipse_IDE