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 » Error While Parsing

Post new topic  Reply to topic Goto page 1, 2  Next
 Error While Parsing « View previous topic :: View next topic » 
Author Message
gag_nm
PostPosted: Tue Jan 26, 2010 11:31 pm    Post subject: Error While Parsing Reply with quote

Centurion

Joined: 16 Oct 2008
Posts: 102

Hi,

can some please help ,

In Request message we have below tag and value as given with in tag.

<Request>
<ID>E4560</ID>
<Name>NAGARDAS MANJI & CO</Name>
</Request>

at MqInput Node ,values are given below under InputMessage Parser Options

Message domain is MRM
Message Format is XML1
MessageSet : MsgFromClientMsgS (EBB14IK002001)

Input Message is failing at node and routing to Failure Terminal.

Issue is at Input Node Parser is Failing because of " & ", and giving below
error Message

<Name>NAGARDAS MANJI & CO</Name>

I searched for this exception in google and found that space&space(" & ")
will be treated as special character by Parser.

can you please give me some suggestion to solve this issue from broker end.
because lot of Customer Names has " & " in their Name Tag.



----------------------------------
EXCEPTION
----------------------------------
ExceptionList
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbDataFlowNode.cpp
Line:INTEGER:957
Function:CHARACTER:ImbDataFlowNode::createExceptionList
Type:CHARACTER:ComIbmMQInputNode
Name:CHARACTER:XMLTOMRMMsgFlow#FCMComposite_1_1
Label:CHARACTER:XMLTOMRMMsgFlow.MQInput
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Node throwing exception
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbTraceNode.cpp
Line:INTEGER:341
Function:CHARACTER:ImbTraceNode::evaluate
Type:CHARACTER:ComIbmTraceNode
Name:CHARACTER:XMLTOMRMMsgFlow#FCMComposite_1_4
Label:CHARACTER:XMLTOMRMMsgFlow.Trace
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Caught exception and rethrowing
ParserException
File:CHARACTER:F:\build\S610_P\src\MTI\MTIforBroker\MtiImbParser2\MtiImbParser.cpp
Line:INTEGER:730
Function:CHARACTER:MtiImbParser::parseRightSibling
Type:CHARACTER:ComIbmMQInputNode
Name:CHARACTER:XMLTOMRMMsgFlow#FCMComposite_1_1
Label:CHARACTER:XMLTOMRMMsgFlow.MQInput
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:5285
Text:CHARACTER:ImbRecoverableException caught from
worker->parseNext.
Insert
Type:INTEGER:5
Text:CHARACTER:XMLTOMRMMsgSet
Insert
Type:INTEGER:2
Text:CHARACTER:1
Insert
Type:INTEGER:5
Text:CHARACTER:XML1
Insert
Type:INTEGER:5
Text:CHARACTER:/Request/Name
ParserException
File:CHARACTER:F:\build\S610_P\src\cpi\pwf\xml\xmlhandler.cpp
Line:INTEGER:1349
Function:CHARACTER:XMLHandler::error
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:5117
Text:CHARACTER:XMLHandler::error reported from the Xerces parser
Insert
Type:INTEGER:2
Text:CHARACTER:226
Insert
Type:INTEGER:5
Text:CHARACTER:Null pointer
Insert
Type:INTEGER:2
Text:CHARACTER:3
Insert
Type:INTEGER:2
Text:CHARACTER:14
Insert
Type:INTEGER:5
Text:CHARACTER:Expected entity name for reference
Insert
Type:INTEGER:5
Text:CHARACTER:Request
Insert
Type:INTEGER:5
Text:CHARACTER:Name
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Tue Jan 26, 2010 11:48 pm    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

Escape the & character as required by the XML spec
Back to top
View user's profile Send private message
exerk
PostPosted: Tue Jan 26, 2010 11:55 pm    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

Moved to the Broker forum...
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
gag_nm
PostPosted: Tue Jan 26, 2010 11:57 pm    Post subject: Reply with quote

Centurion

Joined: 16 Oct 2008
Posts: 102

Thanks for your Reply,

U want me to remove " & " in tag <Name>NAGARDAS MANJI & CO</Name>

before reaching Broker.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jan 27, 2010 12:08 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Why are you using MRM XML? Which version of the runtime are you using?

The input message is not well-formed XML. You should speak to the provider of the input message and ask them to escape any '<' and '&' characters which occur within attribute and tag values.
Back to top
View user's profile Send private message
gag_nm
PostPosted: Wed Jan 27, 2010 12:16 am    Post subject: Reply with quote

Centurion

Joined: 16 Oct 2008
Posts: 102

Iam using Broker 6.1.0.5

we are using MRM Messsage domain to validate input message against Respective Message Set(to validate length of value)
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jan 27, 2010 12:47 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
we are using MRM Messsage domain to validate input message against Respective Message Set(to validate length of value)

It is almost always a bad idea to use MRM XML for new message flows. Have you read this?
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/ad70530_.htm
and this?
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/ad21074_.htm

Using XMLNSC will not fix your problem with the & characters - that's a problem for the provider of the input message.
Back to top
View user's profile Send private message
gag_nm
PostPosted: Wed Jan 27, 2010 1:32 am    Post subject: Reply with quote

Centurion

Joined: 16 Oct 2008
Posts: 102

thanks for your Reply kimbert.

this Message Flows were developed long time back in Version 5, after that we migrated to next higher Versions with same MRM XML.

that is the reason we are using the same flows.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jan 27, 2010 5:09 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

To be clear.

The & in the XML document makes it an illegal XML document. Regardless of what parser you use.

It's bad data. The sender is doing the wrong thing.

You should spend the time *now* to migrate your flows to use XMLNSC instead of MRM. Every time you change any one of your flows, you should do this migration as well.

It will save you time and money because it WILL give you a HUGE performance improvement.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jan 27, 2010 4:13 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
can you please give me some suggestion to solve this issue from broker end
Not really. Not a good suggestion, anyway. You would need to write some ESQL or Java which would understand the structure of the XML. Then, within each tag or attribute value, you would need to detect all &'s which are not intended to be XML character refs/entities and replace them with &amp;.
In other words, you would need to write a custom XML-like parser in Java/ESQL.
Back to top
View user's profile Send private message
francoisvdm
PostPosted: Wed Jan 27, 2010 9:57 pm    Post subject: Reply with quote

Partisan

Joined: 09 Aug 2001
Posts: 332

The reality of the world is that not all source systems are willing to change or are easy to change. If you need to fix it from the brokewr side, read the message in as a blob, search for the offending characters, replace it with the escaped versions, then parse again. Yes, this is not the best, yes it will make your system slower and all the bad things said in this thread... but hey, sometimes it is the only way.
_________________
If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.

Francois van der Merwe
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Wed Jan 27, 2010 11: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.

francoisvdm wrote:
The reality of the world is that not all source systems are willing to change or are easy to change.


Those of us who have been around long enough know this only two well.
I've been in a situation where you go back to the vendor and tell them
"You are sending us invalid XML". You explain the problem and even give them a series of links to the XML standard.
They just sit there and say, "My guys say you are wrong. This is how they have always formatted the data".

Then you get that sinking feeling that somehow you have become part of a Dilbert strip and its your PHB saying that.

Reminds me of a bit of code in the DEC Ultrix (modded BSD 4.2) kernel. There is a comment that goes like:-
/* If you reach this point you are in deep dodo. There is no escape from here. */
HALT;
_________________
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 Jan 28, 2010 12:24 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
The reality of the world is that not all source systems are willing to change or are easy to change.
Point taken. But gag_nm has not given us any information about that (yet). So I'm recommending the correct technical solution until he comes back and tells us that it is not viable.
It's a fact that some developers are too quick to try and fix the problem when it really should and could be fixed elsewhere.
Quote:
If you need to fix it from the brokewr side, read the message in as a blob, search for the offending characters, replace it with the escaped versions, then parse again.
I agree - that is one alternative solution. But it will be tricky to distinguish the 'offending' &'s from perfectly legal ones.
Example: What should gag_nm do if there is an un-escaped & within a CData section?
Back to top
View user's profile Send private message
gag_nm
PostPosted: Fri Jan 29, 2010 7:32 am    Post subject: Reply with quote

Centurion

Joined: 16 Oct 2008
Posts: 102

Thanks for all your valuable suggestions, i apperciate for all your support.

I explained vendor we have 2 ways to solved this issue

1) send xml with out special charaters(i.e validate message at their end)
2) send xml in charater stream data format,which our parser will accept even "&" special charaters .

He has agreed to validate xml message and remove special charaters from his end.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jan 29, 2010 7:41 am    Post subject: Reply with quote

Grand High Poobah

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

gag_nm wrote:
He has agreed to validate xml message and remove special charaters from his end.


He doesn't need to remove them, though obviously that does fix the problem!

He just needs to present them correctly so the XML is well formed. In the example you supply

Code:
<Name>NAGARDAS MANJI &amp CO</Name>


will parse just fine and be resolved to "NAGARDAS MANJI & CO" as a string.

XML 101
_________________
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 Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Error While 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.