我想出xmlns='http://www.w3.org/2005/Atom'
现在提要和条目标签中。但不知道为什么我的入口标签不见了 xmlns='http://www.w3.org/2005/Atom'
这是我想要达到的结果
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:batch='http://schemas.google.com/gdata/batch'>
<entry xmlns='http://www.w3.org/2005/Atom' xmlns:app='http://www.w3.org/2007/app' xmlns:sc='http://schemas.google.com/structuredcontent/2009' xmlns:scp='http://schemas.google.com/structuredcontent/2009/products'>
这是我的代码
builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
xml.feed('xmlns' => 'http://www.w3.org/2005/Atom',
'xmlns:batch' => 'http://schemas.google.com/gdata/batch') do
xml.entry('xmlns' => 'http://www.w3.org/2005/Atom',
'xmlns:app' => 'http://www.w3.org/2007/app',
'xmlns:sc' => 'http://schemas.google.com/structuredcontent/2009',
'xmlns:scp' => 'http://schemas.google.com/structuredcontent/2009/products')
end
end