|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
unable to parse xml string from database to xml |
« View previous topic :: View next topic » |
Author |
Message
|
skadaval |
Posted: Mon Jan 18, 2010 9:14 pm Post subject: unable to parse xml string from database to xml |
|
|
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 |
|
 |
kimbert |
Posted: Tue Jan 19, 2010 1:15 am Post subject: |
|
|
 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 |
|
 |
skadaval |
Posted: Wed Jan 20, 2010 12:00 pm Post subject: |
|
|
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 |
|
 |
kimbert |
Posted: Wed Jan 20, 2010 1:26 pm Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|