-
Notifications
You must be signed in to change notification settings - Fork 43
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
JOOX.$() doesn't support whitespace between comment and root element #190
Comments
Thanks for your report. I agree this should probably work, assuming there are no forbidden content elements in the prolog (e.g. unsupported whitespace: https://www.w3.org/TR/xml/#NT-prolog). |
The problem is indeed whitespace. This works: String xmlData = "<!-- comment --><root></root>"; This doesn't: String xmlData = "<!-- comment --> <root></root>"; But this does, again: String xmlData = "<?xml version=\"1.0\"?> <!-- comment --> <root></root>"; It's weird that the
Let's see if jOOX can work around this. |
Related: #128 |
Well, it seems that the
But alas, it doesn't. I guess the only safe solution here is to remove the whitespace for now. |
The alternative would be to parse the |
Fixed for version 2.0.1 |
Much appreciated Lukas! |
Expected behavior and actual behavior:
The following code:
should correctly parse.
However, it fails with the following exception:
This is especially relevant for copyright notices at the start of a file.
Steps to reproduce the problem:
Run the test.
Versions:
The text was updated successfully, but these errors were encountered: