4 Replies Latest reply: Sep 28, 2012 6:16 PM by 964614 RSS

    Error in XML process generated

    964614
      Hi,

      please, I need your help. I have an XML develped in APEX 4.1.1. but I have a problem, because the "SRI_COMPRAS" table has 38 columns with 950 rows, and the xml is generated only when considering the first 14 columns of this table with all existing records. But I need generate this XML with all the columns of "SRI_COMPRAS".

      The process is:

      declare
      ...
      begin
      ....
      select xmlElement(
      "iva",
      xmlElement("numeroRuc",J.RUC),
      ...
      xmlElement("mes", J.MES),

      xmlElement(
      "compras", (
      select xmlAgg(
      xmlElement(
      "detalleCompra",
      xmlElement("codSustento", K.COD_SUSTENTO),
      xmlElement("tpldProv", K.TPLD_PROV ),
      xmlElement("idProv", K.ID_PROV ),
      xmlElement("tipoComprobante", K.TIPO_COMPROBANTE),
      xmlElement("fechaRegistro",to_char(K.FECHA_REGISTRO, 'DD/MM/YYYY') ),
      xmlElement("establecimiento", K.ESTABLECIMIENTO ),
      xmlElement("puntoEmision", K.PUNTO_EMISION ),
      xmlElement("secuencial", K.SECUENCIAL),
      xmlElement("fechaEmision", to_char(K.FECHA_EMISION, 'DD/MM/YYYY') ),
      xmlElement("autorizacion", K.AUTORIZACION ),
      xmlElement("baseNoGraIva", K.BASE_NO_GRA_IVA ),
      xmlElement("baseImponible", K.BASE_IMPONIBLE ),
      xmlElement("baseImpGrav", K.BASE_IMP_GRAV ),
      xmlElement("montoIce", K.MONTO_ICE ),
      xmlElement("montoIva", K.MONTO_IVA ),
      xmlElement("valorRetBienes", K.VALOR_RET_BIENES),
      xmlElement("valorRetServicios",K.VALOR_RET_SERVICIOS),
      xmlElement("valorRetServ100",K.VALOR_RET_SERV_100),
      xmlElement("estabRetencion1", K.ESTAB_RETENCION_1),
      xmlElement("ptoEmiRetencion1", K.PTO_EMI_RETENCION_1),
      xmlElement("secRetencion1", K.SEC_RETENCION_1),
      xmlElement("autRetencion1", K.AUT_RETENCION_1),
      xmlElement("fechaEmiRet1", to_char(K.FECHA_EMI_RET_1,'DD/MM/YYYY')),
      xmlElement("docModificado", K.DOC_MODIFICADO),
      xmlElement("estabModificado", K.ESTAB_MODIFICADO),
      xmlElement("ptoEmiModificado", K.PTO_EMI_MODIFICADO),
      xmlElement("secModificado", K.SEC_MODIFICADO),
      xmlElement("autModificado", K.AUT_MODIFICADO)
      xmlElement(
      "air", (
      select xmlAgg (
      xmlElement (
      "detalleAir",
      xmlForest (
      P.COD_RET_AIR as "codRetAir",
      ...
      ...
      ) ))
      from ANEXO_COMPRAS P
      ....
      )) ) )
      from SRI_COMPRAS K
      ....
      ) )).getClobVal()
      into l_clob_XML
      from ...
      ....
      LOOP
      buffer := DBMS_LOB.SUBSTR(l_clob_XML, text_1, text_2);
      EXIT WHEN buffer IS NULL;
      sys.htp.p(buffer);
      text_1 := text_1 + text_2;
      END LOOP;
      end;



      The error generate is: "error on line 2 at column 1: expect '>'"

      Edited by: JohannaCevallos07 on Sep 28, 2012 6:37 AM
        • 1. Re: Error in XML process generated
          Jason_(A_Non)
          The error generate is: "error on line 2 at column 1: expect '>'"
          So what is at line 2 column 1 from where you see the error? I assume that line 1 will play an important role as well.
          • 2. Re: Error in XML process generated
            964614
            Hi,
            Actually the problem occurs when the xml file is generated with all the columns of the tables. Not seeing any data in th xml file and includes that message of error.

            When in the xml code I determined display all the information of the tables considering only specific columns (14 columns for example) the xml file is generated successfully with all the information contained in the table only for those columns. but I need this xml file is generated with all the information for the tables columns describes in the first post publicated. : (

            Do you have any idea of the cause for this error? Can you help me, please?
            • 3. Re: Error in XML process generated
              Jason_(A_Non)
              Have you tried running the SQL statement (with all columns) outside APEX, such as via SQL*Plus or some other method?

              I'm understanding you to say that when you only use 14 columns from the table in the SQL/XML SELECT statement, then everything works cleanly. When you add in all the columns, the error appears in the file that sys.htp.p writes to. Speaking of ... what happened to the htp.prn method as you were shown in {message:id=10600939}

              If that is true, try adding in columns one by one to see what triggers the error.

              Note: I've never used APEX so I'm just guessing as well.
              • 4. Re: Error in XML process generated
                964614
                Hi,
                I am testing column by column but according I`m adding a column I have to decreasing the number of records to be consulted.
                I`m going crazy with this.... : (