You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by German O <ge...@gmail.com> on 2012/09/26 20:33:52 UTC
Re: Converting CSV to XML
Hi, Is there a way to do this without passing throw a model?... just read the
csv, and put in the that format?..
My case is that the csv can change the columns, and then I have to output
another xml, so I use a xsl to translate to the final XML.
The idea is to put the csv into a simple XML like the one described here,
and with that simple format, I can easy do the xsl to create the final xmls.
thanks.
--
View this message in context: http://camel.465427.n5.nabble.com/Converting-CSV-to-XML-tp5711086p5720047.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Converting CSV to XML
Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Sep 26, 2012 at 8:33 PM, German O <ge...@gmail.com> wrote:
> Hi, Is there a way to do this without passing throw a model?... just read the
> csv, and put in the that format?..
>
> My case is that the csv can change the columns, and then I have to output
> another xml, so I use a xsl to translate to the final XML.
>
> The idea is to put the csv into a simple XML like the one described here,
> and with that simple format, I can easy do the xsl to create the final xmls.
>
You can use a bean or template engine to transform the file input to
your XML like structure.
Can turn the file into a List<List> which you can then loop in the
template to output the xml.
Some template engines are:
http://camel.apache.org/velocity
http://camel.apache.org/freemarker
Using a bean is of course just plain java code, and you can then make
the xml structure in code.
Using a CSV component like
http://camel.apache.org/csv
And there is other CSV and XML related components / data format
http://camel.apache.org/data-format.html
> thanks.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Converting-CSV-to-XML-tp5711086p5720047.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: Converting CSV to XML
Posted by Christian Müller <ch...@gmail.com>.
Use the file component to read the file, access the in message body and do
what ever you need to do.
Best,
Christian
Sent from a mobile device
Am 27.09.2012 07:38 schrieb "German O" <ge...@gmail.com>:
> Hi, Is there a way to do this without passing throw a model?... just read
> the
> csv, and put in the that format?..
>
> My case is that the csv can change the columns, and then I have to output
> another xml, so I use a xsl to translate to the final XML.
>
> The idea is to put the csv into a simple XML like the one described here,
> and with that simple format, I can easy do the xsl to create the final
> xmls.
>
> thanks.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Converting-CSV-to-XML-tp5711086p5720047.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>