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 » navigating throug nested structures

Post new topic  Reply to topic
 navigating throug nested structures « View previous topic :: View next topic » 
Author Message
m.schneider
PostPosted: Thu Sep 20, 2007 8:59 am    Post subject: navigating throug nested structures Reply with quote

Centurion

Joined: 10 Apr 2007
Posts: 132
Location: Germany

Hi,

I have the following structure of a message.

<Msg>
<Party>
<SW95P>
<Qualifier> X </Qualifier>
<BIC> 123 <BIC>
</SW95P>
</Party>
<Party>
<SW95P>
<Qualifier> Y </Qualifier>
<BIC> 456 <BIC>
</SW95P>
</Party>
<Party>
<SW95P>
<Qualifier> Z </Qualifier>
<BIC> 789 <BIC>
</SW95P>
</Party>
</Msg>

There can be infinite occurences of party and I need to extract all
with the Qualifier = Z. How can I achieve this?
I have a working solution with a WHILE loop, but I'm curios if there is a smarter solution. I thougt perhaps with a SELECT or an FOR ALL loop, but I didn't find a good example, ...
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Sep 20, 2007 12:25 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/ak05620_.htm

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/ac17270_.htm
Back to top
View user's profile Send private message
m.schneider
PostPosted: Thu Sep 20, 2007 11:50 pm    Post subject: Reply with quote

Centurion

Joined: 10 Apr 2007
Posts: 132
Location: Germany

Thanks for the reply, ... I do know the select statement, ... problem here ist that there is a multiple occurence of party and in each party is a field SW95P.
So if a select like this:

SELECT A.Qualifier
FROM InputRoot.XMLNSC.Msg.Party.SW95P[] AS A
WHERE A.QUALIFIER = 'Z'

The select only searches in the first occurence of party.


I need something like this:

SELECT A.SW95P.Qualifier
FROM InputRoot.XMLNSC.Msg.Party[] AS A
WHERE A.SW95P.QUALIFIER = 'Z'

But this isn't valid syntax, ... Is there any other chance?
Back to top
View user's profile Send private message
mgk
PostPosted: Fri Sep 21, 2007 1:38 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Actually your second SELECT is (almost) valid syntax. Certainly the idea here is correct. The only problem is that the case of the word qualifier is wrong, and you do not take the spaces into account around the value of the qualifier. A corrected version of you code that works with your input message (when the BIC tag is closed properly) is:


Code:
SET OutputRoot.XMLNSC.Top.Answer[] =
    SELECT A.SW95P.Qualifier
    FROM InputRoot.XMLNSC.Msg.Party[] AS A
    WHERE A.SW95P.Qualifier = ' Z ' ;


The output of this is:
Code:
<Top><Answer><Qualifier> Z </Qualifier></Answer></Top>

_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
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 » navigating throug nested structures
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.