From: Brad Symons Date: 2011-05-06T21:28:28+09:00 Subject: newbie to using builder(xml) Hi, I am just trying to understand how builder sorts the content of an xml node, because no matter how I arrange the options, they appears sorted differently in the irb. ids = ["1","2","3"] alphas = ["xxx","yyy","zzz"] xml = Builder::XmlMarkup.new( :target => $stdout, :indent => 2 ) xml.instruct! :xml, :version => "1.1", :encoding => "US-ASCII" ids.each do |num| xml.programme(:alpha => alphas.fetch(ids.index(num)), :id => num) end This prints: But if I re-arrange the positioning to: xml.programme(:id => num, :alpha => alphas.fetch(ids.index(num))) It still produces: NO CHANGE!!! Also, is there an easy way to map the values of the arrays together, than using the fetch method? THANKS IN ADVANCE!! -- Posted via http://www.ruby-forum.com/.