开发者

XPath Xpression for XML-RPC

开发者 https://www.devze.com 2023-03-19 19:53 出处:网络
I have following XMLRPC response <value><struct> <member><name>dedicatedAccountID</name><value><i4>开发者_运维百科1</i4></value></member>

I have following XMLRPC response

<value><struct>
        <member><name>dedicatedAccountID</name><value><i4>开发者_运维百科1</i4></value></member>
        <member><name>dedicatedAccountValue1</name><value><string>0</string></value></member>
        <member><name>expiryDate</name><value><dateTime.iso8601>99991231T00:00:00+1200</dateTime.iso8601></value></member>
    </struct></value>
    <value><struct>
        <member><name>dedicatedAccountID</name><value><i4>2</i4></value></member>
        <member><name>dedicatedAccountValue1</name><value><string>15635</string></value></member>
        <member><name>expiryDate</name><value><dateTime.iso8601>99991231T00:00:00+1200</dateTime.iso8601></value></member>
    </struct></value>
    <value><struct>
        <member><name>dedicatedAccountID</name><value><i4>3</i4></value></member>
        <member><name>dedicatedAccountValue1</name><value><string>0</string></value></member>
        <member><name>expiryDate</name><value><dateTime.iso8601>99991231T00:00:00+1200</dateTime.iso8601></value></member>
    </struct></value>

I want to get value of dedicatedAccountValue1 where member name is dedicatedAccountID its value is 1.

Regards, imran


//value/struct[member[name = 'dedicatedAccountID' and value/* = '1']]/member[name = 'dedicatedAccountValue1']/value/*


    //Struct[member/name='dedicatedAccountID' and 
member/value/i4='1']/member[name='dedicatedAccountValue1']/value

Try this. Not tested

0

精彩评论

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