Skip to content
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

Raw XML string in XML Builder broken on JRuby #486

Closed
rsim opened this issue Jul 4, 2011 · 6 comments
Closed

Raw XML string in XML Builder broken on JRuby #486

rsim opened this issue Jul 4, 2011 · 6 comments

Comments

@rsim
Copy link

rsim commented Jul 4, 2011

This example demonstrates that Nokogiri 1.5.0 on JRuby 1.6.2 generates wrong XML when using complex raw XML string in XML Builder (but on MRI everything is OK).

require "rubygems"
gem "nokogiri", "1.5.0"
require "nokogiri"

builder = Nokogiri::XML::Builder.new do |doc|
  doc.test do
    doc << '<aaa><bbb/><ccc/></aaa>'
  end
end

puts builder.to_xml
# On JRuby 1.6.2
# <?xml version="1.0"?>
# <test>
#   <aaa/>
#   <bbb/>
#   <ccc/>
# </test>

# On MRI 1.8.7 and 1.9.2
# <?xml version="1.0"?>
# <test>
#   <aaa>
#     <bbb/>
#     <ccc/>
#   </aaa>
# </test>
@flavorjones
Copy link
Member

Added failing test to new branch 486-raw-string-in-xml-builder.

@flavorjones
Copy link
Member

Scratch that, failing test in 816c655 is on master.

@yokolet
Copy link
Member

yokolet commented Jul 5, 2011

Thanks @flavorjones

This is exactly the same cause as the issue#484. There exists something wrong with the logic of appending children, Not the displaying issue. I'm working on this right now.

@yokolet
Copy link
Member

yokolet commented Jul 8, 2011

The bug has been fixed by rev. d3429ec

@yokolet yokolet closed this as completed Jul 8, 2011
@rsim
Copy link
Author

rsim commented Jul 8, 2011

This bugfix is example of "less code - less bugs" :)

@yokolet
Copy link
Member

yokolet commented Jul 8, 2011

Right. That was a remaining of old code. After related Ruby code was changed, that line was useless, but was not deleted and forgotten totally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants