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 » unable to parse xml string from database to xml

Post new topic  Reply to topic
 unable to parse xml string from database to xml « View previous topic :: View next topic » 
Author Message
skadaval
PostPosted: Mon Jan 18, 2010 9:14 pm    Post subject: unable to parse xml string from database to xml Reply with quote

Novice

Joined: 26 Mar 2008
Posts: 15

Hi All,
msg flow:
MQInput---->ComputeNode(select query for xml string) ---->mapping node(build output xml)--->MQoutput

we have a requirement to select xml string from database (sql server) and parse this xml string as XML. Therefore , I developed a flow as shown above.

I am able to parse If xml string in database is bitsream.
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC') PARSE(outMsg, InputProperties.Encoding, InputProperties.CodedCharSetId);

how can I parse If xml string in database is varchar.


Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jan 19, 2010 1:15 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
how can I parse If xml string in database is varchar.
How does the varchar appear in your message flow? Presumably it's a CHARACTER. But CREATE...PARSE needs a BLOB. So you need to convert your CHARACTER to a BLOB.
Back to top
View user's profile Send private message
skadaval
PostPosted: Wed Jan 20, 2010 12:00 pm    Post subject: Reply with quote

Novice

Joined: 26 Mar 2008
Posts: 15

Kimbert,
In message flow represents string (VARCHAR)as character. Therefore , I converted CHARACTER into blob and now I am able to parse .


DECLARE xmlstring BLOB cast(Environment.Select.EventMessage as BLOB CCSID 1208);


CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC') PARSE(xmlstring, InputProperties.Encoding, InputProperties.CodedCharSetId);

Thanks for your valuable advise
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jan 20, 2010 1:26 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Code:
DECLARE xmlstring BLOB cast(Environment.Select.EventMessage as BLOB CCSID 1208);
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC') PARSE(xmlstring, InputProperties.Encoding, InputProperties.CodedCharSetId);
The first line takes the CHARACTER string and creates a BLOB. That BLOB contains the same characters, but encoded in code page 1208 ( UTF-8 ).
The second line attempts to parse the BLOB. You know for sure that the BLOB contains UTF-8 characters, so you should specify CCSID 1208 on the PARSE clause.
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 » unable to parse xml string from database to xml
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.