Search code examples
objective-cxpathtouchxml

Objective C, A Question about xpath


<methodResponse>
    <params>
        <param>
            <value>
                <struct>
                    <member>
                        <name>topic_id</name>
                        <value>
                            <string>102</string>
                        </value>
                    </member>
                    <member>
                        <name>topic_title</name>
                        <value>
                            <string>Login test</string>
                        </value>
                    </member>
                </struct>
            </value>
        </param>
    </params>
</methodResponse>

I have this xml.. How to get the value of topic_title using xpath?


Solution

  • /methodResponse
       /params
          /param
             /value
                /struct
                  /member[name='topic_title']
                     /value
                        /string