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 » Referencing to next element under same parent (XML)

Post new topic  Reply to topic
 Referencing to next element under same parent (XML) « View previous topic :: View next topic » 
Author Message
lung
PostPosted: Wed Dec 11, 2002 2:02 am    Post subject: Referencing to next element under same parent (XML) Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

Hi all,

Assuming I have the following XML message...

<Msg>
<A>1</A>
<B>2</B>
<C>3</C>
</Msg>

Now assuming I do not know the field names for B and C, and only know A, is there anyway in which I can reference to B and C in ESQL?

Say, like... SET abc = InputBody.<<NextElementAfter>>A; ??
_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
kirani
PostPosted: Wed Dec 11, 2002 8:29 am    Post subject: Reply with quote

Jedi Knight

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

Hi Lung,

First define a reference to <A> tag and then use MOVE ... NEXTSIBLING command to move your reference pointer to point to the next sibling, in this case <B> tag.

For example,

Code:

DECLARE ref REFERENCE to InputRoot.XML.Msg.A;
move ref NEXTSIBLING;
-- now ref is pointing to <B> tag
--SET abc = ref;
move ref NEXTSIBLING;
-- now ref is pointing to <C> tag.
--SET def = ref;


Pls refer to ESQL reference manual for more details.
_________________
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
lillo
PostPosted: Thu Dec 12, 2002 12:01 am    Post subject: Reply with quote

Master

Joined: 11 Sep 2001
Posts: 224

Hi,

use MOVE ... NEXTSIBLING as kirani said with a extra parameter.
Code:

DECLARE ref REFERENCE to InputRoot.XML.Msg.A;
move ref NEXTSIBLING TYPE 0x01000000;
-- now ref is pointing to <B> tag
--SET abc = ref;
move ref NEXTSIBLING TYPE 0x01000000;
-- now ref is pointing to <C> tag.
--SET def = ref;

With this parameter you move to the next element. I had a situation where the "move nextsibling" statement moved to a CDATA, I though this could be the linefeed caracter.

Cheers,
_________________
Lillo
IBM Certified Specialist - WebSphere MQ
Back to top
View user's profile Send private message
lung
PostPosted: Thu Dec 12, 2002 4:46 pm    Post subject: Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

Thanks all. I'll try out those methods
_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Referencing to next element under same parent (XML)
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.