|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
XML, BITSTREAM AND CAST |
« View previous topic :: View next topic » |
Author |
Message
|
3314 |
Posted: Thu Feb 13, 2003 9:18 am Post subject: XML, BITSTREAM AND CAST |
|
|
Newbie
Joined: 13 Feb 2003 Posts: 1
|
Hello,
I´m trying to write some ESQL, to convert an input XML into a string, to store it for backup reasons.
To prove this I have a basic flow : Input node, compute and output node.
In the compute, I have the following code:
SET OutputRoot.XML.D17_CTRL.INPUT_STRING = CAST(BITSTREAM(InputBody) AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId);
The problem, is that the result of the code: 'CAST(BITSTREAM(InputBody) AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId)', is the input XML, but without the '<' and '>' simbols, but '<' and '>'
Someone knows how to obtain the original string with the original simbols?
Thanks. |
|
Back to top |
|
 |
jfluitsm |
Posted: Fri Feb 14, 2003 1:01 am Post subject: |
|
|
Disciple
Joined: 24 Feb 2002 Posts: 160 Location: The Netherlands
|
It's all in the XML-standard.
< and > are not allowed in the contents of an XML-field as are ' " and ;
Using these symbols in XML-fields can generate an error when parsed again, but in your case the original message would be interpreted as a subtree under INPUT_STRING.
You can solve this by placing the string in a CDATA-section.
SET ....INPUT_STRING.(XML.CDataSection) = ...
This will enclose the original message between <![CDATA[ and ]]> _________________ Jan Fluitsma
IBM Certified Solution Designer WebSphere MQ V6
IBM Certified Solution Developer WebSphere Message Broker V6 |
|
Back to top |
|
 |
yaakovd |
Posted: Fri Feb 14, 2003 6:42 am Post subject: |
|
|
Partisan
Joined: 20 Jan 2003 Posts: 319 Location: Israel
|
You can store XML as BLOB. This what I use for the similar reason.
1. reset content to BLOB (using ResetContent node)
2. store "Root"."BLOB" using DataInsertNode
or
just store using DataInsertNode as BITSTREAM("Root"."XML")
When you get it from DB:
1.SET "OuputRoot"."BLOB" = <select from DB> in compute node
2.Reset content to XML
3. You have correct XML.
CDATA is good solution when you need transfer XML in XML(for example in WorkFlow), but I really don't see any reason for you to change message. _________________ Best regards.
Yaakov
SWG, IBM Commerce, Israel |
|
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
|
|
|
|