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 » & to & conversion in message broker7

Post new topic  Reply to topic
 & to & conversion in message broker7 « View previous topic :: View next topic » 
Author Message
yshakraj
PostPosted: Tue Feb 07, 2012 5:29 am    Post subject: & to & conversion in message broker7 Reply with quote

Voyager

Joined: 14 Sep 2011
Posts: 91

Hi ,
I am having problem to convert the & symbol to & in message broker .

I have an xml file which have one tag ,having value "something &something " .when i tried to pass through an mqinput node ,with domain xmlnsc ,i am getting parse error.

if there any way to convert this,also to convert the special characters like "<" ,">" which may come in xml and create the same issue .

is there any way to do other than handling it in esql .

Thanks in advance ,
Vyshak
Back to top
View user's profile Send private message
adubya
PostPosted: Tue Feb 07, 2012 5:35 am    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

&,<,> are not legitimate content in XML so the parser rightly complains. Either escape such data correctly or use CDATA if you're looking to pass XML as content.

Basically, your input is invalid XML.
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Feb 07, 2012 6:00 am    Post subject: Re: & to &amp; conversion in message broker7 Reply with quote

Grand High Poobah

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

yshakraj wrote:
when i tried to pass through an mqinput node ,with domain xmlnsc ,i am getting parse error.


That's because the document is not well formed and can't be parsed. Try opening it with IE or XMLSpy & see what happens.

yshakraj wrote:
if there any way to convert this,also to convert the special characters like "<" ,">" which may come in xml and create the same issue .


Yes because they're not allowed to appear in XML any more than "&" is. All such characters should have been escaped (&amp; &lt; etc) before it reaches you.

yshakraj wrote:
is there any way to do other than handling it in esql .


Yes. Get whoever's sending the file to send well-formed XML not just a string with lots of "<' and '>' in it.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
yshakraj
PostPosted: Tue Feb 07, 2012 6:05 am    Post subject: Reply with quote

Voyager

Joined: 14 Sep 2011
Posts: 91

Thanks for the response, i agree with you that is not the valid xml values how ever how can i get escaped such things in mb ,do we have any option to do that , and how to solve this with cdata .
Back to top
View user's profile Send private message
yshakraj
PostPosted: Tue Feb 07, 2012 6:28 am    Post subject: Reply with quote

Voyager

Joined: 14 Sep 2011
Posts: 91

thanks vitor , so the way out is to get the wellformed xml,i will check with them . thanks all .
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Feb 07, 2012 6:47 am    Post subject: Reply with quote

Grand High Poobah

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

yshakraj wrote:
how to solve this with cdata .


You can't solve this with CDATA. Those values cannot appear unescaped in an XML document, even in a CDATA section.

Your only option (I hestiate to call it an option) is to have them base64encode the file and decode it your end. It would be much, much easier for everyone including them to just fix the XML so it's well formed.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
adubya
PostPosted: Tue Feb 07, 2012 6:54 am    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

Vitor wrote:
You can't solve this with CDATA. Those values cannot appear unescaped in an XML document, even in a CDATA section..


I didn't think this was the case.

http://www.w3.org/TR/REC-xml/#sec-cdata-sect
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Feb 07, 2012 6:58 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

adubya wrote:
Vitor wrote:
You can't solve this with CDATA. Those values cannot appear unescaped in an XML document, even in a CDATA section..


I didn't think this was the case.

http://www.w3.org/TR/REC-xml/#sec-cdata-sect


Regardless, the sending app still needs to be modified to set the CDATA section around the bad characters.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Feb 07, 2012 7:02 am    Post subject: Reply with quote

Grand High Poobah

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

adubya wrote:
Vitor wrote:
You can't solve this with CDATA. Those values cannot appear unescaped in an XML document, even in a CDATA section..


I didn't think this was the case.

http://www.w3.org/TR/REC-xml/#sec-cdata-sect


There's some problem with markup in a CDATA section
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
adubya
PostPosted: Tue Feb 07, 2012 7:04 am    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

Vitor wrote:
adubya wrote:
Vitor wrote:
You can't solve this with CDATA. Those values cannot appear unescaped in an XML document, even in a CDATA section..


I didn't think this was the case.

http://www.w3.org/TR/REC-xml/#sec-cdata-sect


There's some problem with markup in a CDATA section


Yes, use of the end of CDATA tag ]]> and the CDATA element name itself as CDATA sections can't be nested.
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Tue Feb 07, 2012 7:29 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
There's some problem with markup in a CDATA section
Yes, there can be. But the more usual problem is that people expect CDATA to make *everything* safe - and then they use it to wrap up badly-formed XML ( such as in an error report ). The problem is that CDATA doesn't allow illegal characters like NUL and other low-valued characters. But that's a very common type of badly-formedness ( I made up a new noun there ).
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Feb 07, 2012 8:33 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.

kimbert wrote:
Quote:
There's some problem with markup in a CDATA section
Yes, there can be. But the more usual problem is that people expect CDATA to make *everything* safe - and then they use it to wrap up badly-formed XML ( such as in an error report ). The problem is that CDATA doesn't allow illegal characters like NUL and other low-valued characters. But that's a very common type of badly-formedness ( I made up a new noun there ).


Shouldn't that be 'malformed'?

IMHO, the only way to guarantee that you can report 'malformed' XML in an XML structure is for the bad stuff to be encoded into a BLOB using the...

Wait for it


Wait for it....


ASBITSTREAM function.

Not exactly user friendly but you have preserved the data so that the original error is not masked/hidden.
_________________
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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » & to &amp; conversion in message broker7
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.