How do I read an XML file in Ruby?

How do I read an XML file in Ruby? Ruby XML DOM-Like Parsing #!/usr/bin/ruby -w. require ‘rexml/document’ include REXML. xmlfile = File.new(“trial.xml”) xmldoc = Document.new(xmlfile) # Now get the root element. root = xmldoc.root. puts “Root element : ” + root.attributes[“shelf”] What is the best XML parser? Best XML parser for Java [closed] JDOM. Woodstox. […]

Back to Top