0
FieldRefの下の名前ノードが子ノードではなくFieldRefの属性であるように変更する必要はありますか?値ノードを親ノードの属性に移動させるにはどうすればよいですか?
泡は現在、以下の石鹸を生成します。私は必要なもの
<ns0:query>
<ns0:Where>
<ns0:Eq>
<ns0:FieldRef>
<ns0:Name>_ows_ID</ns0:Name>
</ns0:FieldRef>
<ns0:Value>66</ns0:Value>
</ns0:Eq>
</ns0:Where>
</ns0:query>
はこれです:
<ns0:query>
<ns0:Where>
<ns0:Eq>
<ns0:FieldRef Name="_ows_ID">
</ns0:FieldRef>
<ns0:Value>66</ns0:Value>
</ns0:Eq>
</ns0:Where>
</ns0:query>
最初のXML構造は、以下のコードから泡によって生成されます。
(query){
Where =
(Where){
Eq =
(Eq){
FieldRef =
(FieldRef){
Name = "_ows_ID"
}
Value = "66"
}
}
}
で
q = c.factory.create('GetListItems.query')
q['Where']=InstFactory.object('Where')
q['Where']['Eq']=InstFactory.object('Eq')
q['Where']['Eq']['FieldRef']=InstFactory.object('FieldRef')
q['Where']['Eq']['FieldRef'].Name='_ows_ID'
q['Where']['Eq']['Value']='66'
とprint(q)
結果ここでは、SOAPリクエスト
c = client.Client(url='https://community.site.edu/_vti_bin/Lists.asmx?WSDL',
transport=WindowsHttpAuthenticated(username='domain\user',
password='password')
)
ll= c.service.GetListItems(listName="{BD59F6D9-AB4B-474D-BCC7-E4B4BEA7EB27}",
viewName="{407A6AB9-97CF-4E1F-8544-7DD67CEA997B}",
query=q
)
何が問題なのですか?あなたは最初に2番目のように見えることはできませんか? – Jack
@Jack FieldRefの下のNameノードが子ノードではなくFieldRefの属性であるように、変更する必要があるのは何ですか? –