Another interesting YQL feature: XML with callback (JSON-P-X)Thursday, July 9th, 2009 at 4:20 pm
XML with callback?
select * from html where url=”http://twitter.com/codepo8”
and xpath = “//div[@id=’following_list’]”
The XML output of this call is a pretty hefty XML document with all the HTML as an XML node structure.
title: “Jemima Kiss”
alt: “Jemima Kiss”
//... and so on …
Converting this back into HTML could be quite an annoying job – not to say slow. This is why YQL now offers the callback parameter for XML. The JSONP-X output as it is called in the YQL changelog makes this task a lot easier by returning a JSON object with the XML as a string:
This makes it dead easy to render the results back as HTML:
Nice? I think so!