XML : Builder GEM XML formatting

I'm using the Ruby Gem Builder, and I need this output..

  <?xml version="1.0" encoding="utf-8"?>  <fileAttachment> "name of file here.xls"    <Data>zip</Data>    <Size>7434</Size>  </fileAttachment>    

My code is below, but the file name next to "fileAttachment" just isn't working.. This is something simple I'm just not seeing it?? The error says I can't mix text with a block.. makes sense I just don't know the correct syntax.

   xml = Builder::XmlMarkup.new(:indent => 2 )   xml.instruct! :xml,:version=>"1.0", :encoding => "utf-8"     xml.fileAttachment("name of file here.xls") do       xml.Data "zip"       xml.Size "7434"     end    

No comments:

Post a Comment