Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I am trying to use yql with xpath and its not working please advice me
- [code]
- SELECT * FROM xml WHERE
- url="http://gdata.youtube.com/feeds/api/videos?fields=entry(media:group(media:title,media:player,yt:duration))&max-results=2"
- [/code]
- returns
- [code]
- <?xml version="1.0" encoding="UTF-8"?>
- <query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
- yahoo:count="1" yahoo:created="2011-09-17T02:42:07Z" yahoo:lang="en-US">
- <diagnostics>
- <publiclyCallable>true</publiclyCallable>
- <url execution-start-time="1" execution-stop-time="329"
- 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>
- <user-time>330</user-time>
- <service-time>328</service-time>
- <build-version>21440</build-version>
- </diagnostics>
- <results>
- <feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007">
- <entry>
- <media:group>
- <media:player url="http://www.youtube.com/watch?v=3071VQtKEAE&feature=youtube_gdata_player"/>
- <media:title type="plain">Minecraft - "Shadow of Israphel" Part 16: A Beacon of Hope</media:title>
- <yt:duration seconds="1368"/>
- </media:group>
- </entry>
- <entry>
- <media:group>
- <media:player url="http://www.youtube.com/watch?v=ndVVrZqHqA8&feature=youtube_gdata_player"/>
- <media:title type="plain">Minecraft - "Better Than Wolves" Mod Spotlight</media:title>
- <yt:duration seconds="1681"/>
- </media:group>
- </entry>
- </feed>
- </results>
- </query>
- [/code]
- I wan to add a xpath filter to select on the entry whihc has a duration seconds 1681
- so I added
- [code]
- SELECT * FROM xml WHERE
- 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]'
- [/code]
- this return
- [code]
- <?xml version="1.0" encoding="UTF-8"?>
- <query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
- yahoo:count="0" yahoo:created="2011-09-17T02:43:51Z" yahoo:lang="en-US">
- <results/>
- </query>
- [/code]
- I dont understand why xpath filer is not working please advice me
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement