0

So far I can only get to each element I wanna know how to get the attributes like address from results that look like <sms protocol="0" address="+18334120420" ... Here's my code that only goes as far as getting each sms element:

file=File.open('test.xml')
doc=Nokogiri::XML.parse(file)
doc.xpath('//sms').each do |msg|
  puts msg
end
  • Yes The script is for importing xml sms messages to database Where the messages have emojis there are special characters beginning with /x and mysql errors out with something about utf8mb4 so I was going back and forth changing the encoding of the table i kept getting collate mismatch errors utf8mb3 IMPLICIT vs utf8mb4 COERSIVE Kept going back and forth and I gave up on it for the night – bad-reputation Dec 09 '22 at 20:18

0 Answers0