-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parser locks up on long input lines #97
Comments
I have added the needs-investigation and help wanted labels.
I am adding reference to issue #55 to replace lib/sax.js. I suspect there should be an existing SAX parser that we can reuse to both avoid bugs on our side and reduce the maintenance burden. |
After fixing duplicate attributes in the provided xml sample (which fails since 0.5.0) I could successfully parse the file when running against master. I assume this was also fixed by normalizing all kinds of line breaks, which landed in #314 and will be part of the 0.8.0 release. |
The attached test code fails to parse the attached XML document in a reasonable timeframe:
failing.zip
The issue causing this appears to be a regular expression to split the XML on newlines, which either never returns, or is incredibly slow to return:
At: xmldom/lib/sax.js:69:
It appears that the solution would be to re-engineer the parser to process the XML in stream mode, not by splitting lines with a regular expression
The text was updated successfully, but these errors were encountered: