Skip to content

Instantly share code, notes, and snippets.

@lwe
Created December 20, 2011 13:50
Show Gist options
  • Save lwe/1501622 to your computer and use it in GitHub Desktop.
Save lwe/1501622 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'nokogiri'
puts "Platform: #{RUBY_PLATFORM}"
puts "Nokogiri: #{Nokogiri::VERSION}"
xml = <<XML
<foo:bar>
<some>value</some>
<other>1234</other>
</foo:bar>
XML
doc = Nokogiri::XML(xml)
puts doc.to_s
require 'rubygems'
require 'nokogiri'
puts "Platform: #{RUBY_PLATFORM}"
puts "Nokogiri: #{Nokogiri::VERSION}"
xml = <<XML
<bar>
<some>value</some>
<other>1234</other>
</bar>
XML
doc = Nokogiri::XML(xml)
puts doc.to_s

ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]

> ruby /tmp/fail.rb                                                                                                                                                                           
Platform: universal-darwin11.0
Nokogiri: 1.5.0
<?xml version="1.0"?>
<bar>
  <some>value</some>
  <other>1234</other>
</bar>

> ruby /tmp/ok.rb             
Platform: universal-darwin11.0
Nokogiri: 1.5.0
<?xml version="1.0"?>
<bar>
  <some>value</some>
  <other>1234</other>
</bar>

jruby 1.6.5 (ruby-1.8.7-p330) (2011-10-25 9dcd388) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]

> jruby /tmp/fail.rb
Platform: java
Nokogiri: 1.5.0
<?xml version="1.0"?>

> jruby /tmp/ok.rb             
Platform: java
Nokogiri: 1.5.0
<?xml version="1.0"?>
<bar>
  <some>value</some>
  <other>1234</other>
</bar>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment