Hey everyone, I was poking around with to_xml today, and I was semi-surprised to see the "not all elements respond to to_xml" message... I had an array of strings. My first suggestion is that String would just replace the basic entity chars that XML defines, much like ERB::Util#html_escape: & ==> & < ==> <> ==> >" ==> " '' ==> ' #html_escape would cover this except for the ' case, which appears to be needed as well. Any opinions? Patch + tests would be pretty easy to supply :) Tony --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
tcollen@gmail.com
2007-Mar-26 20:56 UTC
Re: String doesn''t respond to to_xml -- should it?
On Mar 26, 3:17 pm, "tcol...@gmail.com" <tcol...@gmail.com> wrote:> I was poking around with to_xml today, and I was semi-surprised to see > the "not all elements respond to to_xml" message... I had an array of > strings.<snip> Retracted.. Strings passed to builder are xml-escaped, so I''ll write a custom #to_xml for a wrapper object.. sorry for the noise ;) Tony --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---