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 converter

Post new topic  Reply to topic Goto page 1, 2  Next
 XML to CSV converter « View previous topic :: View next topic » 
Author Message
kr.danda
PostPosted: Tue Apr 08, 2014 9:46 pm    Post subject: XML to CSV converter Reply with quote

Novice

Joined: 08 Apr 2014
Posts: 15

Hi Every One,


Iam the new to Programing for ESQL could please help ,
how convert XML to CSV.Please provide Logic Implementation in ESQL .


Thanking You Advance,

Regards,
D.Karuna
Back to top
View user's profile Send private message Send e-mail
kr.danda
PostPosted: Tue Apr 08, 2014 9:47 pm    Post subject: Re: XML to CSV converter Reply with quote

Novice

Joined: 08 Apr 2014
Posts: 15

kr.danda wrote:
Hi Every One,


Iam the new to Programing for ESQL could please help ,
how convert XML to CSV.Please provide Logic Implementation in ESQL .


Thanking You Advance,

Regards,
D.Karuna


Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Tue Apr 08, 2014 10:45 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Welcome to this fourm. Sadly you have broken a golden rule already.

You waited just 1 minute before adding 'Help' to your post and at 05:49 in the morning.

Not many people who regularly post here would be online at that time so some degree of patience is required before prompting us for help again.

You don't tell us what you have done to investigate your problem yourself. This really helps us give to pointers/hints in areas that you have not tried yourself.

The answer to your problem is actually contained in at least one of the Sample Flows. Go on, take a look at them. They don't bite.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Apr 09, 2014 12:21 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Why do you need to know?
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Wed Apr 09, 2014 12:36 am    Post subject: Re: XML to CSV converter Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

kr.danda wrote:
convert XML to CSV


This is a conversion that you can just write down with some (java) code.

Flattening (tree2csv) and reversing a tree from that (csv2tree) is a no-brainer
_________________
Just use REFERENCEs


Last edited by mqsiuser on Wed Apr 09, 2014 12:42 am; edited 1 time in total
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Apr 09, 2014 12:42 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

@mqsiuser : Why are you advising kr.danda to use Java to parse the XML?
When talking to a new user it would make a lot more sense to recommend using the product's built-in parsers to perform this conversion.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Wed Apr 09, 2014 12:44 am    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

There is no build in support for that

except creating msg sets

which is more reliable, btw.

But I am not aware of a node (or) nodes which do tree2csv or csv2tree

Which is doable (from a theoretical standpoint)

RFE ?
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
zpat
PostPosted: Wed Apr 09, 2014 1:19 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
Location: UK

Internally all data is represented as a tree.

Surely you just use the XML parser on the input node and a message set for the output? Possibly using mapping nodes in-between.

ESQL is not necessarily required. Let alone Java.

WMB is a product designed to reduce or eliminate programming as such, if you don't use WMB features - don't use WMB.

Don't use Java other than as a last resort.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Wed Apr 09, 2014 2:40 am    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

zpat wrote:
Internally all data is represented as a tree.

And not CSV

zpat wrote:
Surely you just use the XML parser on the input node and a message set for the output?

@OP: That is what you have to do: use/create a msg set
And use XMLNSC (for XML) or MRM (for flat files) or DFDL

On the rest (that zpat writes):

You require proper support, like ESQL gives you.

Broker's Java also gives you that (like any of the languages) within Broker.

It is "Broker's Java": A special Java API !

IBM would say "you may use Java if you are a Java programmer or if you like it."

I say Java is ~20% slower than ESQL (which is not really worth mentioning, it is not really bad: It is okay).

Message Broker Developers love ESQL because it seems to be most targeted/focused on the problem domain.

And sorry, IBM wouldn't approve on that "Broker is a tool to relieve you from programming"
_________________
Just use REFERENCEs


Last edited by mqsiuser on Wed Apr 09, 2014 2:56 am; edited 1 time in total
Back to top
View user's profile Send private message
zpat
PostPosted: Wed Apr 09, 2014 2:55 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
Location: UK

Why do you need to code anything if you have a mapping node?

As mentioned many, many times on here, once you encourage Java - developers start using it inappropriately.

I would tell them not to code any lines of code at all.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Wed Apr 09, 2014 3:02 am    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

The mapping node seems to work for you and your project

I (and others) think that it has limitations, and sorry if you don't understand them ("structural transformations"... which require the use of a hash map or "{...}" in ESQL).

mqjeff will approve on that ( or he say "oh I just use ESQL and not the mapping node and I am fine"... he just (always) does the right thing )

@zpat: And he uses "{...}" WHAT is the equivalent within the mapping node ?
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Apr 09, 2014 3:15 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

kr.danda must be somewhat confused by all of that.

The recommended way to do this is:
a) Use the CSV wizard in the toolkit to create a DFDL schema for your CSV format.
b) Parse the input document using XMLNSC
c) In a Compute node ( or a Mapping node, if you prefer ) copy InputRoot.XMLNSC to Output.DFDL

If using v7, then a) will need to change to:
a) Create a message set for the CSV format, using the CSV sample as a guide.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 09, 2014 5:23 am    Post subject: Reply with quote

Grand High Poobah

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

mqsiuser wrote:
I (and others) think that it has limitations


Of course it does (though the v9 one has far fewer). That's why IBM provided other transformation tools.

The point here is the the OP's question doesn't require any transformation in any language, and certainly not the examples you posted to github (nice page format by the way). The product does this out of the box, and new users especially should be encouraged to use the product, not pretend it's WAS & code Java for every problem.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Wed Apr 09, 2014 9:14 am    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

Vitor wrote:
mqsiuser wrote:
I (and others) think that it has limitations


Of course it does (though the v9 one has far fewer). That's why IBM provided other transformation tools.

zpat does not see (any) limitation (of the mapping node) on his project(s)
Which I agree is possible

Vitor wrote:
The point here is the the OP's question doesn't require any transformation in any language, and certainly not the examples you posted to github.

It's exactly what he wants

It's something I have been missing in Broker again and again

Something where I can just say "tick check box" and Broker converts a tree into CSV and thats it (no msg set)

So I am providing it now. Sorry that it is in Java.

Port it to c or to ESQL - and ofc I understand that this is not trivial (not a no-brainer)

Vitor wrote:
nice page format by the way

You are Vitor, you have an incredible magnitude of more posts (than me) and a far bigger reach on mqseries.net
And you are very good with Tim Kimber ... with which my suggestions and ideas sometimes collide (just seem to... actually)
Sorry, it's all about the subject matter, never something personal, but I can see there is also personal interaction
Is my style-sheet (my 3 lines of CSS ) wrong? The layout on www.use-the-tree.com is intended to be simple and functional (but not kind of wrong or so). And I have no control of the layout on github!

Vitor wrote:
The product does this out of the box, and new users especially should be encouraged to use the product, not pretend it's WAS & code Java for every problem.

What Vitor means is: Do like kimbert says (use a msg set ... wow there is a wizard, this is a breeze!)

@IBM: You can walk a tree and flatten it without a message set (reliably). Internally all data is represented as a tree.... almost... there are also BLOBs.
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 09, 2014 9:46 am    Post subject: Reply with quote

Grand High Poobah

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

mqsiuser wrote:
Vitor wrote:
mqsiuser wrote:
I (and others) think that it has limitations


Of course it does (though the v9 one has far fewer). That's why IBM provided other transformation tools.

zpat does not see (any) limitation (of the mapping node) on his project(s)
Which I agree is possible


It's his view and if it works for him then all is good. I personally don't see the mapping node as the only transformation you'll ever need, personally prefer to write ESQL, but that doesn't stop me using the mapping node for simple stuff nor pointing less experienced developers at it.

The right tool for the right use case.

mqsiuser wrote:
Vitor wrote:
The point here is the the OP's question doesn't require any transformation in any language, and certainly not the examples you posted to github.

It's exactly what he wants


It's exactly what he asked for but it's not what he wants. Inexperienced people cannot be expected to know all the options & look to us for advice.

And the 1 line of ESQL offered by my most worthy associate exactly fits the OP's request for "Implementation in ESQL"

mqsiuser wrote:
It's something I have been missing in Broker again and again

Something where I can just say "tick check box" and Broker converts a tree into CSV and thats it (no msg set)


Really? Given how easy it is to do involving a generated message set (i.e. from the wizard)? Can't say it's something I've seen missing.

mqsiuser wrote:
So I am providing it now. Sorry that it is in Java.


Lots of people tell me it's a nice language, and it's great to code in. I give them design documents & go back to my ESQL.

mqsiuser wrote:
Vitor wrote:
nice page format by the way

You are Vitor, you have an incredible magnitude of more posts (than me) and a far bigger reach on mqseries.net
And you are very good with Tim Kimber ... with which my suggestions and ideas sometimes collide (just seem to... actually)
Sorry, it's all about the subject matter, never something personal, but I can see there is also personal interaction
Is my style-sheet (my 3 lines of CSS ) wrong? The layout on www.use-the-tree.com is intended to be simple and functional (but not kind of wrong or so). And I have no control of the layout on github!


Defensive much?

mqsiuser wrote:
What Vitor means is: Do like kimbert says (use a msg set ... wow there is a wizard, this is a breeze!)


Yes. It is.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML to CSV converter
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.