Created
May 25, 2017 22:32
-
-
Save govaniso/e632f9b117833c142b3df2c103555e86 to your computer and use it in GitHub Desktop.
Leer XML en ruby con Nokigiri
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
#encoding: utf-8 | |
require 'nokogiri' | |
name_xml_file = "archivo.xml" | |
f = File.open(name_xml_file) | |
xml = Nokogiri::XML(f) | |
body = xml.xpath("//s0:invoices") | |
body.xpath("//s0:uuid").each do |e| | |
puts e.content | |
end | |
# Salida: | |
# | |
# 7F53D32C-1234-0000-AE5B-63237381AC1A | |
# 05E5DF90-1234-1234-0000-1BE7DBBF9E33 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment