-
-
Notifications
You must be signed in to change notification settings - Fork 903
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
Add failing test case for Nokogiri::XML::Node#content inconsistency between Java and C #794
Add failing test case for Nokogiri::XML::Node#content inconsistency between Java and C #794
Conversation
Any guidance on how I should approach fixing this would be most appreciated. |
sorry for the late response. I'll take a look and get back to you shortly. |
Can you explain what's wrong with the test in commit 0e43632, i mean what are you trying to test ? |
Note that this is, I hope, the last thing blocking my Nokogiri-dependent stuff from all passing on JRuby. I would love to get this in to 1.5.6, assuming that is coming soon. It'll be beers all round at that point :) |
On JRuby, node.content returns "I <3 nachos". On libxml it returns "I ". A similar thing can be seen in the rendered XML. It seems libxml is assuming all instances of "<" mean there's an XML element coming and doesn't escape correctly. |
That's what I thought. I think in this case the C implementation is doing the right thing, the |
So how then do I append a string containing "<"? I can't do |
You can use |
Apologies, I was being unintentionally obtuse. I am infact now appending a Regards, Em 19 Nov 2012, às 21:08, John Shahid [email protected] escreveu: You can use node.content += on the text node or insert a new text node if — |
No worries. I agree that the behavior should be consistent. I'll merge the changes in 311be4b on master but I won't merge the other test. I'll work on the fix some time later today. |
Sorry it took too long to push a fix. I had to wrap my head around the current implementation. I pushed another pull request with the first test and its fix. I'd like @yokolet to review the changes before it gets merged into master. I'm going to close the issue, but feel free to comment on the new pull request if the problem isn't solved. |
Thanks John. It was faster than I could have done it, being a Java |
…st case from pull request #794.
C implementation includes content of child nodes recursively, Java does not.