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 » Problems with escaped characters

Post new topic  Reply to topic
 Problems with escaped characters « View previous topic :: View next topic » 
Author Message
jfluitsm
PostPosted: Wed May 15, 2002 6:40 am    Post subject: Problems with escaped characters Reply with quote

Disciple

Joined: 24 Feb 2002
Posts: 160
Location: The Netherlands

We have a problem with escaped characters in XML.
Escaped characters in an input XML-message are translated to their character representation in the broker without any problem.
In the output XML message however these are still the character representation instead of being escaped again.
As this is invalid XML the receiving applications fails when trying to parse the message.

Do I something wrong or is this a bug in the parser?
_________________
Jan Fluitsma

IBM Certified Solution Designer WebSphere MQ V6
IBM Certified Solution Developer WebSphere Message Broker V6
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Wed May 15, 2002 5:40 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Jan,

Posting an example input/output message with ESQL code in compute node would be helpful in debugging the problem.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
jfluitsm
PostPosted: Wed May 15, 2002 10:59 pm    Post subject: Reply with quote

Disciple

Joined: 24 Feb 2002
Posts: 160
Location: The Netherlands

Kiran,

Here the example.

MQInput(XML) -> Compute -> MQOutput

In Compute node:
set OutputRoot.XML.Message.NewData = InputBody.Message.Data;

Input XML:
<Message><Data>Test-&#199</Data></Message>

Output XML:
<Message><NewData>Test-Ç</NewData></Message>

The Ç is not allowed in XML and should be &#199.
Back to top
View user's profile Send private message Send e-mail
Segs
PostPosted: Thu May 16, 2002 6:17 am    Post subject: Reply with quote

Voyager

Joined: 04 Oct 2001
Posts: 78
Location: Zurich Financial Services

Try using the elementasis function, I've had quite a few problems trying to achieve simliar functionality.
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Thu May 16, 2002 7:28 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Jan,
try this,
Set OutputRoot.XML.(XML.Element)Message.(XML.Element)NewData.(XML.AsisElementContent) = InputBody.Message.Data;
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
jfluitsm
PostPosted: Mon Aug 26, 2002 7:28 am    Post subject: Reply with quote

Disciple

Joined: 24 Feb 2002
Posts: 160
Location: The Netherlands

Excuses for the late reply, more pressing problems prevented me to work on this one.

The problem is solved and was all in the CCSID's. Before going into detail first some warnings.

***WARNING***
1) When a xml-message is parsed by a commercial parser make sure to use the correct CCSID in the put and get of the message, mostly this will be 1208 (UTF-8).
2) When creating a test message with a windows-editor (like notepad), (a) make sure to put the message on the queue with CCSID 1252 as this is the characterset in which the message is stored on disk, CCSID 437 or 850 (or any other depending on the locale settings) are only used for the keyboard, (b) make sure to use only characters that excists in CCSID 1252 (no box-drawing characters) or (c) store the message as unicode, use CCSID 1200 (UCS-2) and only use the UCS-2 compatible unicode characters (MQSIPUT can't handle unicode files).
***END WARNING***

We had problems with special characters in combination with legacy messages and xml message (legacy to xml and vv) jumping into the conclusion that spacial characters aren't allowed in xml and should be escaped.
As stated before the problem wasn't xml or WMQI, it was all in used CCSID's.

The xml-messages were written and parsed using a commerial available xml-writer/parser (Lotus Notes), these messages are in or expected to be in UTF-8 (CCSID 1208), but they were put on and gotten from the queue with CCSID 437 or 850, so either the character conversion made a mess of the message (xml in), or the xml-parser couldn't understand the contents (xml out). Using the correct CCSID's solved the problem.

I would have discoverd this earlier if there wasn't a simular problem with the test messages for MQSIPUT, these were also put to the queue with CCSID 437, the special characters were enterd into the file with alt+nnn, the correct number for the character in CCSID 437. What I didn't know then is that the files made with a windows editor like notepad are stored in CCSID 1252 (alt+128 = 0x80 in 437 is stored on disc as 0xC7 in 1252, which is the correct character), so also these messages were put with the wrong CCSID.

Thnx for the reactions.
_________________
Jan Fluitsma

IBM Certified Solution Designer WebSphere MQ V6
IBM Certified Solution Developer WebSphere Message Broker V6
Back to top
View user's profile Send private message Send e-mail
lung
PostPosted: Tue Aug 27, 2002 1:50 am    Post subject: Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

Is there a list somewhere that lists down all these special characters together with their escapes?

Thanks.
_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
miron
PostPosted: Tue Aug 27, 2002 3:07 am    Post subject: Reply with quote

Apprentice

Joined: 27 Jun 2002
Posts: 39
Location: New York

There are 5 predefined entity references in XML:

&lt; < less than

&gt; > greater than

&amp; & ampersand

&apos; ' apostrophe

&quot; " quotation mark

Entity references always start with the "&" character and end with the ";" character.

Note: Only the characters "<" and "&" are strictly illegal in XML. Apostrophes, quotation marks and greater than signs are legal, but it is a good habit to replace them.
http://www.w3schools.com/xml/xml_cdata.asp
Back to top
View user's profile Send private message
lung
PostPosted: Tue Aug 27, 2002 4:47 pm    Post subject: Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

Thanks!


_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
lung
PostPosted: Tue Aug 27, 2002 4:47 pm    Post subject: Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

Thanks!


_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problems with escaped characters
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.