-
Notifications
You must be signed in to change notification settings - Fork 92
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
Parse nodes before and after the root element #560
Conversation
There's a lot of syntax fixes in this patch in files unrelated to the node parsing change. Is there a way to minimize this change so it can be reviewed easier? |
@ashawley done:
Is this acceptable or should I minimize the patch some more? Thanks!!! |
(We're happy to have the code cleanups, if you still want to include them -- just in a separate commit from the main changes.) |
Yeah, I had no objection to the code cleanup, it is much needed. There was just a lot here. It's more ideal if bulk code cleanup were made separately in another PR. |
Cool. I agree that code cleanup should be done systematically, thoroughly and in bulk. But then there will be even more there ;) Thanks! |
@ashawley Is there anything I need to change in this pull request for it to get merged? Thanks! |
@dubinsky (this doesn't answer your question, but:) mind rebasing onto current |
…ore the start and after the end of the root element. Currently, `FactoryAdapter` does not capture those nodes, and `XMLLoader.loadXML` does not provide access to anything other than the root element anyway. This pull request addresses the issue. Note: at least with the JDK's Xerces, whitespace in the prolog and epilogue gets lost in parsing: the parser does not fire any white-space related events.
@SethTisue done |
@ashawley @SethTisue Is there anything I need to change in this pull request for it to get merged? Thanks! |
@@ -98,6 +98,8 @@ trait MarkupParser extends MarkupParserCommon with TokenTests { | |||
var extIndex = -1 | |||
|
|||
/** holds temporary values of pos */ | |||
// Note: this is clearly an override, but if marked as such it causes a "...cannot override a mutable variable" | |||
// error with Scala 3; does it work with Scala 3 if not explicitly marked as an override remains to be seen... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like scala/scala3#13744 should fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay! Thank you, I did not see that!
@ashawley @SethTisue Is there anything I need to change in this pull request for it to get merged? Thanks! |
ping @ashawley — shall we just merge this? |
Yes, I think we should merge. I actually have a few amendments to the API choices in this around naming, but I can try to suggest those in a followup PR. I think the code for accepting and capturing any pre-processing elements or comments and such is something we should get working, regardless. |
Thanks! |
@ashawley @SethTisue yet another bit of the lexical stuff
XML allows for comments and processing instructions to be present before the start and after the end of the root element. Currently,
FactoryAdapter
does not capture those nodes, andXMLLoader.loadXML
does not provide access to anything other than the root element anyway. This pull request addresses the issue.Note: at least with the JDK's Xerces, whitespace in the prolog and epilogue gets lost in parsing: the parser does not fire any white-space related events.
(Travis builds for JDK 17 fail with "no matching JDK found: 17" as noted in #559.)