Author |
Message
|
dev |
Posted: Fri Mar 15, 2002 8:33 am Post subject: |
|
|
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 |
|
 |
kirani |
Posted: Fri Mar 15, 2002 9:39 am Post subject: |
|
|
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 |
|
 |
dev |
Posted: Fri Mar 15, 2002 9:45 am Post subject: |
|
|
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 |
|
 |
jfluitsm |
Posted: Sat Mar 16, 2002 5:31 am Post subject: |
|
|
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 |
|
 |
kirani |
Posted: Mon Mar 18, 2002 9:14 am Post subject: |
|
|
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 |
|
 |
jfluitsm |
Posted: Tue Mar 19, 2002 11:31 am Post subject: |
|
|
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 |
|
 |
|