开发者

Ruby XML Builder, how to create this namespace?

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 开发者_StackOverflow社区together the above block?


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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜