-
-
Notifications
You must be signed in to change notification settings - Fork 901
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
regression: adding previous siblings seemingly orphans node #595
Comments
Greetings! I can't reproduce this :-( I see the same behavior for all versions of Nokogiri you mention - 1.4.1, 1.4.7 and 1.5.0, which is that the doc structure after all operations is:
That said, it's extremely likely that the version of libxml2 you're using would affect this behavior. Is it possible that you're using an old version of libxml2 with your installation of Nokogiri 1.4.1? You should be able to determine this by running
I'd love to hear back on what version of libxml2 you're running, and what the doc structure you see is with that version! |
As I said above, the actual document structure is correct, it's Nokogiri's representation of the document structure that becomes corrupted, returning nil for both Also note that it's Nokogiri 1.4.1 that is exhibiting the correct behavior, it's the newer 1.4.7 and 1.5.0 that are incorrect. All tests were done with libxml 2.7.3 and then again with 2.7.6, as I stated. |
Ah, got it. Apologies for not reading more carefully. Let me see what I can do ... |
…dNextSibling and xmlAddPrevSibling. Related to #595. Upon examination, neither of these functions free nodes other than the reparentee, which we're already pickling in `reparent_node_with`.
Scheduled for 1.5.1. Also see related 1af2c49 which does similar work for Node#add_next_sibling. |
This test case will print "these should not be nil" using Nokogiri 1.4.7 and 1.5.0, but will not print that using Nokogiri 1.4.1.
Note that the node doesn't actually get orphaned or deleted -- calling
.children
on its parent behaves as you'd expect. But the node returns nil for both.previous
and.parent
This was tested with Ruby 1.8.7 and libxml 2.7.3, on OS X Lion. Also occurs using Ruby Enterprise Edition 2011.03 on ubuntu with libxml 2.7.6.
The text was updated successfully, but these errors were encountered: