How they differ? Does the to_xml method of the classes array/hash/object is based on ROXML lib? As I see in http://roxml.rubyforge.org/#quickstart, roxml needs we define the class (class Book in the guide) before to convert a object to xml. Moreover, the method to_xml (when not using "include ROXML") just accepts any existing object, what is much suitable. I need to compare and tranfer some records between local and remote systems periodically. The tables (mysql) has simple varchar/integer/ date/decimal types. Which type of xml mapping is recommended to achieve this task? ROXML or pure to_xml method? Thank you! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 5 Jan 2009, at 20:08, Tom Lobato wrote:> > > How they differ? > > Does the to_xml method of the classes array/hash/object is based on > ROXML lib? > As I see in http://roxml.rubyforge.org/#quickstart, roxml needs we > define the class (class Book in the guide) before to convert a object > to xml. Moreover, the method to_xml (when not using "include ROXML") > just accepts any existing object, what is much suitable. >roxml is trying to solve a more general problem - if you models aren''t activerecord models then they are not going to have a particularly useful to_xml on it (the time i used it was generated xml to pass to a webservice) It''s also pretty handy for parsing incoming xml. Fred> I need to compare and tranfer some records between local and remote > systems periodically. The tables (mysql) has simple varchar/integer/ > date/decimal types. > Which type of xml mapping is recommended to achieve this task? ROXML > or pure to_xml method? > > > > Thank you! > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 5 jan, 18:16, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> roxml is trying to solve a more general problem - if you models aren''t > activerecord models then they are not going to have a particularly > useful to_xml on it (the time i used it was generated xml to pass to a > webservice)Sorry my bad english. I`m not sure if I understood your answer. My model is activerecord based, but has just simple attributes (strings, integers, dates). Do you mean I don`t need ROXML in this simple case? The non- roxml to_xml/from_xml methods can do the job?> > It''s also pretty handy for parsing incoming xml. >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 5 Jan 2009, at 20:40, Tom Lobato wrote:> > > > On 5 jan, 18:16, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> roxml is trying to solve a more general problem - if you models >> aren''t >> activerecord models then they are not going to have a particularly >> useful to_xml on it (the time i used it was generated xml to pass >> to a >> webservice) > > Sorry my bad english. I`m not sure if I understood your answer. > My model is activerecord based, but has just simple attributes > (strings, integers, > dates). Do you mean I don`t need ROXML in this simple case? The non- > roxml > to_xml/from_xml methods can do the job? >I would have though to_xml/from_xml would be quite enough here. Fred>> >> It''s also pretty handy for parsing incoming xml. >> > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ok, thank you very much!! I will try it. Anyway, What are the "more general problem" you said? On 5 jan, 19:00, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 5 Jan 2009, at 20:40, Tom Lobato wrote: > > > > > > > On 5 jan, 18:16, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> roxml is trying to solve a more general problem - if you models > >> aren''t > >> activerecord models then they are not going to have a particularly > >> useful to_xml on it (the time i used it was generated xml to pass > >> to a > >> webservice) > > > Sorry my bad english. I`m not sure if I understood your answer. > > My model is activerecord based, but has just simple attributes > > (strings, integers, > > dates). Do you mean I don`t need ROXML in this simple case? The non- > > roxml > > to_xml/from_xml methods can do the job? > > I would have though to_xml/from_xml would be quite enough here. > > Fred > > > > >> It''s also pretty handy for parsing incoming xml.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 5 Jan 2009, at 21:18, Tom Lobato wrote:> > ok, thank you very much!! > I will try it. > > Anyway, What are the "more general problem" you said? >Just the more general case of mapping xml fragments to objects. Fred> On 5 jan, 19:00, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> On 5 Jan 2009, at 20:40, Tom Lobato wrote: >> >> >> >> >> >>> On 5 jan, 18:16, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >>> wrote: >>>> roxml is trying to solve a more general problem - if you models >>>> aren''t >>>> activerecord models then they are not going to have a particularly >>>> useful to_xml on it (the time i used it was generated xml to pass >>>> to a >>>> webservice) >> >>> Sorry my bad english. I`m not sure if I understood your answer. >>> My model is activerecord based, but has just simple attributes >>> (strings, integers, >>> dates). Do you mean I don`t need ROXML in this simple case? The non- >>> roxml >>> to_xml/from_xml methods can do the job? >> >> I would have though to_xml/from_xml would be quite enough here. >> >> Fred >> >> >> >>>> It''s also pretty handy for parsing incoming xml. > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---