-
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
PrettyPrinter adds empty attribute with xmlns #28
Conversation
232439e
to
6dfc129
Compare
* src/test/scala/scala/xml/XMLTest.scala (issue28): New unit test
Thanks for the test case! Even better than a bug report :-) I hope a fix will come forth! (I don't have any insights here either, unfortunately.) |
* src/test/scala/scala/xml/XMLTest.scala (issue28): New unit test
6dfc129
to
c1e8e96
Compare
@adriaanm Looks like it might be an improper use of null as a default argument. Should it be TopScope instead? I'm not familiar with the code base to know for sure, nor whether other references to null in the formatter should be fixed as well. |
* src/main/scala/com/jonasboner/PrettyPrinter.scala (format): Modify namespace binding default argument to TopScope, was null.
c1e8e96
to
a53d11c
Compare
We're about to find out thanks to Travis :-) |
Cool! Could you ping one of the other recent PR submitters to get a second opinion? I really have no clue about namespacing in xml. |
@bartschuller, Any interest in reviewing a fix for the defect where the PrettyPrinter makes an empty namespace attribute? @adriaanm wants a second opinion
|
I agree, In XML with namespaces you sometimes need to invent xmlns attributes, but this is not such a case. Expected behavior here is that what you put in is what you get out. |
Thank you both! Very happy to see such quick turnaround (sorry I was the blocking factor here -- happy to take myself out of the loop if someone would like to step up and manage pull requests). |
PrettyPrinter adds empty attribute with xmlns
An element with an
xmlns
attribute gets converted to a string correctly, but using the pretty printer to convert the XML to a string adds an extra, empty attribute. I have no insight on how to fix the pretty printer.There is a failing unit test provided by this pull request that can reproduce this issue: