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 » Changing the XMl Tree

Post new topic  Reply to topic
 Changing the XMl Tree « View previous topic :: View next topic » 
Author Message
bugsbunny
PostPosted: Fri Jun 10, 2005 11:53 pm    Post subject: Changing the XMl Tree Reply with quote

Novice

Joined: 24 Apr 2005
Posts: 11

Hello Everybody

I want to modify the XMl Tree for that i have a message flow :

Message Flow:
Input node - FilterNode - Compute Node- Output Node

Sample Message is

<Invoice>
<InvoiceNo>300524</InvoiceNo>
<InvoiceDate>2000-12-07</InvoiceDate>
<InvoiceTime>12:40:00</InvoiceTime>
<TillNumber>3</TillNumber>
<Cashier StaffNo="089">Mary</Cashier>
<Customer>
<FirstName>Andrew</FirstName>
<LastName>Smith</LastName>
<Title>Mr</Title>
<DOB>20-01-70</DOB>
<PhoneHome>01962818000</PhoneHome>
<PhoneWork/>
<Billing>
<Address>14 High Street</Address>
<Address>Hursley Village</Address>
<Address>Hampshire</Address>
<PostCode>SO213JR</PostCode>
</Billing>
</Customer>
<Payment>
<CardType>Visa</CardType>
<CardNo>4921682832258418</CardNo>
<CardName>Mr Andrew J. Smith</CardName>
<Valid>1200</Valid>
<Expires>1101</Expires>
</Payment>
<Purchases>
<Item>
<Title Category="Computer" Form="Paperback" Edition="2">The XML Companion
</Title>
<ISBN>0201674866</ISBN>
<Author>NeilBradl ey</Author>
<Publisher>Addison-Wesley</Publisher>
<PublishDate>October 1999</PublishDate>
<UnitPrice>27.95</UnitPrice>
<Quantity>2</Quantity>
</Item>
<Item>
<Title Category="Computer" Form="Paperback" Edition="2">A Complete Guide
to DB2 UniversalDatabase</Titl e>
<ISBN>1558604820</ISBN>
<Author>Don Chamberlin</Author>
<Publisher>Morgan Kaufmann Publishers</Publisher>
<PublishDate>April 1998</PublishDate>
<UnitPrice>42.95</UnitPrice>
<Quantity>1</Quantity>
</Item>
<Item>
<Title Category="Computer" Form="Hardcover" Edition="0">JAVA 2 Developers
Handbook</Title>
<ISBN>0782121799</ISBN>
<Author>Philip Heller, Simon Roberts </Author>
<Publisher>Sybex, Inc.</Publisher>
<PublishDate>September 1998</PublishDate>
<UnitPrice>59.99</UnitPrice>
<Quantity>1</Quantity>
</Item>
</Purchases>
<StoreRecords/>
<DirectMail/>
<Error/>
</Invoice>

In Compute node i am saying copy entire message.
Can anybody tell me wat is the differenece between copy entire message and message header......

I chose copy entire message and wrote down the floowing esql

DECALRE myref REFERENCE TO InputRoot.Invoice.Customer.Firstname;
SET myref .Billing.Address[1] = 'Oaklands';
I am deploying the message flow and putting the message in the input node..
the message is flowing to the failure terminal.

Please do guide me in this regard
Back to top
View user's profile Send private message Yahoo Messenger
elvis_gn
PostPosted: Sat Jun 11, 2005 4:21 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

hi p_bunny,
firstly the copy entire message will copy ur entire message i.e the message headers ( MQ internal stuff which i dont think ur using here,if u browse the message in MQ explorer, the information u see apart from the message on the last page is MQ headers) and the message body(ur XML)...

A copy message header will only copy the headers and u'll lose ur data....
I think u can use copy entire message.....

Secondly,....u are setting myref to the firstname, so u cannot access the billing information of ur XML in it...
If u want to DECLARE it to InputBody.Invoice.Billing.Address;
Back to top
View user's profile Send private message Send e-mail
JT
PostPosted: Sat Jun 11, 2005 5:22 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Your ESQL statements attempt to modify the input message.

You can't.

It's an elementary concept that you are not allowed to modify the InputRoot tree.

My guess is you want to modify the OutputRoot tree as such:

Quote:
DECLARE myref REFERENCE TO OutputRoot.XML.Invoice.Customer;
SET myref.Billing.Address[1] = 'Oaklands';
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Sat Jun 11, 2005 5:38 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

elvis_gn wrote:
A copy message header will only copy the headers and u'll lose ur data....

Only if you don't copy it yourself!

It's usually a lot more efficient to CopyMessageHeaders and then write ESQL to build the new message, instead of CopyEntireMessage and then delete a bunch of stuff and then add a bunch of stuff - when you need to build an output message that is significantly different in structure from the input message.
_________________
I am *not* the model of the modern major general.
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 » Changing the XMl Tree
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.