2 Replies Latest reply on Dec 7, 2006 7:51 AM by Stormpool

    XML Parse / Loop problems

    Stormpool
      I'm retrieving results from a webservice for products, my daily routine has hiccuped on products beginning with 'N'

      CFHTTP was pulling 1000 records at a time, using xmlparse(cfhttp.filecontent) and then I wrote the results to the database.

      The error I've encountered is

      An error occured while Parsing an XML document.
      An invalid XML character (Unicode: 0x8) was found in the CDATA section.


      I've stripped all the write to database code and can confirm the XMLParse function is producing this error. I've tried a few different charsets "iso-8859-1" and "utf-8" I also have <cfhttpparam type="header" name="Accept-Encoding" value="*"/> within the CFHTTP get.

      If I try and get fewer records, but loop multiple times I get a mixture of unusual results.

      Loop 1 - 10 with 50 results
      I get the same error message on the 7th loop, suggesting a problem with a record between 350 and 400.

      Loop 1 - 25 with 20 results
      I get the same error message on the 13th loop, suggesting a problem with a record between 260 and 280.

      Loop 1 - 100 with 10 results
      It loops 1 - 31 refreshes the page and does 1-31 again... forever.. no errors messages.

      The only code on the page is (overly simplified)

      <cfsetting requesttimeout="99999">
      <cfloop>
      <cfhttp>
      <cfdump var="#page#">
      xmlparse(cfhttp.filecontent)
      </cfloop>

      Thanks