rossmurphy Posted February 10, 2010 Share Posted February 10, 2010 Trying to retrieve the value of medal where pattern_name=X. I have tried like this: $row = $apicall->xpath('row[@pattern_name="Curling"]@medal'); <row last_win_date="1265326562133" medal="G" pattern_name="Cross Country" user_alias="Player1" user_id="WFG120"/> <row last_win_date="1265356801650" medal="G" pattern_name="Alpine" user_alias="Player1" user_id="WFG120"/> <row last_win_date="1265354641707" medal="G" pattern_name="Any 2 Lines" user_alias="Player1" user_id="WFG120"/> Anyone know how to do this? Quote Link to comment https://forums.phpfreaks.com/topic/191673-xpath-query/ Share on other sites More sharing options...
Maq Posted February 10, 2010 Share Posted February 10, 2010 I believe you're missing a back slash before the medal attribute. Try: row[@pattern_name="Curling"]/@medal It would also be nice to give us more information. Such as errors, unexpected results, what you expect, etc... Quote Link to comment https://forums.phpfreaks.com/topic/191673-xpath-query/#findComment-1010333 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.