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 to convert this XML messages in well format.

Post new topic  Reply to topic
 How to convert this XML messages in well format. « View previous topic :: View next topic » 
Author Message
dev
PostPosted: Fri Mar 15, 2002 8:33 am    Post subject: Reply with quote

Apprentice

Joined: 11 Oct 2001
Posts: 30

Hi,
I have a xml message comming out after concatanation looks l

<GTS_pub>
<Header>
<Topic>SOL_UPD_1</Topic>
<MessageSequence>1</MessageSequence>
<TableName>SOL</TableName>
<SchemaName></SchemaName>
<ClientId></ClientId>
<TriggerTime></TriggerTime>
<TriggerEvent>UPDATE</TriggerEvent>
<Date>XX</Date>
<Time>XX</Time>
</Header>
<Data>
<PARTY_ID>111</PARTY_ID>
<PARTY_STATUS>X</PARTY_STATUS>
<EFF_END_DT>XXX</EFF_END_DT>
</Data>
</GTS_pub>
<GTS_pub>
<Header>
<Topic>SOL_UPD_1</Topic>
<MessageSequence>1</MessageSequence>
<TableName>SOL</TableName>
<SchemaName></SchemaName>
<ClientId></ClientId>
<TriggerTime></TriggerTime>
<TriggerEvent>UPDATE</TriggerEvent>
<Date>XX</Date>
<Time>XX</Time>
</Header>
<Data>
<PARTY_ID>111</PARTY_ID>
<PARTY_STATUS>X</PARTY_STATUS>
<EFF_END_DT>XXX</EFF_END_DT>
</Data>
</GTS_pub>
.
.
.
<GTS_pub>
<Header>
<Topic>SOL_UPD_1</Topic>
<MessageSequence>1</MessageSequence>
<TableName>SOL</TableName>
<SchemaName></SchemaName>
<ClientId></ClientId>
<TriggerTime></TriggerTime>
<TriggerEvent>UPDATE</TriggerEvent>
<Date>XX</Date>
<Time>XX</Time>
</Header>
<Data>
<PARTY_ID>111</PARTY_ID>
<PARTY_STATUS>X</PARTY_STATUS>
<EFF_END_DT>XXX</EFF_END_DT>
</Data>
</GTS_pub>

Here I have one large message containing many messages one after another after concanatation(apending one after another).

Now I need to parse it and give one out message out after combining all <Data> tags portion and <Header> of first message.

I need to know that how many repetetive <GTS_pub> are there, for that I am using CARDINALITY("InputBody"."GTS_pub"[]) and running and while loop to combine that.

But it gives an error that Input XML message is not well formed, as per my understanding it is because of having more than one Root elements.

So I am trying to put complete XML Message inside one parent tags say

SET OutputRoot.XML= '<Msg>'||"InputBody"||'</Msg>';

But it does not work.

Any help????

[ This Message was edited by: dev on 2002-03-15 08:34 ]
Back to top
View user's profile Send private message
kirani
PostPosted: Fri Mar 15, 2002 9:39 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Try something like this ...

MQInput->Compute->RCD-> .....

In MQInput, read your message as BLOB.

In Compute, select copy message headers only and use following esql.
DECLARE OuterOTag BLOB;
DECLARE OuterCTag BLOB;

-- Hex value for <Msg>
SET OuterOTag = X'3C4D73673E';
-- Hex value for </Msg>
SET OuterCTag = X'3C2F4D73673E';

-- Create new output message
SET OutputRoot."BLOB"."BLOB" = OuterOTag || InputRoot."BLOB"."BLOB" || OuterCTag ;


Using RCD, convert your message to XML.

Kiran
Back to top
View user's profile Send private message Visit poster's website
dev
PostPosted: Fri Mar 15, 2002 9:45 am    Post subject: Reply with quote

Apprentice

Joined: 11 Oct 2001
Posts: 30

Thanks Kirani,
Fortunately I got it resolved before! I did follow the same approach anyway.

Appreciated!!

Dev
Back to top
View user's profile Send private message
jfluitsm
PostPosted: Sat Mar 16, 2002 5:31 am    Post subject: Reply with quote

Disciple

Joined: 24 Feb 2002
Posts: 160
Location: The Netherlands

This doesn't work when it has to be promoted to OS/390.

I also tried a solution with the new (for 2.1) CREATE ... PARSE, but this still doesn't work with multiple message bodies.

_________________
Jan Fluitsma

IBM Certified Solution Designer WebSphere MQ V6
IBM Certified Solution Developer WebSphere Message Broker V6
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Mon Mar 18, 2002 9:14 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Hi Jan,

Did you try using EBCDIC values on OS/390? The above values are in ASCII, so you may not get valid XML tags (3C and 3E is HEX ASCII value for '<' and '>' characters).

I would try using EBCDIC HEX values for <Msg> and </Msg> (outer tags).

Kiran
Back to top
View user's profile Send private message Visit poster's website
jfluitsm
PostPosted: Tue Mar 19, 2002 11:31 am    Post subject: Reply with quote

Disciple

Joined: 24 Feb 2002
Posts: 160
Location: The Netherlands

Hi Kiran,

I don't have an OS/390 available, but I have no doubt this will work on OS/390 with EBCDIC values.
But what if development is on an AIX or NT-server and production is on OS/390?
Or production is AIX now, and will be OS/390 in future (because of a merger or something).
The later is specially worring as you expect that the message flows can be promoted from on MQSI platform to another (verions permitting).


_________________
Jan Fluitsma

IBM Certified Solution Designer WebSphere MQ V6
IBM Certified Solution Developer WebSphere Message Broker V6
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 to convert this XML messages in well format.
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.