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 » CAST XML to Character

Post new topic  Reply to topic
 CAST XML to Character « View previous topic :: View next topic » 
Author Message
Gama
PostPosted: Mon Apr 18, 2005 9:19 am    Post subject: CAST XML to Character Reply with quote

Centurion

Joined: 11 Jan 2005
Posts: 103
Location: Portugal

Hello,

Im new in WMQI, and i need to convert one XML message in one String of Character, and then include them in another xml message.

Here it is the message to convert:
<MSG>
<CLIE>306 < / CLIE>
<TABLE>T306LEPK < / TABLE>
<FIELD>LEDEP < / FIELD>
<QUEUE>WMQI_DESADV_IN < / QUEUE>
<LIB>MQSIBK < / LIB>
</MSG>

And the one that me necessíto is the following:

SET OutputRoot.XML.DATA.TS = "message in", but the message need to be in text and not in XML.

It cannot be this way.
SET OutputRoot.XML.DATA.TS = InputRoot.XML;

Thank you for your support



Here it is the message to convert:
<MSG>
<CLIE>306 < / CLIE>
<TABLE>T306LEPK < / TABLE>
<FIELD>LEDEP < / FIELD>
<QUEUE>WMQI_DESADV_IN < / QUEUE>
<LIB>MQSIBK < / LIB>
</MSG>

And the one that me necessíto is the following:

SET OutputRoot.XML.DATA.TS = "message in", but the message need to be in text and not in XML.

It cannot be this way.
SET OutputRoot.XML.DATA.TS = InputRoot.XML;

Thank you for your support
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Apr 18, 2005 10:14 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Do you want a string that is "<MSG><CLIE>306</CLIE><TABLE>" and etc?

Or do you want a string that does not have the XML Tags?

If you want the tags, then you want to use the ASBITSTREAM function.

If you do not want the tags, then you want to write a loop over the elements and use FIELDVALUE and the || concatenation operator.

Or you can model the data using TDS or CWF.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Gama
PostPosted: Mon Apr 18, 2005 10:27 am    Post subject: Reply with quote

Centurion

Joined: 11 Jan 2005
Posts: 103
Location: Portugal

jefflowrey wrote:
Do you want a string that is "<MSG><CLIE>306</CLIE><TABLE>" and etc?

Or do you want a string that does not have the XML Tags?

If you want the tags, then you want to use the ASBITSTREAM function.

If you do not want the tags, then you want to write a loop over the elements and use FIELDVALUE and the || concatenation operator.

Or you can model the data using TDS or CWF.


Is something like that:

all i need is that

<DATA>
<TS>&lt;MSG&gt;&lt;CLIE&gt;306&lt;/CLIE&gt;&lt;TABLE&gt;</TS>
</DATA>
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Apr 18, 2005 10:37 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Yes, so use ASBITSTREAM on the Input XML and assign the results to the appropriate place in a new set of Output XML.

Make sure to call CopyMessageHeaders not CopyEntireMessage, so you can create all new Output XML.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Gama
PostPosted: Mon Apr 18, 2005 10:43 am    Post subject: Reply with quote

Centurion

Joined: 11 Jan 2005
Posts: 103
Location: Portugal

jefflowrey wrote:
Yes, so use ASBITSTREAM on the Input XML and assign the results to the appropriate place in a new set of Output XML.

Make sure to call CopyMessageHeaders not CopyEntireMessage, so you can create all new Output XML.



Bu using the BITSTREAM i give this result

<DATA>
<TS>X&apos;3c4d53473e3c434c49453e3330363c2f434c49453e3c5441424c453e543330364c45504b3c2f5441424c453e3c4649454c443e4c454445503c2f4649454c443e3c51554555453e574d51495f4445534144565f494e3c2f51554555453e3c4c49423e4d515349424b3c2f4c49423e3c464c41473e5945533c2f464c41473e3c43504e593e444c533c2f43504e593e3c2f4d53473e&apos;</TS>
</DATA>


This is not the message i need.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Apr 18, 2005 10:47 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Why would you use BITSTREAM?

I said ASBITSTREAM and I meant ASBITSTREAM.

Please show your ESQL.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Gama
PostPosted: Mon Apr 18, 2005 10:51 am    Post subject: Reply with quote

Centurion

Joined: 11 Jan 2005
Posts: 103
Location: Portugal

jefflowrey wrote:
Why would you use BITSTREAM?

I said ASBITSTREAM and I meant ASBITSTREAM.

Please show your ESQL.



Sorry.....

My excuses

Here is the code:

SET OutputRoot.XML.DATA.TS = CAST(asbitstream(InputRoot.XML) AS CHARACTER CCSID 1208);

and the output is:

<DATA>
<TS>&lt;MSG&gt;&lt;CLIE&gt;306&lt;/CLIE&gt;&lt;TABLE&gt;T306LEPK&lt;/TABLE&gt;&lt;FIELD&gt;LEDEP&lt;/FIELD&gt;&lt;QUEUE&gt;WMQI_DESADV_IN&lt;/QUEUE&gt;&lt;LIB&gt;MQSIBK&lt;/LIB&gt;&lt;FLAG&gt;YES&lt;/FLAG&gt;&lt;CPNY&gt;DLS&lt;/CPNY&gt;&lt;/MSG&gt;</TS>
</DATA>
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Apr 18, 2005 10:57 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

So you only need a set of the input, not all of it?

Then you can either... put in another compute node and change the message so that the Input XML to your current is all you need...

or use CREATE... DOMAIN to create a structure in Environment or LocalEnvironment that has the XML parser attached, and set the needed fields there, and then run ASBITSTREAM on that.
_________________
I am *not* the model of the modern major general.
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 » CAST XML to Character
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.