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 » convert xml tree to cdata

Post new topic  Reply to topic
 convert xml tree to cdata « View previous topic :: View next topic » 
Author Message
brgmo
PostPosted: Tue Jul 22, 2008 2:05 pm    Post subject: convert xml tree to cdata Reply with quote

Master

Joined: 03 Jun 2002
Posts: 227

Hi All,

I want convert the xml tree at the output node to character and copy that to cadata section of the output xml.How to do this, any ideas.

Regards
brgmo.
Back to top
View user's profile Send private message
sridhsri
PostPosted: Tue Jul 22, 2008 5:49 pm    Post subject: Reply with quote

Master

Joined: 19 Jun 2008
Posts: 297

I guess you use XMLNSC.CDataField to store the contents of the CData. If you want to add existing XML to this CData Field, you could convert it to BLOB (with the right CCSID and Encoding) and then set it.

If that doesn't work, you might want to try using ASBITSTREAM on the XML. But I must tell you that kimbert has warned against incorrect or unnecessary usuage of ASBITSTREAM. So use it only if you absolutely must.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jul 23, 2008 12:41 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

sridhsri is correct.
- ASBITSTREAM to get a BLOB
- CAST to CHARACTER with the correct CCSID and encoding
- SET OutputRoot.XMLNSC.(XMLNSC.CDataField)myCDataField = myChars;

Quote:
But I must tell you that kimbert has warned against incorrect or unnecessary usuage of ASBITSTREAM. So use it only if you absolutely must.
Not quite. ASBITSTREAM is a very useful function.
I warned about unnecessary use of XMLNSC.Bitstream and XMLNSC.AsisElementContent. I prefer people to use the facilities provided by the parser if possible, because it's safer and more maintainable. This thread is a good example of what I mean. You *could* wrap CData tags around the XML string and then use XMLNSC.AsisElementContent. But why would you bother, when XMLNSC.CData is available?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » convert xml tree to cdata
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.