|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Globally replace '&'s in XML using WMB (ESQL) |
« View previous topic :: View next topic » |
Author |
Message
|
jeasterl |
Posted: Tue Jun 08, 2010 12:49 pm Post subject: Globally replace '&'s in XML using WMB (ESQL) |
|
|
 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 |
|
 |
kimbert |
Posted: Tue Jun 08, 2010 12:59 pm Post subject: |
|
|
 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 |
|
 |
Gaya3 |
Posted: Tue Jun 08, 2010 1:01 pm Post subject: |
|
|
 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 |
|
 |
WMBDEV1 |
Posted: Tue Jun 08, 2010 10:16 pm Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|