-
Notifications
You must be signed in to change notification settings - Fork 5
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
Bug in parse-to-list ? #18
Comments
Both If that is the case, then it seems to me that I will see about a quick MR. |
See #19 |
@robert-dodier Is this the change we expected? It seems reasonable to me that |
@rpgoldman I'm afraid I don't understand what "this" refers to. At any rate, I agree that a non-XML string should raise an error when I think what I was arguing for, some time ago, is to stretch the JSON spec to say that an empty document is valid, and the parser returns |
Yes, that’s what I was referring to. We were making it so that empty (or multiple?) documents were OK, and I think I may have inadvertently made it so a string of gibberish was also ok. I haven’t used XMLS in ages, so none of this is fresh in my memory. Sounds like it’s ok to fix it so that an error is raised for a non-XML string. Thanks |
(parse-to-list str) is equivalent to (node->nodelist (parse str)).
if (parse str) fails to read the xml document and returns nil, parse-to-list fails with an unclear error message :
The result is the same with this call :
Could replacing handler-case with ignore-errors in function parse fix the problem ?
Is this the intended behaviour ?
Should
(node->nodelist nil)
returnnil
? It fails with the error above for now.When
parse
returnsnil
, shouldparse-to-list
returnnil
?Should
(parse-to-list nil)
be strictly equivalent to(node->nodelist (parse str))
for convenience or return nil / signal a clearer error whenparse
returnsnil
?The text was updated successfully, but these errors were encountered: