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 refer child element with different parents

Post new topic  Reply to topic
 How to refer child element with different parents « View previous topic :: View next topic » 
Author Message
Yanghui
PostPosted: Wed Sep 04, 2002 8:45 am    Post subject: How to refer child element with different parents Reply with quote

Disciple

Joined: 08 May 2002
Posts: 151
Location: Dublin, Ireland

I remember seeing relevant posts before but just couldn't find it.

The scenario is like this: some different type XML messages are in same layout but one layer name is different from each other. For example,

Message type one:
<msgtype1>
<countryCode>353</countryCode>
</msgtype1>

Message type two:
<msgtype2>
<countryCode>44</countryCode>
</msgtype2>

The two parent elements are different but no matter what type message I get, my msgflow should be able to to pick the value of <countryCode> and insert another element in same layer accordingly. The output should look like:

For Message tyep one:
<msgtype1>
<countryCode>353</countryCode>
<country>Ireland</country>
</msgtype1>

For Message type two:
<msgtype2>
<countryCode>44</countryCode>
<country>Britian</country>
</msgtype2>

Can I use something like
DECLARE str_countryCode CHAR;
SET str_countryCode = "InputRoot"."XML".*."countryCode";

Any idea of how to refer the child element and ignore what parent is? Many thanks in advance.

Regards
-Yanghui
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Wed Sep 04, 2002 8:51 am    Post subject: Reply with quote

Jedi Knight

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

Yanghui,

Try this:

Code:

SET str_countryCode = InputRoot.XML.*[FIRST].countryCode;

_________________
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
Yanghui
PostPosted: Wed Sep 04, 2002 9:27 am    Post subject: Reply with quote

Disciple

Joined: 08 May 2002
Posts: 151
Location: Dublin, Ireland

Kirani,

Thank you very much for your help.

It works by using *[1].

Best regards
-Yanghui
Back to top
View user's profile Send private message Send e-mail
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 refer child element with different parents
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.