diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-28 21:40:59 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-28 21:40:59 +0000 |
commit | 197eea3404169141abd79d6edcd38291d8aa983b (patch) | |
tree | 259042e7c26d2f100881ec4db7eaf68e9909f91a /lib/rexml | |
parent | d05112b942c5bbdcbb71201e6c209676f2da7915 (diff) |
* 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')
-rw-r--r-- | lib/rexml/formatters/default.rb | 4 |
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? |