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 » How to find the XML tag

Post new topic  Reply to topic
 How to find the XML tag « View previous topic :: View next topic » 
Author Message
dsmq
PostPosted: Thu Jul 17, 2003 10:40 am    Post subject: How to find the XML tag Reply with quote

Acolyte

Joined: 20 Jun 2002
Posts: 59

Hi all

How do i find the specific XML tag exists in my incoming XML or not

Here is my Sample xml Msg

<SampleMsg>
<Sample>
<name>hello</name>
<rno>1</rno>
</Sample>
</SampleMsg>

i want to find the <name> tag exits or not . Can body can give me the code to loop through the all xml tags and look for <name> tag

Thanks in advance
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Jul 17, 2003 10:43 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Try this ..
Code:

IF ( InputRoot.XML.SampleMsg.Sample IS NOT NULL) THEN
-- the Tag exist
ELSE
-- The TAG doesn't exist or contains NULL Value
END IF;

_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
dsmq
PostPosted: Thu Jul 17, 2003 11:10 am    Post subject: How to find the XML tag Reply with quote

Acolyte

Joined: 20 Jun 2002
Posts: 59

Hi Kiran

Thanks for u r reply

if i don't know the position of XML tag, then how do we check.


<SampleMsg>
<Sample>
<name>hello</name>
<rno>1</rno>
</Sample>
</SampleParser>


in this XML i may get <name> tag as child of <Sample> or sometimes i will get as child of <SampleMsg>
like

<SampleMsg>
<name>hello</name>
<Sample>
<rno>1</rno>
</Sample>
</SampleParser>

How do i write a generic code to see the FIELD NAME of particular tag is <name>

Thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Jul 17, 2003 11:34 am    Post subject: Re: How to find the XML tag Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

dsmq wrote:

if i don't know the position of XML tag, then how do we check.


You should be able to use a Select statement against the message tree to find this tag. Read the latest version of the ESQL manual for more information.
Back to top
View user's profile Send private message
titus
PostPosted: Fri Jul 18, 2003 6:01 am    Post subject: Reply with quote

Novice

Joined: 14 Oct 2002
Posts: 23

Another solution is read message as blob and cast into char . Then find the position of tag in the message using POSITION function.
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 » How to find the XML tag
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.