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 » xml :name/value pairs

Post new topic  Reply to topic
 xml :name/value pairs « View previous topic :: View next topic » 
Author Message
Lillian
PostPosted: Thu Oct 06, 2005 1:24 am    Post subject: xml :name/value pairs Reply with quote

Centurion

Joined: 15 Apr 2002
Posts: 102

Hi

I am trying to generate xml with name: value pairs. the code below for some reason first populates the Name and then the values. The output is as below
<Name>Old_status</Name>
<Name>New_status</Name>
<Name>Setup_id</Name>
<Name>Authorise_id</Name>
<Value>222222222222222</Value>
<Value>33</Value>
<Value>cccccccccccc</Value>
<Value>5555555555</Value>

What I need is
<Name>Old_status</Name>
<Value>5555555555</Value>
<Name>New_status</Name>
<Value>33</Value>

Please advise.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX

DECLARE b INTEGER;
SET b = CARDINALITY(InputBody.*[]);
DECLARE x INTEGER;
SET x = 1;
WHILE x < b DO

SET OutputRoot.XML.WfMessage.WfMessageBody."ProcessInstanceStateChanged.Request".ResultData.Name[x] = FIELDNAME("InputBody".*[x];
SET OutputRoot.XML.WfMessage.WfMessageBody."ProcessInstanceStateChanged.Request".ResultData.Value[x] = ("InputBody".*[x];

SET x=x+1;
END WHILE;
Back to top
View user's profile Send private message
RichA
PostPosted: Thu Oct 06, 2005 2:34 am    Post subject: Reply with quote

Centurion

Joined: 14 Mar 2002
Posts: 102

I'm sure people can probably come up with better ways to do this, but I would suggest looking at the CREATE LASTCHILD command
Back to top
View user's profile Send private message MSN Messenger
elvis_gn
PostPosted: Thu Oct 06, 2005 3:21 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi Lillian,
As RichA stated use the LASTCHILD....

You could use a CREATE FIELD and NEXTSIBLING too.....

Go through the ESQL reference for WHILE LASTMOVE(Reference) DO..... MOVE Reference NEXTSIBLING

This is avoid the use of your counter and CARDINALITY etc.....

In general, have a look at the pdf......
Back to top
View user's profile Send private message Send e-mail
javaforvivek
PostPosted: Fri Oct 07, 2005 4:15 am    Post subject: Reply with quote

Master

Joined: 14 Jun 2002
Posts: 282
Location: Pune,India

See this code:
http://www.mqseries.net/phpBB2/viewtopic.php?t=24433
_________________
Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Lillian
PostPosted: Sun Oct 09, 2005 11:53 pm    Post subject: Reply with quote

Centurion

Joined: 15 Apr 2002
Posts: 102

Thanks, the code as per your reference worked beautifully!!
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 » xml :name/value pairs
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.