aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rexml/formatters/default.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml/formatters/default.rb')
-rw-r--r--lib/rexml/formatters/default.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rexml/formatters/default.rb b/lib/rexml/formatters/default.rb
index 77381bdf84..b4d63bc5b5 100644
--- a/lib/rexml/formatters/default.rb
+++ b/lib/rexml/formatters/default.rb
@@ -63,7 +63,7 @@ module REXML
def write_element( node, output )
output << "<#{node.expanded_name}"
- node.attributes.each_attribute do |attr|
+ node.attributes.to_a.sort_by {|attr| attr.name}.each do |attr|
output << " "
attr.write( output )
end unless node.attributes.empty?