6 Replies Latest reply on Jul 6, 2009 8:04 AM by Ravi Kiran Venkatanaranaya

    Problem in XML to CSV transformation


      I am exploring jboss-soa-p.4.2.0. I am facing a problem with XML to CSV transformation.
      Smooks does not give any direct way of XML to CSV transformation.So I have tried this transformation using XSLT but it is not working as desired.

      The trouble is it is not working when I am running this with jboss-soa-p.4.2.0 which uses Smooks 0.9. This works correctly with Smooks 1.0 used in later versions of Jboss ESB .

      In the result with Smooks 0.9, i am getting the desired csv within the root element "AssignedTaskDetails".

      My input xml is :

      <xml version="1.0"?>
       <TaskCompletionTime> EOD</TaskCompletionTime>
       <TaskresponseDetails> will do</TaskresponseDetails>

      The result I obtain is:

      The smooks config is:
      <?xml version='1.0' encoding='UTF-8'?>
      <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
       <resource-config selector="task">

      My BasicXslTransform is:
      <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0"
      <xsl:output method="text"/>
      <xsl:template match="AssignedTaskDetails">
       <xsl:apply-templates select="task"/>
      <xsl:template match="task">
       <xsl:for-each select="*">
       <xsl:value-of select="."/>
       <xsl:if test="position() != last()">
       <xsl:value-of select="','"/>
       <xsl:text> </xsl:text>

      In smooks-config if I give resource-config selector as "AssignedTaskDetails" then the result is same as the input xml.

      How should i go about this?