user813360
user813360

Reputation: 11

XPath for xml in YQL?

So, I am trying to do the following YQL query:

http://developer.yahoo.com/yql/console/?q=select%20*%20from%20xml%20where%20url%3D%22http%3A%2F%2Fws.audioscrobbler.com%2F2.0%2F%3Fmethod%3Dartist.getsimilar%26artist%3Djayz%26api_key%3Dd47ca2514e350dd0dac6fc46a507585a%22%20#h=select%20*%20from%20xml%20where%20url%3D%22http%3A//ws.audioscrobbler.com/2.0/%3Fmethod%3Dartist.getsimilar%26artist%3Djayz%26api_key%3Dd47ca2514e350dd0dac6fc46a507585a%22

I would like the result to have only the artist names. If someone can help writing a XPath to result only artist names, it would be much appreciated!

Upvotes: 1

Views: 548

Answers (1)

Alex Aza
Alex Aza

Reputation: 78447

Like this?

select * from xml where url="http://ws.audioscrobbler.com/2.0/?method=artist.getsimilar&artist=jayz&api_key=d47ca2514e350dd0dac6fc46a507585a" and itemPath="//similarartists/artist/name"

Upvotes: 3

Related Questions