Author |
Message
|
chenna.hari |
Posted: Thu Aug 19, 2010 9:12 am Post subject: An XML parsing error has occurred while parsing the XML |
|
|
Centurion
Joined: 21 Mar 2009 Posts: 103
|
We have a requirement to transform/validate the xml in message broker 7. but the below error came.
Caught exception and rethrowing. Error detected, rethrowing. XML Parsing Errors have occurred. An XML parsing error has occurred while parsing the XML document.
Cause of Error is Character reference "" is an invalid XML character..
Can any help how resolve this error |
|
Back to top |
|
 |
Vitor |
Posted: Thu Aug 19, 2010 9:26 am Post subject: Re: An XML parsing error has occurred while parsing the XML |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
chenna.hari wrote: |
Can any help how resolve this error |
Tell whoever's sending the message to only send valid XML.
The W3C standard contains rules about what characters can & cannot be in an XML document, and rules for their use. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
chenna.hari |
Posted: Fri Aug 20, 2010 1:41 am Post subject: |
|
|
Centurion
Joined: 21 Mar 2009 Posts: 103
|
ok.
But is there any way to parse and pass this type of character in messagebroker??? |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Aug 20, 2010 3:53 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Quote: |
But is there any way to parse and pass this type of character in messagebroker??? |
Yes but it is extremely messy and must be regarded as the last resort.
It involves manipulating an unparsed message (ie the BLOB) but even this may not work.
It is far easier to get the sender to send correct XML.
If they don't know how, then point them at the w3c site. Tell them exactly what is wroing with their message.
They sent it. IT is their responsibility ot make it right. GIGO rules ok! _________________ 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 |
|
 |
Vitor |
Posted: Fri Aug 20, 2010 4:02 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
chenna.hari wrote: |
But is there any way to parse and pass this type of character in messagebroker??? |
No. If it's not valid XML it won't parse in an XML parser. Try displaying the document in XMLSpy or Internet Explorer and you'll see what I mean.
If you want to "fix" the message you'll need to read it into WMB as a stream of data, then write custom code to try and weed out the invalid characters & rebuild the document as well formed XML. If you achieve this then you might get the document to parse but you'll never know if you've changed the meaning of it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|