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 » Need help on XML message Parsing

Post new topic  Reply to topic
 Need help on XML message Parsing « View previous topic :: View next topic » 
Author Message
dan2WMB
PostPosted: Wed Feb 02, 2011 3:20 am    Post subject: Need help on XML message Parsing Reply with quote

Novice

Joined: 06 Aug 2010
Posts: 12

Hi,
I am using MQInput node in my message flow and having message domain as XMLNS.Generally i used to receive a valid XML message to this node and the message flow works fine.But sometimes i am receiving an invalid XML message(contains some non-ascii special character) and getting the 'XML Parsing Errors have occurred' message due to invalid character.Then i am unable to process further to process the message.

My requirement is, if i get an invalid XML message with invalid characters, i have to replace those characters with question mark(?) and then process that message.

Can anyone suggest me how to handle this requirement?
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Feb 02, 2011 3:44 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Quote:
(contains some non-ascii special character)


Oh Dear!
Ascii = American Standard for Computer Information Interchange.
So very 1970's. Yeah I was writing code then(1972 to be exact).
We prefer to talk ISO Numbers and/or Unicode these days

Do you mean that you have some non printable characters?
Can you elucidate on what you meany by invalid characters?
Are the valid from a Character Set mapping point of view?
Can you give us some examples?
_________________
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
danielrajj
PostPosted: Wed Feb 02, 2011 3:56 am    Post subject: Reply with quote

Newbie

Joined: 08 Feb 2010
Posts: 2

Yes. I have some non printable characters.

Here is one of the line i get in Exception list.I am not sure exactly what character i am receiving.

(0x01000000:Name ):Insert = (
(0x03000000:NameValue):Type = 5 (INTEGER)
(0x03000000:NameValue):Text = 'Invalid character (Unicode: 0x19) ' (CHARACTER)
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Feb 02, 2011 4:48 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Have you tried to find out what that character is?

A google will tell you all about it. It is a non printable character.(EOM). This dates back to the days of Teletypes. A start of message would have and SOM followed by one or more blocks delimited by STX/ETX (Start of Text/End of Text) then finished with an EOM. Well, that's how I remember it from my days of writing an ASR-33 Handler circa 1974.

My guess is that you are actually receiving XML with an invalid structure OR that the message CCSID does not match that of the Data(pretty common as well)
As has been said many times before in this forum, Broker Can't fix broken XML.
Please go back to the sender and sort it out with them
_________________
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
Vitor
PostPosted: Wed Feb 02, 2011 5:18 am    Post subject: Re: Need help on XML message Parsing Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

dan2WMB wrote:
Can anyone suggest me how to handle this requirement?


Tell whoever gave you the requirement it's stupid?

If the XML document does not meet the XML standard by containing unacceptable characters then it won't go through any parser. You can demonstrate this by trying to open such a document in IE or XMLSpy. If the document has hash before, after or between the tags you can strip this out with the XMLNSC parser (which you should be using anyway) but that won't help with XML which is invalid. The sender should not be transmitting an invalid XML.

The only way you might be able to deal with this is to take the data as a BLOB, produce some code to replace any character outside the XML standard with the hex for a question mark and then parse it. It's not something I would attempt.

I also question how much value the data would have to the business if the "?" happens to be at a critical location.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » Need help on XML message Parsing
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.