#3 xml text wiped out in xmlsax.js XMLP

closed
nobody
None
5
5 days ago
2004-12-19
Bob Matlin
No

While trying to parse a file using the SAX parser
(xmlsax.js version 3.1), I only saw the Document Start
and Document End events. Also, this was on the server
side in an asp script. Eventually I tracked it down to
two replace functions in XMLP(). Before the calls, the
xml text was OK, afterward it was an empty string. I
replaced the calls with JavaScript string.replace()
calls, which seemed to fix the problem. Here are the
lines I replaced:

strXML = SAXStrings.replace(strXML, null, null,
"\r\n", "\n");

strXML = SAXStrings.replace(strXML, null, null,
"\r", "\n");

and their replacements:

strXML = strXML.replace(/\r\n/g, "\n");

strXML = strXML.replace(/\r/g, "\n");

Discussion

  • Bob Matlin
    Bob Matlin
    2004-12-19

    sample data

     
    Attachments
  • Bob Matlin
    Bob Matlin
    2004-12-19

    Logged In: YES
    user_id=494239

    I found that this was due to an apparent bug in the asp
    interpreter on my site (ChiliSoft). Apparently the
    String.join() method is broken; it wipes out the array
    values. Since join() is used in SAXStrings.replace(), I'm
    pretty sure that's where the problem lies, though I haven't
    actually verified it.

     
  • David Joham
    David Joham
    2005-01-08

    Logged In: YES
    user_id=133395

    hrm. Weird. Thanks for the followup. Closing for now...

     
  • David Joham
    David Joham
    2005-01-08

    • status: open --> closed