On Oct 20, 12:20 pm, "Srinath A." <[email protected]>
wrote:
> Hi,
>
> How to embed ruby code in xml .
>
> here is my XML template :
Well as you've done things your template is just a string so the usual
#{} interpolation will work. I'd encourage you to look at builder
though.
Fred
>
> string = <<EOF
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE ozxmlscene>
> <ozml version="4.0">
> <styleRun style="1091379" offset="0" length="7"/>
> <text>The End</text>
> <object value="84"/>
> <object value="104"/>
> <object value="101"/>
> <object value="32"/>
> <object value="69"/>
> <object value="110"/>
> <object value="100"/>
> <override>0</override>
> <aspectRatio>0.8999999762000001</aspectRatio>
> </ozml>
> EOF
> xml = string.gsub('"',"'")
>
> I need to use loop below <text> tag generating object values dynamically
> .
> How to embed this in xml ?
>
> end_title_name.each_byte do |title|
> "<object value=title/>"
> end
>
> thanks,
> sri..
> --
> Posted viahttp://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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---