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 » outputing inbound XML value as a string on q

Post new topic  Reply to topic
 outputing inbound XML value as a string on q « View previous topic :: View next topic » 
Author Message
nathanw
PostPosted: Wed Mar 02, 2005 2:46 am    Post subject: outputing inbound XML value as a string on q Reply with quote

Knight

Joined: 14 Jul 2004
Posts: 550

we have a multi output functionality that requires part of the input tree ie one field to be output to a separate q as a string

this can be repeating and therefore I am PROPAGATING within a cardinality loop for each instance in the message

how do i convert the field content value to a string and output it to the q?

the input tree is XML

Code:


input

<xml>
 <FIELD1>abcd</FIELD1>
<XML>

output required

abcd


many thanks
Back to top
View user's profile Send private message MSN Messenger
Craig B
PostPosted: Wed Mar 02, 2005 3:08 am    Post subject: Reply with quote

Partisan

Joined: 18 Jun 2003
Posts: 316
Location: UK

Hi,

To output text, you will need to use the BLOB domain since characters are just hex bytes represented by a specific Codepage. This should do the job :

Code:

DECLARE InRef REFERENCE TO InputRoot.XML.xml.FIELD1[1];
WHILE LASTMOVE(InRef) DO
   CALL CopyMessageHeaders();
   SET OutputRoot.BLOB.BLOB = CAST(FIELDVALUE(InRef) AS BLOB CCSID InputRoot.MQMD.CodedCharSetId);
   PROPAGATE;
   MOVE InRef NEXTSIBLING NAME 'FIELD1';
END WHILE;
RETURN FALSE;


Hope this helps.
_________________
Regards
Craig
Back to top
View user's profile Send private message
nathanw
PostPosted: Wed Mar 02, 2005 3:28 am    Post subject: Reply with quote

Knight

Joined: 14 Jul 2004
Posts: 550

Craig B wrote:
Hi,

To output text, you will need to use the BLOB domain since characters are just hex bytes represented by a specific Codepage. This should do the job :

Code:

DECLARE InRef REFERENCE TO InputRoot.XML.xml.FIELD1[1];
WHILE LASTMOVE(InRef) DO
   CALL CopyMessageHeaders();
   SET OutputRoot.BLOB.BLOB = CAST(FIELDVALUE(InRef) AS BLOB CCSID InputRoot.MQMD.CodedCharSetId);
   PROPAGATE;
   MOVE InRef NEXTSIBLING NAME 'FIELD1';
END WHILE;
RETURN FALSE;


Hope this helps.


Criag many thanks

thsi loks to be exactly what I need unfortunately I think there is a problem in the code it is saying that at this point

Code:
WHILE LASTMOVE(InRef) DO


There is a syntax error in the code and the only valid options are
Create Decalre End

any ideas?
Back to top
View user's profile Send private message MSN Messenger
Craig B
PostPosted: Wed Mar 02, 2005 3:48 am    Post subject: Reply with quote

Partisan

Joined: 18 Jun 2003
Posts: 316
Location: UK

Hi,

The code compiles into a CMF files and deploys to my V5 FP05 broker. What Version and FP level are you using?
_________________
Regards
Craig
Back to top
View user's profile Send private message
Craig B
PostPosted: Wed Mar 02, 2005 3:50 am    Post subject: Reply with quote

Partisan

Joined: 18 Jun 2003
Posts: 316
Location: UK

Obviously I meant FP04 broker.
_________________
Regards
Craig
Back to top
View user's profile Send private message
nathanw
PostPosted: Wed Mar 02, 2005 4:10 am    Post subject: Reply with quote

Knight

Joined: 14 Jul 2004
Posts: 550

V5 FP04

according to my system anyway
Back to top
View user's profile Send private message MSN Messenger
nathanw
PostPosted: Wed Mar 02, 2005 5:37 am    Post subject: Reply with quote

Knight

Joined: 14 Jul 2004
Posts: 550

Ok got it working woohoo!

many thanks
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » outputing inbound XML value as a string on q
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.