-
-
Notifications
You must be signed in to change notification settings - Fork 905
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
Nokogiri::XML::Node#namespace= cannot set a namespace without a prefix on JRuby #648
Comments
Changing the line referenced in XmlNode.java:1163 from String prefix = rubyStringToString(ns.prefix(context)); to String prefix = ns.prefix(context).isNil() ? "" : rubyStringToString(ns.prefix(context)); gets this further, but results in this failure instead:
|
Hello again! As you found, the bug was exactly there. I pushed the change, rev. 599a2af . |
That's fixed the first layer of the issue in the same way that my last comment suggested, but it reveals another more complex problem, also indicated in my last comment. I'm not sure what the correct approach is to solve this 2nd layer. |
Let me clarify. You are talking this error?
Or, do you have other error(s)? After the change in rev. 599a2af , the spec above passed. I didn't get the error. If you have more specs that don't pass, would you share those? |
That spec raises the NAMESPACE_ERR. Could it be an issue with my version of Xerces? |
I appear to have Xerces-J 2.6.2, bundled with the Apple JVM. Is this too old? How would I link Nokogiri against a newer version? |
Ok, it turns out Xerces wasn't to blame, but the fact that I missed the vital issue here:
I consider myself appropriately shamed. Closing :) |
Good to know. Yes, we need "rake compile" after the change. |
I had done a 'rake compile', however I did it on 1.9.3, and didn't notice the lack of an updated nokogiri.jar. Thanks for the fix as always. |
Ah, I see. That happens. I always use two terminals, one for pure Java (ocean color), the other for libxml (white). This is easy to recognize what I've done for two Nokogiris. Also, it is easy to check what has been done for each Nokogiri from command history. |
1.9.3:
JRuby 1.6.7:
The text was updated successfully, but these errors were encountered: