Re: Converting CSV to XML

2012-09-26 Thread Claus Ibsen
On Wed, Sep 26, 2012 at 8:33 PM, German O 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 fina

Re: Converting CSV to XML

2012-09-26 Thread Christian Müller
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" : > Hi, Is there a way to do this without passing throw a model?... just read > the > csv, and put in the that for

Re: Converting CSV to XML

2012-09-26 Thread German O
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 t

Re: Converting CSV to XML

2012-07-20 Thread ambarish.d
Hello Claus, Thanks for the help. Bindy was really helpful. I am still using xstream though, its lot more easier (I feel). Giving the working solution of this problem if anybody needs one. /DataFormat bindy = new BindyCsvDataFormat("com.your.package.dto"); from("file:/

Re: Converting CSV to XML

2012-05-19 Thread Claus Ibsen
Hi See Bindy, and then you can annotate the bindy model class with JAXB annotations, and then convert to XML. http://camel.apache.org/bindy Jonathan's article has an example showing this. http://java.dzone.com/articles/open-source-integration-apache On Wed, May 16, 2012 at 9:55 PM, ambarish.d w

Re: Converting CSV to XML

2012-05-19 Thread ambarish.d
Yogesh, Actually, I am looking for more generic solution which will take any CSV as input and convert it into required XML format. So is the reason I cant use XSLT in this case. Its my bad that I didnt specified this in original problem description. Please let me know if I am wrong in understandi

Re: Converting CSV to XML

2012-05-17 Thread Christian Müller
My recommendations: 1) I prefer using JAXB instead of XStream. 2) Modify your route so they looks like: JaxbDataFormat jaxb = new JaxbDataFormat("com.mycompany..."); from("") .unmarshall().csv() .convertBodyTo(List.class) // see [1] .marshal(jaxb) .to(""); [1] http://camel.apache.org/type

Re: Converting CSV to XML

2012-05-17 Thread ramesri
Yogesh, you can use camel flatpack component to parse the csv records. And then use a Velocity template to output it to desired xml. Thanks Ramesh On Thu, May 17, 2012 at 4:24 PM, Christian Mueller [via Camel] < ml-node+s465427n5711606...@n5.nabble.com> wrote: > You cannot use XSLT to transform

Re: Converting CSV to XML

2012-05-17 Thread ychawla
Hi Christian, You are correct that you can use XSLT on CSV, but he can get the data into this format: Name Age Sex Zip Edward 22 M 33639 .. He can use an XSLT to go from that to this: Edward 22 M 33639 Th

Re: Converting CSV to XML

2012-05-17 Thread Christian Müller
You cannot use XSLT to transform a CSV file into XML... On Thu, May 17, 2012 at 10:19 PM, ychawla wrote: > Hi Amby, > What about using a simple XSLT to go from the outputted format to your > desired format? It should be a pretty straight forward transformation. > > Thanks, > Yogesh > > -- > Vie

Re: Converting CSV to XML

2012-05-17 Thread ychawla
Hi Amby, What about using a simple XSLT to go from the outputted format to your desired format? It should be a pretty straight forward transformation. Thanks, Yogesh -- View this message in context: http://camel.465427.n5.nabble.com/Converting-CSV-to-XML-tp5711086p5711598.html Sent from the Cam

Re: Converting CSV to XML

2012-05-17 Thread sekaijin
Hi. Sorry, but if you understand french you can see http://www.developpez.net/forums/d1216465/java/serveurs-conteneurs-java-ee/autres/camel-convertir-csv-xml-bindy-jaxb/ I use the target xsd schema to generate annotated classes. I add the annotation Bindy and voila A + JYT -- View this messa