ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML to CSV without a CSV message set?

Post new topic  Reply to topic
 XML to CSV without a CSV message set? « View previous topic :: View next topic » 
Author Message
bdaoust
PostPosted: Thu Oct 15, 2015 10:21 am    Post subject: XML to CSV without a CSV message set? Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

Can you convert XML to CSV without creating a message definition for the CSV file?

I have a large XML with over 600 elements and was hoping I don't have to create a message definition for the CSV.

For instance, one thought I had was in ESQL. Loop though all XML elements, extract the element name and then build a comma delimited string as I go.

Thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Oct 15, 2015 11:00 am    Post subject: Re: XML to CSV without a CSV message set? Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bdaoust wrote:
For instance, one thought I had was in ESQL. Loop though all XML elements, extract the element name and then build a comma delimited string as I go.


It'd certainly work. Almost certainly run like a dog with three legs and asthma, given the efficiency of ESQL's string handling.

Bad luck for you if there's 6,000 elements not 600.

Bad luck for whoever you're sending the file to if the elements don't turn up in the same order every time. Or you go through the child elements in a tree fashion and they expect level 1 / level 2 / level n.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bdaoust
PostPosted: Thu Oct 15, 2015 11:17 am    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

Ok - thanks for that info.

Sounds like I just need to do the CSV message model.

Appreciate the feedback.

-Brian
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Oct 15, 2015 11:42 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The other advantage of the DFDL model is that you can verify data types - make sure that you don't put strings in place of numbers, that kind of thing.

You should likely have some kind of existing model thing that you can import to create the DFDL model - a copybook or some such.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
timber
PostPosted: Thu Oct 15, 2015 2:38 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

Quote:
one thought I had was in ESQL. Loop though all XML elements, extract the element name and then build a comma delimited string as I go.
What will you do about element values that contain quote characters or newlines? This is something that's often forgotten when people 'just write a quick implementation'. But it matters, and DFDL will do it for you automatically and according to the accepted standard for CSV.
In fact, it's probably quicker to use the DFDL wizard to create the model than to code the ESQL.

btw, the term 'message set' does not apply to DFDL. It's a 'DFDL model'. Message sets cannot contain DFDL models.
Back to top
View user's profile Send private message
joebuckeye
PostPosted: Fri Oct 16, 2015 4:51 am    Post subject: Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 365
Location: Columbus, OH

timber wrote:
This is something that's often forgotten when people 'just write a quick implementation'.

I get this all the time from business folks, "just create a 'quick' name or address parser". They greatly underestimate the variability of the data being asked to work with.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML to CSV without a CSV message set?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.