From: Bob Aiello Date: 2011-09-05T04:02:25+09:00 Subject: Ruby and XML --------------060407020100060505020309 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi Everyone, I am new to Ruby and trying to use it to parse XML files so that I can verify that name/value pairs in two (or more) XML files are defined consistently I have been trying to use the rexml API http://www.germane-software.com/software/rexml/ The website has been down a lot lately and I haven't found too many other sources for information Here is a snippet of my code require "rexml/document" include REXML file1 = File.new( "test.xml" ) doc1 = REXML::Document.new file1 names1 = XPath.each(doc1, "//name") { |e|} values1 = XPath.each(doc1, "//value") { |e|} now I can parse names1 and values1 and then do the same for the second XML file. This approach is not great because it does ensure that the name/value pairs are siblings. I am wondering if there is a better way to do this. Any help would be great appreciated. BTW - I would welcome articles on using Ruby for configuration, release and deployment management on CM Crossroads (www.cmcrossroads.com) Bob Aiello http://www.linkedin.com/in/BobAiello bob.aiello@ieee.org --------------060407020100060505020309--