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 » Adding more data of the same name to a message

Post new topic  Reply to topic
 Adding more data of the same name to a message « View previous topic :: View next topic » 
Author Message
smdavies99
PostPosted: Thu Feb 09, 2006 11:58 am    Post subject: Adding more data of the same name to a message Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

This is probably a simple problem but I am not clear as to the best way to do it.
If I have an incoming message with the following structure

<Dealer_Stock>
<Dealer_Stock_List>
<Stock_Item>
<Veh_reg>SSS111G</Veh_reg>
<Veh_Type>Cortina</Veh_Type>
<Veh_Price>1195.00</Veh_Price>
</Stock_Item>
.... Repeating a variable number of times
</Dealer_Stock_List>
</Dealer_Stock>

The flow gets the message and wants to add more items of the type <Stock_Item> to the list.
I'm sure there is a simple way to do this but at the moment it seems that I may have to decostruct the emssage first

/S
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Feb 09, 2006 12:02 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You just use something like
Code:
set OutputRoot.XML.Dealer_Stock.Dealer_Stock_List.Stock_Item[2].Veh_reg="abcdefg";

Where you increment the [2] for every new stock item.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Feb 09, 2006 1:00 pm    Post subject: A bit more info Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Thanks for the hint. However I inadvertantly missed out a possible essential bit if info in my original post.
The Message Structue should actually look like this.

<Dealer_Stock>
<Dealer_Stock_List>
<Stock_Date>2006-02-07</Stock_Date>
<Stock_Due>12</Stock_Due>
<Stock_Item>
<Veh_Reg>JYL105N</Veh_Reg>
<Veh_Qual>Few Dents on Front</Veh_Qual>
<Veh_Type>Cortina</Veh_Type>
<Veh_Price>1195.00</Veh_Price>
</Stock_Item>

So, If I try to access the list usig your method as shown below, I get the following in the Trace output.
SET ...Dealer_Stock.Dealer_Stock_List.Stock_Item.[1].Veh_Type='Anglia';

(0x03000000):Stock_Date = DATE '2006-02-09'
(0x03000000):Stock_Due = 2
(0x01000000):Stock_Item = (
(0x03000000):Veh_Reg = 'JYL105N'
(0x03000000):Veh_Qual = 'Few Dents on Front'
(0x03000000):Veh_Type = 'Cortina'
(
(0x03000000):Veh_Type= 'Anglia'
)
)

So, it seems to have created a new tag rather than updating the existing one.

/s
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Feb 09, 2006 1:12 pm    Post subject: Re: A bit more info Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

smdavies99 wrote:
SET ...Dealer_Stock.Dealer_Stock_List.Stock_Item.[1].Veh_Type='Anglia';


"Stock_Item.[1]" is different than "Stock_Item[1]".
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Feb 09, 2006 1:27 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Thanks, I was seeing to many dots (before my eyes).

A Dooooooooooohhhhhhhhhhhhh Moment I'm sure

/s
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
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 » Adding more data of the same name to a message
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.