|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
XML in CDATA |
« View previous topic :: View next topic » |
Author |
Message
|
MBMQDeveloper |
Posted: Tue Aug 21, 2012 1:12 am Post subject: XML in CDATA |
|
|
Novice
Joined: 02 Jul 2012 Posts: 19
|
Hi Every One,
I currently have a requirement where I have CDATA in the inbound xml. The CDATA contains an xml which needs to be extracted and sent to a different system. The sample xml is as below.
Code: |
<Training_workspace>
<MyApplication>
<data>
<![CDATA[<Message>
<SubElement1>Hello</SubElement1>
<SubElement2>World</SubElement2>
</Message>
]]>
</data>
</MyApplication>
</Training_workspace>
|
I am able to successfully extract the content of the CDATA and able to store the same in an environment variable.
Code: |
SET Environment.Variables.innerXML = FIELDVALUE(InputRoot.XMLNSC.Training_workspace.MyApplication.data);
SET OutputRoot.XMLNSC = Environment.Variables.innerXML;
|
I am able to see that outputroot with the required data in it, post the compute node. However, I am receiving a parser exception when I send the CDATA in the OutputRoot as an xml.
Exact Error is given below.
Code: |
Severity:INTEGER:3
Number:INTEGER:5031
Text:CHARACTER:No root element was found while writing the XML message.
|
Can anyone of you please let me know the mistake here? |
|
Back to top |
|
 |
MBMQDeveloper |
Posted: Tue Aug 21, 2012 1:14 am Post subject: |
|
|
Novice
Joined: 02 Jul 2012 Posts: 19
|
|
Back to top |
|
 |
mqjeff |
Posted: Tue Aug 21, 2012 1:47 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You've done a number of things wrong.
First is not applying Fixpack 4 of v7.0.
It's not directly related to your problem, but it is a problem. Upgrade.
What is directly related to your problem is that Environment.Variables.innerXML does not have a parser associated with it, nor is it anything other than a character string.
Use OutputRoot.Blob instead of OutputRoot.XML. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Aug 21, 2012 1:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You need to either treat the Data as a BLOB or PARSE it:
Code: |
SET OutputRoot.XMLNSC = PARSE( Environment.Variables.innerXML,...); |
... check the syntax of the command  _________________ MQ & Broker admin |
|
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
|
|
|
|