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 » binary text in xml cause parser failure, how to cope?

Post new topic  Reply to topic
 binary text in xml cause parser failure, how to cope? « View previous topic :: View next topic » 
Author Message
pcelari
PostPosted: Wed Dec 16, 2009 12:25 pm    Post subject: binary text in xml cause parser failure, how to cope? Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

I have a set of aggregated flows. each flow get result from a stored procedure in different database. when all are done, the fan-in flow combines them all to create a aggregated result tree.

Recently I noticed failure in the fan-in flow upon retrieving a message from one of the sub result tree. A closer look shows the failure is due to the resultset text containing one binary character 'Â', probably accidentally typed in by a user.

When I assign the resultset to a XML tree, I got no complain in the flow putting the msg to the output queue.

How should I cope with such situation?

Is there anything I can do in my upstream processing flow to prevent binary characters from being included in the xml output content? Is this the right thing to do?

Or how can I make the fan-in flow to tolerate binary content in the XML tree during parsing?


_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Dec 16, 2009 2:31 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 it is binary? Could it not be a valid character in a different characterset? Perhaps the app that is sending it uses a different default character set (CCSID)? What does the info in the MQMD that relates to this message say?

you could probably parse exach field with a regexp to filter out invalid chars but it might not be possible and it is a case of GIGO and if it is rare enough, it might not be financially viable to code for this situation.
_________________
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
pcelari
PostPosted: Thu Dec 17, 2009 7:13 am    Post subject: Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

thanks for responding!

yes, the parser exception complaint about "Invalid character (unicode: 0x1D)."

apparently, this should have been filtered out by the data entry application. But it wasn't. Now I'll have to deal with it.

You're probably right that it isn't a viable solution to filter it out with ESQL. I just want to prevent parser from failing.

So, the question becomes: Is it possible for a XML tree to contain BLOB as content?


_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Dec 17, 2009 8:12 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.

It is possible for XML to contain a BLOB. I have used the xs:Base64Binary datatype in the message model.
_________________
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: Thu Dec 17, 2009 9:40 am    Post subject: Reply with quote

Grand High Poobah

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

pcelari wrote:
So, the question becomes: Is it possible for a XML tree to contain BLOB as content?


CDATA?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Dec 17, 2009 10:22 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.

Vitor wrote:
pcelari wrote:
So, the question becomes: Is it possible for a XML tree to contain BLOB as content?


CDATA?


IIRC, XML in a CDATA section is parsed as being valid. I think it was discussed here a long time ago. Otherwise, a BLOB is a BLOB is a BLOB and is ignored by the xml (of whichever flavour you use) parser.
_________________
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
kimbert
PostPosted: Thu Dec 17, 2009 2:48 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

A CData section allows you to put the < and " characters (and others) into the content of a tag without escaping them using &lt; and &quot;
All the characters in the content of the CData section must still be valid XML characters, so CData is not the solution to pcelari's problem.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Dec 17, 2009 3:01 pm    Post subject: Reply with quote

Grand High Poobah

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


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Dec 17, 2009 3:02 pm    Post subject: Reply with quote

Grand High Poobah

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


_________________
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 » binary text in xml cause parser failure, how to cope?
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.