I''ve hit a problem which no one on the regular rails list seems to
know about. I''ve studied the rails code but I can''t get to the
bottom
of it, so I thought I''d ask here. It''s about
active_support/mini_xml:
Seems to me that {}.to_xml is generating one level too many of xml
structure, but I may be interpreting things incorrectly... I''ve
reduced my question to a very simple case:
>> b
=> {"elist"=>[{:element=>1}, {:element=>2}]}
>> puts b.to_xml
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<elist type="array">
<elist>
<element type="integer">1</element>
</elist>
<elist>
<element type="integer">2</element>
</elist>
</elist>
</hash>
Also with skip_types:
>> puts b.to_xml(:skip_types => true)
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<elist>
<elist>
<element>1</element>
</elist>
<elist>
<element>2</element>
</elist>
</elist>
</hash>
There''s one too many levels of <elist>. Is this a bug or
intentional?
Is there a way to get it to remove that extra layer?
What I would like/expect the behavior to be is:
<hash>
<elist>
<element>1</element>
<element>2</element>
</elist>
</hash>
Thoughts?
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.