我正在使用Savon对于 SOAP 请求以及 SOAP 请求 XML 的某些位置,我需要生成这段代码:
<content>
<item a="1" b="0"/>
<item a="2" b="0"/>
<item a="3" b="0"/>
</content>
最好的方法是什么?
最佳答案
我找到了解决方案。
soap.body = {
#... other tags
"content" => {
"item" => ["", "", ""],
:attributes! => {
"item" => {
"a" => ["1", "2", "3"],
"b" => ["0", "0", "0"]
}
}
}
#... other tags
}
关于ruby - Savon:XML 标签数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7001957/