Project

General

Profile

Bug #9539 » sample.rb

Sample script - mbarcala (Mario Barcala), 02/20/2014 09:09 AM

 
1
# -*- coding: utf-8 -*-
2
require "rexml/document"
3
File.open("sample.xml") do |file|
4
  document = REXML::Document.new file
5
  puts REXML::XPath.first(document, "/document/header/anno_publicacion/text()")
6
  puts REXML::XPath.first(document, "/document/header/año_publicacion/text()")
7
  puts REXML::XPath.first(document, "/document/header/año_publicación/text()")
8
end