From: ted Date: 2005-09-04T06:16:27+09:00 Subject: How to get REXML to return items in order?? Hi, I'm new to Ruby and can't figure out why REXML isn't returning the elements in the order they appear in the document. Here's my code and the document. Any help appreciated. Thanks, Ted #============================== # ruby #============================== xml = REXML::Document.new(File.open("test.html")); xml.elements.each("//span[@class='c5']") do |element| puts element end #============================== # the "test.html" file #==============================
1st Title
2nd Title
3rd Title