hi, i am looking for a solution whereupon calling myEntityObject.to_xml does not convert my attributes containing underscores into hyphens. at the moment an attribute named "my_own_attribute" is converted into <my-own-attribute>. does anybody have an idea how to change that and have to_xml generate <my_own_attribute> thanks ciao robertj -- Posted via http://www.ruby-forum.com/.
On 8/15/06, Robert Kuzelj <robertj@pragmatico.org> wrote:> hi, > > i am looking for a solution whereupon > calling myEntityObject.to_xml does not > convert my attributes containing underscores > into hyphens. > > at the moment an attribute named "my_own_attribute" > is converted into <my-own-attribute>. > > does anybody have an idea how to change that > and have to_xml generate <my_own_attribute> > > thanks > > ciao robertj > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Robert, Monkeypatch the to_xml() method. Or create a patch where to_xml() could take a :underscore => false parameter and submit to trac. Perhaps others would want this functionality... -- Zack Chandler http://depixelate.com
Zack Chandler wrote:> On 8/15/06, Robert Kuzelj <robertj@pragmatico.org> wrote: >> hi, >> >> i am looking for a solution whereupon >> calling myEntityObject.to_xml does not >> convert my attributes containing underscores >> into hyphens. >> >> at the moment an attribute named "my_own_attribute" >> is converted into <my-own-attribute>. >> >> does anybody have an idea how to change that >> and have to_xml generate <my_own_attribute> >> >> thanks >> >> ciao robertj >> >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > Robert, > Monkeypatch the to_xml() method. > Or create a patch where to_xml() could take a :underscore => false > parameter and submit to trac. Perhaps others would want this > functionality...I put in a patch that was committed into RoR Edge where you can pass :dasherize => false to to_xml() and it won''t dasherize your attributes. Hopefully, it''ll be in 1.2. Regards, Blair