-
-
Notifications
You must be signed in to change notification settings - Fork 931
Closed
Milestone
Description
Example:
require 'nokogiri'
reader = Nokogiri::XML::Reader(File.open 'entities.xml')
reader.each do |node|
puts node.outer_xml if node.node_type == 1 && node.name == 'Main'
endusing this XML:
<Root>
<Main>
<Element>This has & in it</Element>
</Main>
<Main>
<Element>This has > in it</Element>
</Main>
<Main>
<Element>This has < in it</Element>
</Main>
</Root>Produces this output:
<Main>
<Element>This has & in it</Element>
</Main>
<Main>
<Element>This has > in it</Element>
</Main>
<Main>
<Element>This has < in it</Element>
</Main>This makes it impossible to pass outer_xml to Nokogiri::XML() because with strict mode on, it will throw an error, and with strict off, it will drop parts of the XML. I tested this on jruby-1.7.24 and jruby-9.0.5.0.