|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
(XML.CDataSection) and MRM |
« View previous topic :: View next topic » |
Author |
Message
|
wolstek |
Posted: Tue Mar 22, 2005 7:29 am Post subject: (XML.CDataSection) and MRM |
|
|
Acolyte
Joined: 25 Jun 2001 Posts: 52 Location: Bristol, UK
|
I am attempting to build an MRM/XML1 output message that contains a tag which has the original xml message as its contents (within a CDATA section).
e.g for example based on input message defined as an MRM/XML1 message set, created by imported schema
<?xml version="1.0"?>
<Message>
<tag1>tag1data</tag1>
<tag2><![CDATA[<Anothermsg>....<Anothermsg>]]>
<tag3>tag3data</tag3>
</Message>
for example , I want to create an output message tha looks like( again defined as an MRM/XML1 message set, created by imported schema )
<OutputMessage>
<outtag1>outtag1</outtag1>
<outtag2>
<![CDATA[<?xml version="1.0"?><Message><tag1>tag1data</tag1><tag2><![CDATA[<Anothermsg>....<Anothermsg>]]><tag3>tag3data</tag3></Message>]]>
</outtag2>
</OutputMessage>
I have tried to create <outtag2> in two different ways
first concatenating the CDATA expression
Code: |
DECLARE RootBitStreamOptions INTEGER BITOR(RootBitStream, ValidateNone);
DECLARE workBlob BLOB;
SET workBlob = ASBITSTREAM(InputRoot.MRM OPTIONS RootBitStreamOptions SET 'msgsetid' TYPE 'msgset_name' FORMAT 'XML1');
SET OutputRoot.MRM.outtag2
= '<![CDATA[' || CAST( workBlob AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding) || ']]>';
|
second using the (XML.CDataSection) expression
Code: |
DECLARE RootBitStreamOptions INTEGER BITOR(RootBitStream, ValidateNone);
DECLARE workBlob BLOB;
SET workBlob = ASBITSTREAM(InputRoot.MRM OPTIONS RootBitStreamOptions SET 'msgsetid' TYPE 'msgset_name' FORMAT 'XML1');
SET OutputRoot.MRM.outtag2.(XML.CDataSection)
= CAST( workBlob AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding);
|
The first way works albeit with the output message with < expressions instead of '<' e.g ( <outtag2>< |
fazz |
Posted: Wed Mar 23, 2005 8:22 am Post subject: |
|
|
 Centurion
Joined: 20 Feb 2004 Posts: 144 Location: England
|
You cannot have nested CDATA sections within an XML message. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|