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 » CDATA - Help!

Post new topic  Reply to topic
 CDATA - Help! « View previous topic :: View next topic » 
Author Message
LH33
PostPosted: Sat Aug 30, 2003 10:36 am    Post subject: CDATA - Help! Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

HI! I have a message flow that transforms a tag from a decode value to it's full value. I am having a problem getting an & to display as an &. The value I am transforming is CUTNCLEAR. I need to display this as 'Cut & Clear'. When I do a

SET OutputRoot.XML.data =

CASE

WHEN 'CUTNCLEAR' THEN 'Cut & Clear'

the output is displayed as <Cut &amp; Clear>

Can someone help me with how to display the & as an & and not have the &amp;.

I have tried using the following CDatasection and all sorts of variations of it and cannot get it to work:

SET OutputRoot.XML.data.(XML.CDataSection) =
OutputRoot.XML.data;
Back to top
View user's profile Send private message
kirani
PostPosted: Sat Aug 30, 2003 7:06 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Try this,
Code:

SET OutputRoot.XML.(XML.CDataSection)data = 'Cut & Clear' ;

_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
LH33
PostPosted: Sun Aug 31, 2003 9:02 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

Kiran,

I tried your suggestion and it still is not giving me the right output. Here is my input XML: The tag Filter index = 2 is the one I want to be "Cut & Clear'.

<SyncSpecDutyIn revision="1.0.0" environment="Test">
<DataArea>
<SpecDutyIn>
<Crew>
<AgencyCode>EOM</AgencyCode>
<CrewCode>EOM-E44910</CrewCode>
<CrewState>A</CrewState>
<CrewType/>
<CurrentJobNumber/>

<Filters>
<Filter index="1">CK</Filter>
<Filter index="2">EOM_CUTNCL</Filter>
<Filter index="3">30-02-03</Filter>
</Filters>

<TagFlag>0</TagFlag>
<UserRouting>0</UserRouting>
<WorkCode>DEFAULT</WorkCode>
</Crew>

</SpecDutyIn>
</DataArea>
</SyncSpecDutyIn>

Here is my code:

DECLARE FIL2 CHAR;
SET FIL2 = THE ( SELECT ITEM R FROM
InputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.Filters.Filter[] as R where
R.(XML.Attribute)index = '2');
SET OutputRoot.XML.SyncSpecDutyIn.DataArea.fil2 = FIL2;

IF FIL2 = 'EOM_CUTNCL' THEN
SET OutputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.Filters.Filter[2].(XML.CDataSection)data =
'Cut & Clear' ;
SET OutputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.Filters.Filter[2].(XML.Attribute)index=2;


Whe I run it, here is what is in the output tag: It looks like it may be picking up the third Filter index also. Do you have any suggestions? (Thanks for your help!))


<Filter index="2">
30-02-03
<![CDATA[Cut & Clear]]>
</Filter>
Back to top
View user's profile Send private message
kirani
PostPosted: Mon Sep 01, 2003 7:48 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

I tried following code on my machine with "Copy Complete Message" selected in Compute node.

Code:

SET OutputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.Filters.Filter[2] VALUE = NULL;
      
DECLARE FIL2 CHAR;
SET FIL2 = THE ( SELECT ITEM R FROM    InputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.Filters.Filter[] as R
                     where R.(XML.Attribute)index = '2');
SET OutputRoot.XML.SyncSpecDutyIn.DataArea.fil2 = FIL2;

IF FIL2 = 'EOM_CUTNCL' THEN
      SET OutputRoot.XML.SyncSpecDutyIn.DataArea.SpecDutyIn.Crew.Filters.Filter[2].(XML.CDataSection)data = 'Cut & Clear' ;
END IF;


and it gives me following output,
Code:

<SyncSpecDutyIn revision="1.0.0" environment="Test">
<DataArea>
<SpecDutyIn>
<Crew>
<AgencyCode>EOM</AgencyCode>
<CrewCode>EOM-E44910</CrewCode>
<CrewState>A</CrewState>
<CrewType/>
<CurrentJobNumber/>
<Filters>
<Filter index="1">CK</Filter>
<Filter index="2"><![CDATA[Cut & Clear]]></Filter>
<Filter index="3">30-02-03</Filter>
</Filters>
<TagFlag>0</TagFlag>
<UserRouting>0</UserRouting>
<WorkCode>DEFAULT</WorkCode>
</Crew>
</SpecDutyIn>
<fil2>EOM_CUTNCL</fil2>
</DataArea>
</SyncSpecDutyIn>


Is this is what you want?
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
LH33
PostPosted: Tue Sep 02, 2003 4:50 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

Kiran,

Yes!! That works great! I have another question - I have another application that I need to send the same information to and would like to escape the & so that the recieving application does not have to remove the CDATA section.

Do you have any suggestions on how to code that?

Thanks!!! Have a good one!
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Sep 02, 2003 8:39 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

For escaping the characters you don't have to do anything special in your ESQL code, XML parser would take care of this for you when writing out the message on a queue. For example,

SET OutputRoot.XML.COName = 'AT&T'; will get converted to AT&amp;T automatically.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
LH33
PostPosted: Tue Sep 02, 2003 10:18 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

Kiran,

Thanks!! It workd Grea!

Lisa
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 » CDATA - Help!
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.