-
-
Save sammarder/844c062a2238a9ed93cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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