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 » Generating XML Encoded messages

Post new topic  Reply to topic
 Generating XML Encoded messages « View previous topic :: View next topic » 
Author Message
sridhsri
PostPosted: Fri Aug 08, 2008 11:30 am    Post subject: Generating XML Encoded messages Reply with quote

Master

Joined: 19 Jun 2008
Posts: 297

This is a subject that has been discussed before. But I didn't find a definitive answer.

I have a MRM-TDS (CVS) message coming in. I also have a XSD which this TDS will get mapped to. I use a mapping node to generate the XML. I found two problems

1) The incoming CVS has string with '&'. These get copied as-is to XML i.e., they are not encoded to &. After the mapping node, I am using a RCD node to reset it to XMLNSC (It was XMLNSC to begin with in the mapping). I put this in to set options like (Build Tree using XML Schema Data Types). That still didn't encode the XML.

2) The XMLNSC parser is not creating the XML processing instruction (<?xml verions="1.0"?>). This gets created only if I use MRM-XML. Is there any way the XMLNSC parser can create this for me ?
Back to top
View user's profile Send private message
sridhsri
PostPosted: Fri Aug 08, 2008 11:36 am    Post subject: Reply with quote

Master

Joined: 19 Jun 2008
Posts: 297

P.S - I'd prefer want to write ESQL code for this.
Back to top
View user's profile Send private message
sridhsri
PostPosted: Fri Aug 08, 2008 1:39 pm    Post subject: Reply with quote

Master

Joined: 19 Jun 2008
Posts: 297

d'oh - I'd prefer NOT to write ESQL for this.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Aug 08, 2008 2:52 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
The incoming CVS has string with '&'. These get copied as-is to XML i.e., they are not encoded to &amp;.
The XMLNSC parser should replace & with &amp; when it writes the output message. This is done for all text content of elements. Are you saying that the output XML contains un-translated & characters? If you still have a problem, please include an extract from the output message in your reply.
Quote:
After the mapping node, I am using a RCD node to reset it to XMLNSC (It was XMLNSC to begin with in the mapping). I put this in to set options like (Build Tree using XML Schema Data Types). That still didn't encode the XML.

- The XMLNSC parser options affect parsing. They are not used at all when writing
- Please read the docs and make sure that you understand what 'Build tree using XML schema' is for.
Quote:
The XMLNSC parser is not creating the XML processing instruction (<?xml verions="1.0"?>). This gets created only if I use MRM-XML. Is there any way the XMLNSC parser can create this for me ?
The XMLNSC parser does not use any of the information in the XML physical format. That may change in a future release ( that is not a promise, or even a hint ) but in v6.1 you need to write ESQL or else write map statements to create the XML declaration structure in the output tree.
Back to top
View user's profile Send private message
sridhsri
PostPosted: Sat Aug 09, 2008 10:34 am    Post subject: Reply with quote

Master

Joined: 19 Jun 2008
Posts: 297

Thanks for the reply Tim. Here is a sample from the output message

<PRODUCT_GROUP docNo="19">
<CRUD>P</CRUD>
<GROUP_CODE>DT </GROUP_CODE>
<GROUP_NAME>DIAGN & THERAPY </GROUP_NAME>
<GROUP_DESCRIPTION>DIAGN & THERAPY </GROUP_DESCRIPTION>
</PRODUCT_GROUP>


Like I said before the incoming message is TDS (although each element is fixed length). We are using a mapping node to map from TDS to XML.

I must also mention that I am unable to reproduce this error with a sample message flow. Somehow it appears that with this message, the XML Encoding is not being enforced.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Aug 12, 2008 1:06 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Solved! XMLNSC was doing the right thing all along. sridhsri was using RFHUtil to view the output message. The XML viewer in RFHUtil decodes the character entity &amp; and turns it back into &. So it looked as if XMLNSC was not encoding the &.
A very forgivable mistake. I am posting this in case somebody else gets bitten in the same way.
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 » Generating XML Encoded messages
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.