And I am getting DATA_OUT like
V_RESPONSE := UTL_HTTP.GET_RESPONSE (V_REQUEST); LOOP UTL_HTTP.READ_LINE (V_RESPONSE, V_BUFFER, FALSE); DATA_OUT := DATA_OUT || V_BUFFER; --DBMS_OUTPUT.PUT_LINE (V_BUFFER); END LOOP;
A dont need '&' in this output. I need to parse this variable to erase all ampersands. How can I do it ?
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ns:chargeSubscriberResponse xmlns:ns="http://ws.cube.az"><ns:return><?xml version="1.0" encoding="UTF-8"?> <response> <retval>-2200003</retval> <retmsg>Invalid Service</retmsg> <quantity></quantity> <cube-transaction-id></cube-transaction-id> </response></ns:return></ns:chargeSubscriberResponse></soapenv:Body></soapenv:Envelope>
But no luck...
PROCEDURE Clean_up_xml (v_xml IN OUT VARCHAR2) IS BEGIN WHILE INSTR (v_xml, 'lt;') > 0 LOOP v_xml := SUBSTR (v_xml, 1, INSTR (v_xml, 'lt;') - 2) || SUBSTR (v_xml, INSTR (v_xml, 'lt;') + 4); END LOOP; END;
John Stegeman wrote:Ok, got it. But how to replace '& l t ;' to '<' ? (without escape)
I think the fabulous forum software is removing them. It's <Doggone it.. forum software changing all of them I mean the sequence: ampersand-l-t-; which is the HTML escaped version of <
&lt; <<=== that's what I mean
John Stegeman wrote:Are you joking ? You think I dont know what REPLACE function does ?
Have a search of the documentation for a nice little function called "REPLACE"
Just replace doesnt work... I triedThat wasn't clear to me that you meant you tried the REPLACE() function. Touche
Khayyam wrote:REPLACE is working fine. The problem is that your front end is scanning for substitution variables. Tell it not to.
... As I said before, REPLACE doesnt work! it see ampersand as a command and asks to type a value.
In PL/SQL procedure (TOAD) doesnt work.Sorry, I don't know much about Toad. It must have ome way to say you don't want to use substitution variables, equivalent to
SET DEFINE OFF
returns a copy of str with all >, < and & characters removed. Call TRANSLATE before forming the XML.
TRANSLATE ( str , 'x><&' , 'x' )