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 » Handle variable repeating elements in an xml

Post new topic  Reply to topic
 Handle variable repeating elements in an xml « View previous topic :: View next topic » 
Author Message
Anurag
PostPosted: Sun Sep 16, 2001 5:23 am    Post subject: Reply with quote

Newbie

Joined: 15 Sep 2001
Posts: 7

Hi,
I am setting the OutPutRoot in the compute node as :

SET OutputRoot.XML.cashbal.acountNumber=1111;
SET OutputRoot.XML.cashbal.currency='USD';
SET OutputRoot.XML.cashbal.dated=12122001;

SET OutputRoot.XML.cashbal.acountNumber=2222;
SET OutputRoot.XML.cashbal.currency='USD';
SET OutputRoot.XML.cashbal.dated=12122001;

but in the output, i am only getting the output as :
<cashbal>
<accountNumber>2222</accountNumber>
<currency>USD</currency>
<dated>12122001</dated>
</cashbal>

but i need the output to be :
<cashbal>
<accountNumber>1111</accountNumber>
<currency>USD</currency>
<dated>12122001</dated>

<accountNumber>2222</accountNumber>
<currency>USD</currency>
<dated>12122001</dated>
</cashbal>

Please do help me out to get the output in this form.

thanks
anurag

[ This Message was edited by: Anurag on 2001-09-16 06:25 ]
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
EddieA
PostPosted: Sun Sep 16, 2001 5:33 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Sorry about changing my reply (if anyone saw my original one).

I can't see how you can do this with fixed SET statements, like your example. Using [] indexes produce the wrong output.

But I'm going to guess that the final code will be building the ouptput based on something coming in, not fixed values.

So what's the format of the input, because it 'might' be possible using the SELECT and ITEM keywords. No promises.

Cheers.
_________________
Eddie Atherton
IBM Certified Specialist - MQSeries
IBM Certified Specialist - MQSeries Integrator

[ This Message was edited by: EddieA on 2001-09-16 19:07 ]

[ This Message was edited by: EddieA on 2001-09-16 19:51 ]
Back to top
View user's profile Send private message
hegdevinu
PostPosted: Sun Sep 16, 2001 9:18 pm    Post subject: Reply with quote

Newbie

Joined: 09 Aug 2001
Posts: 9
Location: Bangalore, India

Hi Anurag,
I feel you can use arrays . In that case, output will get look like

<cashbal>
<acountNumber>1111</acountNumber>
<acountNumber>2222</acountNumber>
<currency>USD</currency>
<currency>USD</currency>
<dated>12122001</dated>
<dated>12122001</dated>
</cashbal>

It's good to wrap each 3 of them in one unit like

<cashbal>
<unit>
<acountNumber>1111</acountNumber>
<currency>USD</currency>
<dated>12122001</dated>
</unit>
<unit>
<acountNumber>2222</acountNumber>
<currency>USD</currency>
<dated>12122001</dated>
</unit>
</cashbal>

and then use arrays to access those units.

Check - Using Control center (257)

I don't have access to MQSI right now to check this. Hope this helps.

Cheers,
Vinayak

_________________
Vinayak M Hegde
Torry Harris Business Solutions


[ This Message was edited by: hegdevinu on 2001-09-16 22:44 ]
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Anurag
PostPosted: Sun Sep 16, 2001 10:08 pm    Post subject: Reply with quote

Newbie

Joined: 15 Sep 2001
Posts: 7

On 2001-09-16 22:18, hegdevinu wrote:
Hi Anurag,
I feel you can use arrays . In that case, output will get look like


1111
2222
USD
USD
12122001
12122001


It's good to wrap each 3 of them in one unit like



1111
USD
12122001


2222
USD
12122001



and then use arrays to access those units.

Check - Using Control center (257)

I don't have access to MQSI right now to check this. Hope this helps.

Cheers,
Vinayak

_________________
Vinayak M Hegde
Torry Harris Business Solutions


[ This Message was edited by: hegdevinu on 2001-09-16 22:44 ]
[/quote]



[ This Message was edited by: Anurag on 2001-09-16 23:09 ]
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Anurag
PostPosted: Sun Sep 16, 2001 10:10 pm    Post subject: Reply with quote

Newbie

Joined: 15 Sep 2001
Posts: 7

Hi Eddie Atherton,
You are right that i will be connecting to the database, but the results will come out from the database which will be more than one records and i will be again in the same problem that only the last record will be shown of that select statement.
My input is <fundid>1234</fundid>
and the output results will be around 50 with same tags of parent child relation.

Can You or any one help me out for this problem.

regds
anurag.


Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Anurag
PostPosted: Sun Sep 16, 2001 10:13 pm    Post subject: Reply with quote

Newbie

Joined: 15 Sep 2001
Posts: 7

Hi vinayak,
The way suggested by you changes the output format of my XML.Is there any other way out to sort out the problem so that my output format is not changed.ACtually my input is
<fundid>1234</fundid> and i am firing a database select query and i get n number of records and i want to put them in the same format of xml.Can you or any one help me out for this.

with best regds
anurag
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
EddieA
PostPosted: Mon Sep 17, 2001 12:41 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Anurag,

You're reply doesn't go into enough detail.

Does your input message consist of a single <fundid>, or multiple ones.

What's the layout of the database table, including the exact column names.

What's the SQL that will retreive the data from the database given the fundid.

Cheers,

_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
EddieA
PostPosted: Mon Sep 17, 2001 1:02 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Anurag,

Try this:

SET OutputRoot.XML.cashbal = ROW(1111 as acountNumber,
'USD' as currency,
12122001 as dated,
2222 as acountNumber,
'USD' as currency,
12122001 as dated);


Cheers,

_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
Anurag
PostPosted: Wed Sep 19, 2001 8:51 pm    Post subject: Reply with quote

Newbie

Joined: 15 Sep 2001
Posts: 7

Hi,
I found out a solution for this.
We can write the EQSL as follow :
It is more or less similar to the suggestion given by EDDIE.
We can write it in this way :

WHILE K <=3 DO
SET
OutputRoot.XML.parentTag.record[K].childtag1
=123;
SET
OutputRoot.XML.parentTag.record[K].childtag2
=2134;
SET K=K+1;
END WHILE;
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Anurag
PostPosted: Wed Sep 19, 2001 8:51 pm    Post subject: Reply with quote

Newbie

Joined: 15 Sep 2001
Posts: 7

Hi,
I found out a solution for this.
We can write the EQSL as follow :
It is more or less similar to the suggestion given by EDDIE.
We can write it in this way :

WHILE K <=3 DO
SET
OutputRoot.XML.parentTag.record[K].childtag1
=123;
SET
OutputRoot.XML.parentTag.record[K].childtag2
=2134;
SET K=K+1;
END WHILE;

regds
Anurag
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Handle variable repeating elements in an 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.