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 » Losing Attributes on tree assignment

Post new topic  Reply to topic
 Losing Attributes on tree assignment « View previous topic :: View next topic » 
Author Message
migstr
PostPosted: Fri Feb 21, 2003 10:38 am    Post subject: Losing Attributes on tree assignment Reply with quote

Apprentice

Joined: 05 Jun 2002
Posts: 34
Location: New York

Hi,
I am building an RFH2 with a usr folder by assigning values from an incoming XML message. The inbound XML has <key> elements with attributes like this:
<TESTDATA>
<RUNNUMBER>1000010</RUNNUMBER>
<RUNTYPE>RUN</RUNTYPE>
<INTERFACENAME>ESIINVOICE</INTERFACENAME>
<SOURCECAT>NORMAL</SOURCECAT>
<REGID>1</REGID>
<SEQUNCENUM>1</SEQUNCENUM>
<APPLICATIONDATA>
<KEYS>
<key name="InvoiceNumber">503555</key>
<key name="InvoiceTotal">150000.00</key>
</KEYS>
</APPLICATIONDATA>
<SAMPLE>TEST ONE</SAMPLE>
</TESTDATA>

When I assign the <APPLICATIONDATA> all the keys get moved to the OutputRoot but I lose the attributes. Is this the way it is supposed to work?
Here is my output in <usr> folder:
<ADAPTER type="Adapter"><INTERFACENAME>ESIINVOICE</INTERFACENAME><RUNNUMBER>1000010</RUNNUMBER><RUNTYPE>RUN</RUNTYPE><SOURCECAT>NORMAL</SOURCECAT><REGID>1</REGID>
<APPLICATIONDATA><KEYS>
<key>503555</key><key>150000.00</key></KEYS>
</APPLICATIONDATA></ADAPTER>

notice the <key> elements no longer have attributes.

Here is my ESQL:
SET OutputRoot.MQRFH2.usr.ADAPTER.(XML.attr)type='Adapter';
SET OutputRoot.MQRFH2.usr.ADAPTER.INTERFACENAME = InputRoot.XML.TESTDATA.INTERFACENAME;
SET OutputRoot.MQRFH2.usr.ADAPTER.RUNNUMBER = InputRoot.XML.TESTDATA.RUNNUMBER;
SET OutputRoot.MQRFH2.usr.ADAPTER.RUNTYPE = InputRoot.XML.TESTDATA.RUNTYPE;
SET OutputRoot.MQRFH2.usr.ADAPTER.SOURCECAT= InputRoot.XML.TESTDATA.SOURCECAT;
SET OutputRoot.MQRFH2.usr.ADAPTER.RUNNUMBER = InputRoot.XML.TESTDATA.RUNNUMBER;
SET OutputRoot.MQRFH2.usr.ADAPTER.BATCHSIZE = InputRoot.XML.TESTDATA.BATCHSIZE;
SET OutputRoot.MQRFH2.usr.ADAPTER.REGID = InputRoot.XML.TESTDATA.REGID;
SET OutputRoot.MQRFH2.usr.ADAPTER.SEQUENCENUM = InputRoot.XML.TESTDATA.SEQUENCENUM;
SET OutputRoot.MQRFH2.usr.ADAPTER.APPLICATIONDATA = InputRoot.XML.TESTDATA.APPLICATIONDATA;
SET OutputRoot.XML.SAMPLE = InputRoot.XML.TESTDATA.SAMPLE;

Does this mean I have to assign each element/attribute individually?
Thanks!
Back to top
View user's profile Send private message
DanielG
PostPosted: Sat Mar 29, 2003 3:01 am    Post subject: Reply with quote

Novice

Joined: 29 Mar 2003
Posts: 13

hi,
as far as i know, the formal RFH2 spec prohibits the use of XML attributes in the usr folder. only flat structures are allowed.
depending on what you aim with the RFH2 data, consider bitstreaming the data before putting it into the RFH2.
coding would be something like:
SET OutputRoot.MQRFH2.usr.APPLICATIONDATA = ASBITSTREAM(InputRoot.XML.TESTDATA.APPLICATIONDATA);

of course, before accessing the usr data in your target application, you will have to perform an explicit parse on the bitstream. in ESQL this could be achieved by using the CREATE FIELD function, e.g.
CREATE LASTCHILD OF OutputRoot.XML.TESTDATA DOMAIN 'XML' PARSE (InputRoot.MQRFH2.usr.APPLICATIONDATA);
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 » Losing Attributes on tree assignment
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.