You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by deepaktaker <de...@gmail.com> on 2016/02/23 10:41:09 UTC
Issue in xml to csv conversion
Hi All,
I use camel for converting my xml file to csv. I was using camel
version 2.14.2, and i updated it to 2.16.2. now my conversion is not working
as expected.
In camel version 2.14.2 here's what my input and output looked like
Input:
<?xml version="1.0" encoding="UTF-8"?>
<EmployeeList>
<Employee>
<id>id1</id>
<name>name1</name>
<age>age1</age>
<city>city1</city>
test@mail.com
</Employee>
<Employee>
<id>id2</id>
<name>name2</name>
<age>age2</age>
<city>city2</city>
<Phone>9086798</Phone>
</Employee>
</EmployeeList>
Ouput:
id1|name1|age1|city1|test@mail.com
id2|name2|age2|city2||9086798
if you notice in the second line of output email address field is missing
since it is not available in the second
record of xml, so in the output you get no values but it is empty.
After upgrading to camel 2.16.2 my output looks like this
Ouput:
id1|name1|age1|city1|test@mail.com
id2|name2|age2|city2|9086798
Now if the filed is missing it is simply ignored.
could any one of you help me to get the output that is used to get earlier
with camel 2.14 version
--
View this message in context: http://camel.465427.n5.nabble.com/Issue-in-xml-to-csv-conversion-tp5778103.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Issue in xml to csv conversion
Posted by deepaktaker <de...@gmail.com>.
Thanks for your reply yogesh, I tried it but doesn't work.
On 23 Feb 2016 5:58 p.m., "yogu13 [via Camel]" <
ml-node+s465427n5778125h93@n5.nabble.com> wrote:
> Hello,
>
> Try setting the allowMissingColumnNames=true
>
> Regards,
> -Yogesh
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Issue-in-xml-to-csv-conversion-tp5778103p5778125.html
> To unsubscribe from Issue in xml to csv conversion, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5778103&code=ZGVlcGFrdGFrZXJAZ21haWwuY29tfDU3NzgxMDN8LTEwNDQ3OTU5NDY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://camel.465427.n5.nabble.com/Issue-in-xml-to-csv-conversion-tp5778103p5778137.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Issue in xml to csv conversion
Posted by yogu13 <yo...@gmail.com>.
Hello,
Try setting the allowMissingColumnNames=true
Regards,
-Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/Issue-in-xml-to-csv-conversion-tp5778103p5778125.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Issue in xml to csv conversion
Posted by deepaktaker <de...@gmail.com>.
Hi Yogesh,
I use CsvDataFormat class which has this method named
marshal which does the conversion for me.
Regards,
Deepak
On Tue, Feb 23, 2016 at 3:43 PM, yogu13 [via Camel] <
ml-node+s465427n5778106h4@n5.nabble.com> wrote:
> Hi,
>
> Are you using any camel component for converstion or is it a custom code ?
>
> Regards,
> -Yogesh
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Issue-in-xml-to-csv-conversion-tp5778103p5778106.html
> To unsubscribe from Issue in xml to csv conversion, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5778103&code=ZGVlcGFrdGFrZXJAZ21haWwuY29tfDU3NzgxMDN8LTEwNDQ3OTU5NDY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://camel.465427.n5.nabble.com/Issue-in-xml-to-csv-conversion-tp5778103p5778108.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Issue in xml to csv conversion
Posted by yogu13 <yo...@gmail.com>.
Hi,
Are you using any camel component for converstion or is it a custom code ?
Regards,
-Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/Issue-in-xml-to-csv-conversion-tp5778103p5778106.html
Sent from the Camel - Users mailing list archive at Nabble.com.