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 » How to handle an invalid XML character (Unicode: 0x0)

Post new topic  Reply to topic
 How to handle an invalid XML character (Unicode: 0x0) « View previous topic :: View next topic » 
Author Message
siddique20
PostPosted: Thu Jun 25, 2015 9:34 pm    Post subject: How to handle an invalid XML character (Unicode: 0x0) Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Thu Jun 25, 2015 10:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Jun 26, 2015 5:51 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to handle an invalid XML character (Unicode: 0x0)
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.