Home » Developer & Programmer » JDeveloper, Java & XML » How to extract a lengthy XML(98628 bytes) using EXTRACT. Is it possible to extract such a huge XML? (Oracle 9i)
How to extract a lengthy XML(98628 bytes) using EXTRACT. Is it possible to extract such a huge XML? [message #377627] Wed, 24 December 2008 00:11 Go to next message
ulaganathank
Messages: 2
Registered: December 2008
Location: India
Junior Member
hi,

I'm passing the request XML to webservice and getting the response XML from webservice.
After getting the response XML, I tried to extact the same.
It was working fine for the XML's which is lesser than 92000 bytes(approx.).
This time my response XML is 98628. When I tried to extract, the XML is not completely extracted. I'm getting Partial XML(9140 bytes).

Oracle version : 9i.

I'm using the below piece of code :

declare
xyz clob := null;
abc clob := null;
ijk clob := null ;
v_req_xml clob := null;
 x_response_xml          XMLTYPE;
      x_soap_header_xml       XMLTYPE;
      soap_header_xml         CLOB;
      p_response_xml clob := null;
begin
select req_xml into v_req_xml from test_xml ;---I stored the response XML as a CLOB and fetching the same.
sample_procedure('v_req_xml = ',v_req_xml) ;--Sample_procedure - autonomous procedure
 x_soap_header_xml := XMLTYPE.createxml (v_req_xml);
      x_soap_header_xml :=
         x_soap_header_xml.EXTRACT
                     ('/soap:Envelope/soap:Header/child::node()',
                      'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'
                     );
                     

      IF x_soap_header_xml IS NOT NULL
      THEN
         soap_header_xml := x_soap_header_xml.getclobval ();
         
         soap_header_xml := '<Response>' || soap_header_xml || '</Response>';
         x_soap_header_xml := XMLTYPE.createxml (soap_header_xml);
         

         /*SELECT EXTRACTVALUE (VALUE (t), '//ServiceErrCode'),
                EXTRACTVALUE (VALUE (t), '//ServiceErrMessage')
           INTO service_error_code,
                service_error_message
           FROM TABLE (XMLSEQUENCE (EXTRACT (x_soap_header_xml, '/'))) t;

         IF service_error_code IS NOT NULL
            OR service_error_message IS NOT NULL
         THEN
            p_output_message_out :=
                           service_error_code || ':' || service_error_message;
            p_response_xml := v_req_xml;
            p_request_xml := v_request_xml;
            RETURN;
         END IF;*/
      END IF;
      
      x_response_xml := XMLTYPE.createxml (v_req_xml);
      abc := x_response_xml.getclobval() ;--Covert XMLTYPE to CLOB to store it as a CLOB. Till here there is no issue, I'm getting the full XML
      sample_procedure('abc = ',abc) ;
      x_response_xml :=
         x_response_xml.EXTRACT
                     ('/soap:Envelope/soap:Body/child::node()',
                      'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'
                     );
                     ijk := x_response_xml.getclobval ();
                     sample_procedure('ijk = ',ijk) ;--Covert XMLTYPE to CLOB to store it as a CLOB. Here I'm getting Partial XML
      x_response_xml :=
         x_response_xml.EXTRACT ('/m:getPriceResponse/m:return/child::node()',
                                 'xmlns:m="http://com/bgs/services"'
                                );
      p_response_xml := x_response_xml.getclobval ();
      sample_procedure('p_response_xml =',p_response_xml) ;
     
 end ;



Is there any limitation to extract the huge XML?

Thanks a lot.....
Re: How to extract a lengthy XML(98628 bytes) using EXTRACT. Is it possible to extract such a huge X [message #377651 is a reply to message #377627] Wed, 24 December 2008 01:45 Go to previous messageGo to next message
Frank Naude
Messages: 4420
Registered: April 1998
Senior Member
Are you sure the break point is 98628 bytes? Does it work for any XML documents larger than 32k?
Re: How to extract a lengthy XML(98628 bytes) using EXTRACT. Is it possible to extract such a huge X [message #377684 is a reply to message #377627] Wed, 24 December 2008 04:36 Go to previous messageGo to next message
ulaganathank
Messages: 2
Registered: December 2008
Location: India
Junior Member
Ya sure...It is working for the XML which is lesser than the mentioned figure(It's approx.) I'm very sure it's working for 32 K and 64 K also.
Re: How to extract a lengthy XML(98628 bytes) using EXTRACT. Is it possible to extract such a huge X [message #377686 is a reply to message #377684] Wed, 24 December 2008 04:46 Go to previous message
Frank Naude
Messages: 4420
Registered: April 1998
Senior Member
In hat case I have no clue. I hope someone else around here will be able to help you!
Previous Topic: SQL Cache frame work
Next Topic: Importing existing projects into JDeveloper 11g
Goto Forum:
  


Current Time: Thu Dec 18 07:51:21 CST 2014

Total time taken to generate the page: 0.11623 seconds