/ Published in: Ruby
URL: http://www.germane-software.com/software/rexml/docs/tutorial.html
Parses the XML file MYFILE.xml, and prints the text from each record node's uploadlist node, unless the upload_list node is empty.
Expand |
Embed | Plain Text
require "rexml/document" file = File.new( "MY_FILE.xml" ) doc = REXML::Document.new file doc.elements.each("document/record/upload_list"){ |element| puts element.text if element.text }
You need to login to post a comment.
