|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Regarding Casting as BLOB |
« View previous topic :: View next topic » |
Author |
Message
|
Balaji_P |
Posted: Wed Jul 23, 2008 5:03 pm Post subject: Regarding Casting as BLOB |
|
|
Apprentice
Joined: 05 Sep 2006 Posts: 36 Location: Chennai
|
Hello all
I am facing one problem. I have a scenario where i am trying convert CDATA section of my input Message to BLOB and parse that in RCD defined with TDS message set .
In doing so i had done the same as below logic
SET Environment.CreateMembership.cdata =InputRoot.XML.OSHCStudent.Data;
SET Environment.Cdatablob = CAST(Environment.CreateMembership.cdata AS BLOB CCSID InputProperties.CodedCharSetId );
SET OutputRoot.BLOB.BLOB = Environment.Cdatablob;
In doing so i am losing my data such as \n which is a gropu termiantor in my messageset.
Any suggestion on how to take it on?
Below is m
<?xml version="1.0" encoding="UTF-8"?>
<OSHCStudent>
<Action>Upload</Action>
<ScheduleFormat>Format01</ScheduleFormat>
<Data><![CDATA[mas_impln,mas_policy,tmp_cnt,mas_preamt,mas_rate,mas_sf,mas_extlgh,mas_type,mas_prefix,mas_first,mas_middle,mas_last,mas_gender,mas_dob,mas_svexp,mas_arrdt,mas_expad,mas_cousd,mas_studid,mas_lang,mas_reln,mas_prefcm,mas_tffnd,mas_tfmno,mas_tfpd,mas_tfjn,add_do34,add_doadd1,add_doadd2,add_docity,add_dostat,add_dopost,add_docntr,add_re35,add_readd1,add_readd2,add_recity,add_restat,add_repost,add_recntr,add_ma37,add_maadd1,add_maadd2,add_macity,add_mastat,add_mapost,add_macntr,mas_pp41,mas_dorphn,mas_pp15,mas_homphn,mas_pp12,mas_mobphn,mas_ep28,mas_cameml,mas_ep30,mas_pereml,mas_campid
"0","KK080530 ","29","6489","SKU"," ","333828 "," "," ","* please do not use * "," "," "," ","30052008","30052008"
"1","","1","171","9900","S","5 Months","R","Mr","Anna","","Chan","M","01051991","18122009","","","06082007","S024093","","CON","","","","","","34","","","","","","","35","","","","","","","37","10/56-62 CARRINGTON AVE.","","HURSTVILLE","NSW","2220","Australia","41","","15","","12","","28","","30","",""
"2","","1","348","9900","S","12 Months","N","Miss","Bridget","","Chen","F","28061992","23122011","","","27012009","S026194","","CON","","","","","","34","","","","","","","35","","","","","","","37","c/ International Students George Street","","Broadway","NSW","2007","Australia","41","","15","","12","","28","","30","",""
"3","","1","171","9900","S","5 Months","R","Miss","Anna","","Ding","F","13111990","18122009","","","23072007","S023883","","CON","","","","","","34","","","","","","","35","","","","","","","37","2B/513 Regency Help Street","","Chatswood","NSW","2067","Australia","41","","15","","12","","28","","30","",""
"4","","1","174","9900","S","5 Months","R","Mr","Bridget","","Do","M","28071991","18122009","","","07022008","S025293","","CON","","","","","","34","","","","","","","35","","","","","","","37","c/ International Students 827-839 George Street","","Broadway","NSW","2007","Australia","41","","15","","12","","28","","30","",""
"5","","1","174","9900","S","5 Months","R","Mr","Anna","","Dong","M","15041989","19122008","","","23042007","S022526","","CON","","","","","","34","","","","","","","35","","","","","","","37","6/52 Premier Street","","Kogarah","NSW","2217","Australia","41","","15","","12","","28","","30","",""
]]></Data>
</OSHCStudent> |
|
Back to top |
|
 |
sridhsri |
Posted: Wed Jul 23, 2008 6:21 pm Post subject: |
|
|
Master
Joined: 19 Jun 2008 Posts: 297
|
I can't think of any reason why the \n is missing in your output (although that fact is no evident from what you have pasted). But on a different note, why are you assigning that CAST and InputRoot to Environment variables just to immediately assign them to OutputRoot. From what I can see, I don't see a need for the Environment variables - it would be a waste of memory to store all that BLOB there. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jul 24, 2008 3:03 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
In doing so i am losing my data such as \n which is a gropu termiantor in my messageset. |
I've seen this before.
The XML specification says that all XML parsers must convert all linefeeds ( of any kind ) to a single UTF8 linefeed character ( 0x0A ). This rules applies even within a CData section. So if you have \n\n it gets converted to \n. If you have \r\n it gets converted to \n.
So if your source data comes from an XML document, you should only specify <LF> as your delimiter/GT/RED.
Please note: this is nothing to do with message broker - it's a feature of the XML specification. |
|
Back to top |
|
 |
chrisc |
Posted: Thu Jul 24, 2008 9:55 pm Post subject: |
|
|
Voyager
Joined: 19 Mar 2006 Posts: 77
|
You may be better off storing the blob (converting to a string, of course) in the XML rather than as text in a CDATA section. A blob cast as character gives you a nicely encoded stream of numbers and characters that won't get messed up by the parser, although of course the downside is that it isn't exactly human readable!
Another problem with CDATA (and the problem is in common with any sort of delimited data approach without escape characters) is that in the rare situation your data contains the character sequence for the end of the CDATA section, your message is cactus and you'll end up with errors. |
|
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
|
|
|
|