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 » XML, BITSTREAM AND CAST

Post new topic  Reply to topic
 XML, BITSTREAM AND CAST « View previous topic :: View next topic » 
Author Message
3314
PostPosted: Thu Feb 13, 2003 9:18 am    Post subject: XML, BITSTREAM AND CAST Reply with quote

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 '&lt;' and '&gt;'

Someone knows how to obtain the original string with the original simbols?

Thanks.
Back to top
View user's profile Send private message
jfluitsm
PostPosted: Fri Feb 14, 2003 1:01 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
yaakovd
PostPosted: Fri Feb 14, 2003 6:42 am    Post subject: Reply with quote

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
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 » XML, BITSTREAM AND CAST
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.