aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rexml/formatters
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-28 21:40:59 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-28 21:40:59 +0000
commit197eea3404169141abd79d6edcd38291d8aa983b (patch)
tree259042e7c26d2f100881ec4db7eaf68e9909f91a /lib/rexml/formatters
parentd05112b942c5bbdcbb71201e6c209676f2da7915 (diff)
downloadruby-197eea3404169141abd79d6edcd38291d8aa983b.tar.gz
* lib/rexml/formatters/default.rb (write_attribute): fix an
exception when printing a document when duplicate namespaced attributes exist. Thanks, Alexey Froloff [ruby-core:2389] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/formatters')
-rw-r--r--lib/rexml/formatters/default.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rexml/formatters/default.rb b/lib/rexml/formatters/default.rb
index 56a1d93783..db44453e1e 100644
--- a/lib/rexml/formatters/default.rb
+++ b/lib/rexml/formatters/default.rb
@@ -63,7 +63,9 @@ module REXML
def write_element( node, output )
output << "<#{node.expanded_name}"
- node.attributes.to_a.sort_by {|attr| attr.name}.each do |attr|
+ node.attributes.to_a.map { |a|
+ Hash === a ? a.values : a
+ }.flatten.sort_by {|attr| attr.name}.each do |attr|
output << " "
attr.write( output )
end unless node.attributes.empty?