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 » File Output node problem

Post new topic  Reply to topic
 File Output node problem « View previous topic :: View next topic » 
Author Message
next
PostPosted: Fri Jul 22, 2011 2:34 am    Post subject: File Output node problem Reply with quote

Voyager

Joined: 02 May 2010
Posts: 75

Hi,

I am writing XML messages to a file using file output node. The broker is running in unix.

The node is replacing the special chars like &, <, > with &amp; &lt; &gt;

I have not changed anythinn in the input Encoding or CCSID. Could anyone please let me know what needs to be done?
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jul 22, 2011 4:37 am    Post subject: Re: File Output node problem Reply with quote

Grand High Poobah

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

next wrote:
Could anyone please let me know what needs to be done?


Providing this replacement is happening inside a tag, tell whoever's complaining to read the XML specification!

If you're getting:

Code:
&ltProfit&gtUSD10000&lt/Profit&gt


then something odd is going on and you've got a problem.

If (as I suspect) you're getting:

Code:
<CompanyName>Scrooge &amp Marley</CompanyName>


when you expected

Code:
<CompanyName>Scrooge & Marley</CompanyName>


then it's working as designed.

XML special characters <,>,& are not allowed in data by the W3C XML speciification. They have to be escaped as WMB is doing. If you read the XML back with any W3C compliant parser, the value will appear in your application as a string "Scrooge & Marley" just as you expect.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
next
PostPosted: Fri Jul 22, 2011 6:07 am    Post subject: Reply with quote

Voyager

Joined: 02 May 2010
Posts: 75

Yes you got it clearly. I am getting the special chars in the field value.

But the target application which is processing the files is not ok with this. I will have to check how they parse the data.

But is there a way to prevent this while writing the message to the file ?
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jul 22, 2011 6:15 am    Post subject: Reply with quote

Grand High Poobah

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

next wrote:
I will have to check how they parse the data.


I suspect they're produced their own parser / file reading mechanism that doesn't conform to the W3C specification.

(That's what's happened every time someone's complained to me about this problem)

next wrote:
But is there a way to prevent this while writing the message to the file ?


No. XML containing this:

Code:
<CompanyName>Scrooge & Marley</CompanyName>


is not well-formed and WMB will not produce badly formed XML. Here's a test:

Take this:

Code:

<Test>
<CompanyName>Scrooge & Marley</CompanyName>
</Test>


and paste it into an XML file. Now try to open the file with IE, XMLSpy or any other XML reading tool and see what it says. Then show that to the target application team.
_________________
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 » File Output node problem
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.