#3 xml text wiped out in xmlsax.js XMLP

Bob Matlin

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");


  • Bob Matlin

    Bob Matlin - 2004-12-19

    sample data

  • Bob Matlin

    Bob Matlin - 2004-12-19

    Logged In: YES

    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

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

  • David Joham

    David Joham - 2005-01-08
    • status: open --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks