|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to handle an invalid XML character (Unicode: 0x0) |
« View previous topic :: View next topic » |
Author |
Message
|
siddique20 |
Posted: Thu Jun 25, 2015 9:34 pm Post subject: How to handle an invalid XML character (Unicode: 0x0) |
|
|
Novice
Joined: 03 Jul 2014 Posts: 13
|
Hi every one,
I have stuck in a problem and didn't find solution anywhere.
I'm reading a data set from oracle where a CHAR field 'ACCT_TYPE' contains some invalid xml character like 'MTGNULNULNULNULNULNUL' and these 'NUL's are not visible in notepad but Nodepad++
Code: |
SET V_ACTTYPE = Environment.ResultSet[n].ACCT_TYPE;
SET OutputRoot.XMLNSC.sp1:IFX.BankSvcRs.sp1:GetPaymentInquiryRs.Response[I].AccountType = V_ACTTYPE;
|
this cause following exception
Quote: |
An invalid XML character (Unicode: 0x0) was found in the element content of the document |
I tried following technique but it didn't worked.
Code: |
SET blobMsgTemp = ASBITSTREAM(Environment.ResultSet[I].ACCT_TYPE,546,437);
SET blobMsgTemp= REPLACE(blobMsgTemp, x'00', x'20');
SET V_ACTTYPE = CAST(blobMsgTemp as char CCSID 1208 Encoding 815);
|
but this generate empty value in V_ACTYPE
Is there anybody who can help us to resolve this issue ?
Thanks,
Siddique |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Jun 25, 2015 10:46 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Are you sure that the data being read from Oracle is in CCSID 437?
Have you used the debugger or usertrace to see what exactly is going on with your ESQL?
Which line of the ESQL is failing?
Changing your code to something like this may well show where the esql is failing
Code: |
declare defBlob BLOB X'AA';
SET blobMsgTemp = coalesce(ASBITSTREAM(Environment.ResultSet[I].ACCT_TYPE,546,437), defBlob);
SET blobMsgTemp= REPLACE(blobMsgTemp, x'00', x'20');
SET V_ACTTYPE = coalesce(CAST(blobMsgTemp as char CCSID 1208 Encoding 815),'BB');
|
_________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jun 26, 2015 5:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Are you by any chance trying to handle an ATM code in an XML field?
If yes it should be hex encoded and you would need to parse it separately as DFDL...  _________________ MQ & Broker admin |
|
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
|
|
|
|