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 » Globally replace '&'s in XML using WMB (ESQL)

Post new topic  Reply to topic
 Globally replace '&'s in XML using WMB (ESQL) « View previous topic :: View next topic » 
Author Message
jeasterl
PostPosted: Tue Jun 08, 2010 12:49 pm    Post subject: Globally replace '&'s in XML using WMB (ESQL) Reply with quote

Acolyte

Joined: 24 Jun 2001
Posts: 65

One of our interfaces is receiving a message that contains the '&' character, similar to the mesage below:

Quote:
<?xml version="1.0"?>
<WPS_INVC_PROCESS>
<MESSAGE_GROUP>0000001065</MESSAGE_GROUP>
<MESSAGE_ID>0000078412</MESSAGE_ID>
<VCHR_HDR_EC><BUSINESS_UNIT>MIUI</BUSINESS_UNIT>
<GROSS_AMT>98.16</GROSS_AMT><INVOICE_DT>06/08/2010</INVOICE_DT>
<INVOICE_ID>5024518</INVOICE_ID><ORIGIN>CUS</ORIGIN>
<PYMNT_TERMS_CD>NOW</PYMNT_TERMS_CD>
<VCHR_LINE_EC><BUSINESS_UNIT>MIUI</BUSINESS_UNIT>
<DESCR>Inactive Acct Credit Refund</DESCR>
<MERCHANDISE_AMT>98.16</MERCHANDISE_AMT>
<VOUCHER_LINE_NUM>000000001</VOUCHER_LINE_NUM>
</VCHR_LINE_EC><VCHR_ONE_TIME_VENDOR_EC>
<ADDRESS1>PROFIT SHARING PLAN & TRUST</ADDRESS1>
<ADDRESS2>2695 LAWRENCE AVE</ADDRESS2>
<CITY>STEVENSVILLE</CITY>
<NAME1> PHILLIP S MERKEL EMPLOYEES</NAME1>
<POSTAL>49127</POSTAL><STATE>MI</STATE>
</VCHR_ONE_TIME_VENDOR_EC>
<VCHR_PYMT_EC><BUSINESS_UNIT>MIUI</BUSINESS_UNIT>
<PYMNT_GROSS_AMT>98.16</PYMNT_GROSS_AMT>
<PYMNT_MESSAGE>Inactive Acct Credit Refund</PYMNT_MESSAGE>
</VCHR_PYMT_EC>
</VCHR_HDR_EC>
</WPS_INVC_PROCESS>


However, the receiving end cannot handle the '&' character. How would I go about coding ESQL to remove the character on any incoming XML messge?
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jun 08, 2010 12:59 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
However, the receiving end cannot handle the '&' character. How would I go about coding ESQL to remove the character on any incoming XML messge?
This is almost a duplicate of this thread, which is being actively discussed right now: http://www.mqseries.net/phpBB2/viewtopic.php?t=53960
The answer is the same: the sender is generating badly-formed XML, and you should ask them to fix their application.

If you *really* need to fix up the message, you can easily do it using ESQL or Java. Just parse the message as a BLOB, convert the BLOB to a character string, fix up the string and then re-parse.
Back to top
View user's profile Send private message
Gaya3
PostPosted: Tue Jun 08, 2010 1:01 pm    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

if you are looking for globally replacing it..take the input as BLOB and do the string manipulation.
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Tue Jun 08, 2010 10:16 pm    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

Gaya3 wrote:
if you are looking for globally replacing it..take the input as BLOB and do the string manipulation.


But dont just blindly replace &'s though as some may be valid.

I'd take kimberts approach where possible and get them to send valid XML!
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 » Globally replace '&'s in XML using WMB (ESQL)
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.