Savon: Array of XML tags
问题 I'm using Savon for SOAP requests and in some place of the SOAP request XML, I need to generate this piece of code: <content> <item a="1" b="0"/> <item a="2" b="0"/> <item a="3" b="0"/> </content> What's the best way to do this? 回答1: I have found the solution. soap.body = { #... other tags "content" => { "item" => ["", "", ""], :attributes! => { "item" => { "a" => ["1", "2", "3"], "b" => ["0", "0", "0"] } } } #... other tags } 回答2: Savon v0.9.7 comes with improved support for Builder and I