7

I'm using Ruby's XML Builder and trying to find the proper syntax to recreate the following RSS 2.0 declaration:

<rss version="2.0" 
xmlns:g="http://base.google.com/ns/1.0">

What's the appropriate way of going about this with XML Builder to put together the above block?

randombits
  • 47,058
  • 76
  • 251
  • 433

1 Answers1

13

Try this builder script:

xml.rss :version => "2.0", "xmlns:g" => "http://base.google.com/ns/1.0" do
end

This will yield:

<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
</rss>
sflinter
  • 404
  • 3
  • 6
  • The above method works perfectly. Another option is to use:- xml.rss "version" => "2.0", "xmlns:g" => "http://base.google.com/ns/1.0" do end for uniformity. – Gyanendra Singh Sep 20 '12 at 11:49