Hi, I need to output the following in an rxml template: <coordinates> -122.3662784465226,37.81884427772081,30 -122.3652480684771,37.81926777010555,30 -122.365640222455,37.81986126286519,30 -122.36666937925,37.81942987753481,30 -122.3662784465226,37.81884427772081,30 </coordinates> what I am struggling with are the text lines: xml.coordinates do #what goes here? end I experimented with xml.text! but I could not find a way to preserve the indentation and get the linebreaks Thanks for any help! Ingo -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ingo Weiss wrote:> <coordinates> > -122.3662784465226,37.81884427772081,30 > -122.3652480684771,37.81926777010555,30 > -122.365640222455,37.81986126286519,30 > -122.36666937925,37.81942987753481,30 > -122.3662784465226,37.81884427772081,30 > </coordinates> > > what I am struggling with are the text lines: > > xml.coordinates do > #what goes here?xml << ''-122...'' # right?> end<< goes in with no translation.> I experimented with xml.text! but I could not find a way to preserve the > indentation and get the linebreaksWhat about xml.text! "-122...\n" ? -- Phlip http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> What about xml.text! "-122...\n" ?This worked, but I had to manually add spaces to get the indentation (not that that would be terribly important, but...) Thanks! Ingo -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ingo Weiss wrote:>> What about xml.text! "-122...\n" ? > > This worked, but I had to manually add spaces to get the indentation > (not that that would be terribly important, but...)Maybe if you use the """ (multiline string) or << (here doc) operator it will keep the indentation? b> > Thanks! > Ingo >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> What about xml.text! "-122...\n" ?I''m having an extra problem now, I''m doing this: xml.Data ''ss:Type'' => ''String'' do xml.text! format_excel_html(block_content) end Now it works, but the output is like this: <Data> bla bla bla </Data> The problem I have is the whitespace the builder creates around my content. Does anyone know a trick to get rid of this whitespace? Thanks, Onno -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---