|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to refer child element with different parents |
« View previous topic :: View next topic » |
Author |
Message
|
Yanghui |
Posted: Wed Sep 04, 2002 8:45 am Post subject: How to refer child element with different parents |
|
|
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 |
|
 |
kirani |
Posted: Wed Sep 04, 2002 8:51 am Post subject: |
|
|
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 |
|
 |
Yanghui |
Posted: Wed Sep 04, 2002 9:27 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|