Skip to content

Instantly share code, notes, and snippets.

@sammarder
Created October 2, 2015 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sammarder/844c062a2238a9ed93cc to your computer and use it in GitHub Desktop.
Save sammarder/844c062a2238a9ed93cc to your computer and use it in GitHub Desktop.
require 'rexml/document'
include REXML
xmlfile = File.new("renr (2015-08-19T10.52.37-0400).xml")#file to be translated
xmldoc = Document.new(xmlfile)
xmldoc.elements.each("chat/message"){
|e| puts e.attributes['sender']
puts e.attributes['time']
e.elements.each("div"){
|a| #if a.elements.has?("span")
# puts "span"
# a.elements.each("span"){
# |s| puts s.text
# }
#else
puts a.text
}
}
puts xmldoc.elements.to_s
puts "hi"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment