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 » How serialize a XML structure

Post new topic  Reply to topic
 How serialize a XML structure « View previous topic :: View next topic » 
Author Message
devita
PostPosted: Mon Jul 30, 2001 3:14 am    Post subject: Reply with quote

Novice

Joined: 19 Jul 2001
Posts: 14


Hi, I have a XML structure:

<A>
<X>field1</X>
<Y>field2</Y>
<Z>field3</Z>
...
</A>

and I'd like to transform this structure in a new structure:

<A>
<W>field1field2field3...</W>
</A>

and I'd like to obtain this new structure using a compute node with generic ESQL code.

I used this instruction:
SET OutputRoot.XML.A.W = BITSTREAM(InputRoot.XML.A);

but the BITSTREAM output is a hexadecimal string.
Then I translated this string in a char string using a my translation routine
but I had a very inefficient compute node.

Is there any better ways to obtain the same output?
Back to top
View user's profile Send private message Send e-mail
kolban
PostPosted: Mon Jul 30, 2001 5:18 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

You could use the following ESQL in a compute node:

DECLARE C INTEGER;
SET C = CARDINALITY(InputRoot.*[]);
DECLARE I INTEGER;
SET I = 1;
WHILE I < C DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
DECLARE COUNTER INTEGER;
DECLARE J INTEGER;
SET COUNTER = CARDINALITY(InputRoot.XML.A.*[]);
SET J = 1;
SET OutputRoot.XML.A.W = '';
WHILE J <= COUNTER DO
SET OutputRoot.XML.A.W = OutputRoot.XML.A.W || InputRoot.XML.A.*[J];
SET J = J + 1;
END WHILE;
Back to top
View user's profile Send private message
devita
PostPosted: Tue Jul 31, 2001 2:03 am    Post subject: Reply with quote

Novice

Joined: 19 Jul 2001
Posts: 14

OK, I tested your solution that works fine for XML but I have a some tradeoff for MRM structures.
I choose the BITSTREAM instruction for parsing the MRM tree and padding the MRM fields with the missing blanks in respect of the CWF lengths.
If I use the concatenation of the fields I have the field's serialization but without these blanks.

Do you agree with my experiments?
When are used the physical MRM definitions?
When is built the physical string?

thank you
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How serialize a XML structure
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.