From: Robert Klemme Date: 2007-03-19T20:05:05+09:00 Subject: Re: Attribute Ordering in REXML On 19.03.2007 11:38, caritos wrote: > Is there any way of specify the order of the attributes in REXML. I > can't find any way of doing this in the documentation. > > The two methods that I found "add_attribute(key, value=nil)" and > "add_attributes(hash)" provides no way of specifying the order. > > When I output my xml document to a file or stdout, the order of the > attributes are in a different order. Any work around for this problem? In XML order of attributes is unspecified and does not matter. By relying on it you will almost certainly run into trouble. If you need specific ordering then you need to use nested elements. Other than that you either need to hack REXML code or change your XML document after it is created. Kind regards robert