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 » accessing multiple root elements

Post new topic  Reply to topic
 accessing multiple root elements « View previous topic :: View next topic » 
Author Message
coolguynit
PostPosted: Tue Jul 12, 2011 3:56 am    Post subject: accessing multiple root elements Reply with quote

Newbie

Joined: 12 Jul 2011
Posts: 3

how to traverse A xml message with multiple root elements using for loop in EQL
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Jul 12, 2011 4:06 am    Post subject: Reply with quote

Jedi Council

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

A valid XML document can only have one root element.

Can you give us and example of the type of data you are looking at?
_________________
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
coolguynit
PostPosted: Tue Jul 12, 2011 4:30 am    Post subject: in this XML rec is occuring twice soi have traverse this rec Reply with quote

Newbie

Joined: 12 Jul 2011
Posts: 3

<Detail>
<rec>
<Name>nitin</Name>
<Empid>636</Empid>
<Profile>ASE</Profile>
</rec>
<rec>
<Name>amit</Name>
<Empid>637</Empid>
<Profile>ASE</Profile>
</rec>
</Detail>
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jul 12, 2011 4:47 am    Post subject: Reply with quote

Grand High Poobah

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

That's not a document with multiple root elements. In the quoted example Detail is the root element.

And you'd traverse the child rec elements with a WHILE or a FOR loop.

This is ESQL 101 and I won't steal the thunder of others about training except to say that if you need to ask a question this basic you either need training or you need the money you paid for training refunded.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
coolguynit
PostPosted: Tue Jul 12, 2011 5:00 am    Post subject: hw we can traverse?? Reply with quote

Newbie

Joined: 12 Jul 2011
Posts: 3

Thanks for the reply .......Can you please help me I am nt getting hw to traverse this using for or while loop??
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jul 12, 2011 5:15 am    Post subject: Re: hw we can traverse?? Reply with quote

Grand High Poobah

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

coolguynit wrote:
Can you please help me I am nt getting hw to traverse this using for or while loop??


I repeat my comments about training.

This forum is not a training resource.

Having reviewed the documentation for these 2 constructs what don't you "get"? What happens when you try it?

Have you considered using a Mapping node's drag-and-drop functionality? If the XML is as simple as your example (and yes, I'm being deliberately evasive because XML that simple occurs in certification questions) that could be an answer until you've increased ESQL skills.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
rglack10
PostPosted: Tue Jul 12, 2011 8:04 am    Post subject: Re: hw we can traverse?? Reply with quote

Apprentice

Joined: 06 Jul 2011
Posts: 34

coolguynit wrote:
Thanks for the reply .......Can you please help me I am nt getting hw to traverse this using for or while loop??


If you're really at this level that you're asking this type of stuff then giving you the answer will only lead to more questions until someone is as well doing the solution for you and that's the wrong way to go about it.

Have you thought about using the help menu to search for WHILE.. FOR etc and see what comes up? Are you familiar with the info centre?

Also try importing some of the samples and viewing the ESQL etc.
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 » accessing multiple root elements
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.