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 » Assigning an XML Tag With all its children to CDATA

Post new topic  Reply to topic
 Assigning an XML Tag With all its children to CDATA « View previous topic :: View next topic » 
Author Message
RAJESHRAMAKRISHNAN
PostPosted: Tue Oct 19, 2004 6:37 am    Post subject: Assigning an XML Tag With all its children to CDATA Reply with quote

Voyager

Joined: 01 May 2004
Posts: 96

Hi All,
I have the following XML-
<ROOT><A1><A>This is data</A></A1></ROOT>.

I want to assign the entire "string" <A>This is data</A> to an element as CDATA ie

I have written esql like this SET OutputRoot.XML.Z(XML.CDataSection)=CAST(ROOT.A1 AS CHAR CCSID InputRoot.MQMD.CodedCharSetId);

This is not working. I even tried BITSTREAM and it is not working. How can we acheive this?

Thanks very much.
Back to top
View user's profile Send private message
JT
PostPosted: Tue Oct 19, 2004 7:25 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Try this:
Code:
Set OutputRoot.XML.Z.(XML.CDataSection) =
        CAST(ASBITSTREAM(InputBody.ROOT.A1.A OPTIONS FolderBitStream) AS CHAR
        CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding);
Back to top
View user's profile Send private message
RAJESHRAMAKRISHNAN
PostPosted: Tue Oct 19, 2004 10:53 pm    Post subject: Reply with quote

Voyager

Joined: 01 May 2004
Posts: 96

Hi JT,
Thanks for the reply. I forgot to tell one important thing- we may get data like this <ROOT><A1>This is data</A1></ROOT> also ,in this case I have to pick up only the text "This is data".

Now I have wriiten a code that works but it is not straight forward.

IF(InputRoot.XML.ROOT.A1 = '') THEN
Set OutputRoot.XML.Z.(XML.CDataSection) =
CAST(ASBITSTREAM(InputBody.ROOT.A1.[] OPTIONS FolderBitStream) AS CHAR
CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding);
ELSE
Set OutputRoot.XML.Z.(XML.CDataSection) = InputRoot.XML.ROOT.A1;
END IF;

Is it possible to write something different?
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 » Assigning an XML Tag With all its children 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.