|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
xml :name/value pairs |
« View previous topic :: View next topic » |
Author |
Message
|
Lillian |
Posted: Thu Oct 06, 2005 1:24 am Post subject: xml :name/value pairs |
|
|
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 |
|
 |
RichA |
Posted: Thu Oct 06, 2005 2:34 am Post subject: |
|
|
 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 |
|
 |
elvis_gn |
Posted: Thu Oct 06, 2005 3:21 am Post subject: |
|
|
 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 |
|
 |
javaforvivek |
Posted: Fri Oct 07, 2005 4:15 am Post subject: |
|
|
 Master
Joined: 14 Jun 2002 Posts: 282 Location: Pune,India
|
|
Back to top |
|
 |
Lillian |
Posted: Sun Oct 09, 2005 11:53 pm Post subject: |
|
|
Centurion
Joined: 15 Apr 2002 Posts: 102
|
Thanks, the code as per your reference worked beautifully!! |
|
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
|
|
|
|