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 | d4a2242ce61441d0901cb750d497be08ff5ef4f6 (patch) | |
tree | 259042e7c26d2f100881ec4db7eaf68e9909f91a /lib | |
parent | c37753e5a5d49d549255fb6cc60321a3788a4f2a (diff) | |
download | ruby-d4a2242ce61441d0901cb750d497be08ff5ef4f6.tar.gz ruby-d4a2242ce61441d0901cb750d497be08ff5ef4f6.tar.xz ruby-d4a2242ce61441d0901cb750d497be08ff5ef4f6.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@25956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-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 56a1d9378..db44453e1 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? |