Avatar of Melodi Roberts
Melodi Roberts
Flag for United States of America asked on

XML with Reserved Characters - Take 2

This is actually a continuation of this question:

I’d thought I’d solved the problem using extractvalue instead of extract; however, though the results display correctly on the web, an error is thrown with Oracle forms because it still isn’t formatted properly. (e.g.  M&I MARSHALL & ILSLEY BANK)

 I am guessing that the way the web is coded strips out the reserved characters.  

Below is a portion of the XML response that I am attempting to extract the bankName from.

It seems to me that there are too many ‘amp’ strings in this.

If I run extractvalue a twice against the returned XML it works fine.

Is the problem with the XML that the third party is sending me OR is there a chance that I am maybe retrieving the raw XML incorrectly?

  <achValidateRoutingReturn xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xsi:type="ns2:string" xmlns:ns2="http://www.w3.org/2001/XMLSchema">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;WsResponse InvokedMethod=&quot;achValidateRouting&quot;&gt;
    &lt;BankName&gt;M&amp;amp;amp;I MARSHALL &amp;amp;amp; ILSLEY BANK&lt;/BankName&gt;
    &lt;BankAddr1&gt;4701 W SCHROEDOR DR&lt;/BankAddr1&gt;
    &lt;BankAddr2&gt;MILWAUKEE,WI 53223&lt;/BankAddr2&gt;
XMLOracle Database

Avatar of undefined
Last Comment
Melodi Roberts

8/22/2022 - Mon
slightwv (䄆 Netminder)

The XML you posted looks fine to me.

The problem you describe sounds like double encoding.

So "MARSHALL &amp; ILSLEY" gets encoded twice and becomes "MARSHALL &amp;amp; ILSLEY "

It could be how you are retrieving the XML.  Check the raw data in the table.  If it is not double encoded then something is doing it after it is retrieved from the database.
slightwv (䄆 Netminder)

>>The XML you posted looks fine to me.

Forget I said that.  I see it now.

Looks like the string is actually tripple encoded.  You need to figure out what is causing that.

I'm afraid our ability to help you troubleshoot this will be limited unless you can post code/examples (before and after)/etc... to help us, help you, figure it out.
slightwv (䄆 Netminder)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Melodi Roberts

ok.  Thanks. I will post the code that I am using to retrieve the XML from the third party shortly.  
I keep thinking that it is the third party that is doing the encoding, but it sounds like you're saying that somewhere in my code in retrieving the XML from the third party I may be encoding it again.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Melodi Roberts

Attached is the sample code.
I will start digging to understand where the encoding is occurring.
Thanks for your help.
slightwv (䄆 Netminder)

Unfortunately I don't have to time to walk through all that code to see where it is happening.

You'll just need to roll up the sleeves and start digging.
Melodi Roberts

yup. No problem. Already digging. From your help I know what I need to learn more about and where to look in the code. Thanks  a ton.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.