Advertisement
fachhoch

yql-problem

Sep 16th, 2011
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. I am trying to use yql with xpath and its not working please advice me
  2.  
  3. [code]
  4. SELECT * FROM xml WHERE
  5. url="http://gdata.youtube.com/feeds/api/videos?fields=entry(media:group(media:title,media:player,yt:duration))&max-results=2"
  6. [/code]
  7.  
  8. returns
  9. [code]
  10. <?xml version="1.0" encoding="UTF-8"?>
  11. <query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
  12. yahoo:count="1" yahoo:created="2011-09-17T02:42:07Z" yahoo:lang="en-US">
  13. <diagnostics>
  14. <publiclyCallable>true</publiclyCallable>
  15. <url execution-start-time="1" execution-stop-time="329"
  16. execution-time="328" proxy="DEFAULT"><![CDATA[http://gdata.youtube.com/feeds/api/videos?fields=entry(media:group(media:title,media:player,yt:duration))&max-results=2]]></url>
  17. <user-time>330</user-time>
  18. <service-time>328</service-time>
  19. <build-version>21440</build-version>
  20. </diagnostics>
  21. <results>
  22. <feed xmlns="http://www.w3.org/2005/Atom"
  23. xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007">
  24. <entry>
  25. <media:group>
  26. <media:player url="http://www.youtube.com/watch?v=3071VQtKEAE&amp;feature=youtube_gdata_player"/>
  27. <media:title type="plain">Minecraft - "Shadow of Israphel" Part 16: A Beacon of Hope</media:title>
  28. <yt:duration seconds="1368"/>
  29. </media:group>
  30. </entry>
  31. <entry>
  32. <media:group>
  33. <media:player url="http://www.youtube.com/watch?v=ndVVrZqHqA8&amp;feature=youtube_gdata_player"/>
  34. <media:title type="plain">Minecraft - "Better Than Wolves" Mod Spotlight</media:title>
  35. <yt:duration seconds="1681"/>
  36. </media:group>
  37. </entry>
  38. </feed>
  39. </results>
  40. </query>
  41. [/code]
  42.  
  43.  
  44. I wan to add a xpath filter to select on the entry whihc has a duration seconds 1681
  45.  
  46.  
  47. so I added
  48.  
  49. [code]
  50. SELECT * FROM xml WHERE
  51. url="http://gdata.youtube.com/feeds/api/videos?fields=entry(media:group(media:title,media:player,yt:duration))&max-results=2" and xpath='//yt:duration[@seconds=1681]'
  52. [/code]
  53.  
  54. this return
  55. [code]
  56. <?xml version="1.0" encoding="UTF-8"?>
  57. <query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
  58. yahoo:count="0" yahoo:created="2011-09-17T02:43:51Z" yahoo:lang="en-US">
  59. <results/>
  60. </query>
  61. [/code]
  62.  
  63. I dont understand why xpath filer is not working please advice me
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement