require 'rexml/document'
str = File.readlines('myxml.xml').join # '<a></a>'
el = REXML::Document.new str
p el.to_s # "<a/>"
I want <a></a> instead of <a />.
How can I get this with rexml in ruby?
" I want instead of " /> " I want instead of " /> " I want instead of "/>
Since it’s an XML, the elements got collapsed unless there is a [possibly emply] node nested: