2 Replies Latest reply on Nov 4, 2013 9:19 AM by Weibing.Xia

    error received from SAX callback function

    466131
      Hi,
      I am trying to get the xml filecontent that is stored in a column of a table and insert into another relational table. xml content is in the canonical format. This simple procedure retrieves the content from the colum and process it. The procedure runs well, if the xml content is short and arranged. When xml content is large, I am getting the LPX-00222: error received from SAX callback function- error. I think the issue probably due to the way xml content is stroed in the column (though this xml content is valid). The element tags are not arranged end to end when in the column or it is expecting a full row to be present in a line or white spaces. How can I control the format of the xml content stored in a column while it is retrieved? (this is a valid xml content) I am nex to xml work and any help or hints will be appreciated. Thanks very much.
      Joseph


      PROCEDURE Converter10 IS

      l_content clob;
      l_ctx DBMS_xmlstore.ctxtype;
      l_rows number;

      begin

           Select filecontent
           into l_content
           from xml_files
      --where id =13;
      where id =21;

           
      l_ctx := dbms_xmlstore.newcontext('LOAD_XML');
      -- dbms_xmlstore.SetUpdateColumn(l_ctx, 'ST');
      l_rows := dbms_xmlstore.insertxml(l_ctx, l_content);
                dbms_xmlstore.closecontext(l_ctx);
      dbms_output.put_line(l_rows || ' rows inserted into LOAD XML TABLE.');


      END;
      -----------------------------------------------------
      SQL> exec converter10
      BEGIN converter10; END;

      *
      ERROR at line 1:
      ORA-31011: XML parsing failed
      ORA-19202: Error occurred in XML processing
      LPX-00222: error received from SAX callback function
      ORA-06512: at "SYS.DBMS_XMLSTORE", line 78
      ORA-06512: at "FMIS.CONVERTER10", line 25
      ORA-06512: at line 1



      The clob value from the table, first time (where id 13) - procedure ran sucessfully :

      <?xml version="1.0"?><ROWSET>
      <ROW><ST>06</ST><PROJ_NO>TEST037</PROJ_NO><PROGRAM_CODE>Q110</PROGRAM_CODE>
      <DTL_NO>20</DTL_NO><CONG_DIST>09</CONG_DIST><DIST_PCT>1</DIST_PCT></ROW></ROWSET>



      The clob value from the table, second time(where id 21) - procedure showed above error:

      <?xml version="1.0"?><ROWSET>
      <ROW><ST>08</ST><PROJ_NO>TEST037</PROJ_NO><ACTION_TYPE>01</ACTION_TYPE><STANDARD_PLACE_CODE>54652C</STANDARD_PLACE_CODE><BEGINNING_MILE_POINT_NBR>0</BEGINNING_MILE_POINT_NBR><ENDING_MILE_POINT_NBR>0</ENDING_MILE_POINT_NBR><PROJ_TYPE>P</PROJ_TYPE><PROJ_OVERSIGHT>A</PROJ_OVERSIGHT>
      <ENVRL_CLEARANCE>2A</ENVRL_CLEARANCE><ENVRL_CLEARANCE_YR>2003</ENVRL_CLEARANCE_YR><ENVRL_CLEARANCE_MO_DAY>0808</ENVRL_CLEARANCE_MO_DAY><STIP_REFERENCE>SCAG204 </STIP_REFERENCE><ST_CERTIFIED_DATE>09/28/2005 0:0:0</ST_CERTIFIED_DATE><ST_RECOMMENDED_DATE>09/28/2005 0:0:0</ST_RECOMMENDED_DATE>
      <ST_AGR_MOD_REQUESTED_DATE>09/28/2005 0:0:0</ST_AGR_MOD_REQUESTED_DATE><ST_CERTIFIED_SIG>P. HARMON</ST_CERTIFIED_SIG><ST_RECOMMENDED_SIG>PATTY HARMON</ST_RECOMMENDED_SIG><ST_AGR_MOD_REQUESRED_SIG>P. HARMON</ST_AGR_MOD_REQUESRED_SIG><ST_DEFINED_DATA1>04444005L5129 </ST_DEFINED_DATA1>
      <ST_DEFINED_DATA2>07932298L</ST_DEFINED_DATA2><PROJ_DESC>TEST RD. AT VENTEST RD. , RIGHT TURN LANE- TRAFFIC SIGNAL MOD </PROJ_DESC><PROGRAM_CODE>Q110</PROGRAM_CODE><DTL_NO>20</DTL_NO><PERCENT_FED_SHARE>79.52</PERCENT_FED_SHARE>
      <IMPROVEMENT_TYPE>16</IMPROVEMENT_TYPE><COUNTY_CODE>127</COUNTY_CODE><RURAL_URBAN>U</RURAL_URBAN><FUNCTIONAL_SYSTEM>C</FUNCTIONAL_SYSTEM><FED_AID_SYSTEM>O</FED_AID_SYSTEM><TOLL_ROAD>N</TOLL_ROAD><SAFETY>N</SAFETY><TEMP_MATCH>N</TEMP_MATCH><INDIAN_RESERVATION>N</INDIAN_RESERVATION><FTA>N</FTA>
      <FEDERAL_FUNDS_AMT>14578.2</FEDERAL_FUNDS_AMT><URBANIZED_AREA>235</URBANIZED_AREA><PREFIX>STPLZ </PREFIX><ST_FUNDS_AMT>0</ST_FUNDS_AMT><PRIVATE_FUNDS_AMT>0</PRIVATE_FUNDS_AMT><TOTAL_COST_AMT>18333</TOTAL_COST_AMT><NONMONETARY_AMT>0</NONMONETARY_AMT><LOCAL_FUNDS_AMT>3754.8</LOCAL_FUNDS_AMT>
      <OTHER_FUNDS_AMT>0</OTHER_FUNDS_AMT><ADV_CONST_AMT>0</ADV_CONST_AMT><ADV_CONST_CONVERTED_AMT>0</ADV_CONST_CONVERTED_AMT><SOFT_MATCH_AMT>0</SOFT_MATCH_AMT><CONG_DIST>04</CONG_DIST><DIST_PCT>7</DIST_PCT></ROW>'